summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_lavfi.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-21 19:33:08 +0200
committerwm4 <wm4@nowhere>2013-07-21 23:27:31 +0200
commit6629a95b928499a46c9686f0800b65aec7fcbb22 (patch)
tree67e158d3678b54fc521b4fedb19a7dd20b823512 /video/filter/vf_lavfi.c
parent111a455ec621103b714a199217471af5f3efe35a (diff)
downloadmpv-6629a95b928499a46c9686f0800b65aec7fcbb22.tar.bz2
mpv-6629a95b928499a46c9686f0800b65aec7fcbb22.tar.xz
options: use m_config for options instead of m_struct
For some reason, both m_config and m_struct are somewhat similar, except that m_config is much more powerful. m_config is used for VOs and some other things, so to unify them. We plan to kick out m_struct and use m_config for everything. (Unfortunately, m_config is also a bit more bloated, so this commit isn't all that great, but it will allow to reduce the option parser mess somewhat.) This commit also switches all video filters to use the option macros. One reason is that m_struct and m_config, even though they both use m_option, store the offsets of the option fields differently (sigh...), meaning the options defined for either are incompatible. It's easier to switch everything in one go. This commit will allow using the -vf option parser for other things, like VOs and AOs.
Diffstat (limited to 'video/filter/vf_lavfi.c')
-rw-r--r--video/filter/vf_lavfi.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/video/filter/vf_lavfi.c b/video/filter/vf_lavfi.c
index 6d5735b433..d1e7a6e0cf 100644
--- a/video/filter/vf_lavfi.c
+++ b/video/filter/vf_lavfi.c
@@ -37,7 +37,6 @@
#include "core/mp_msg.h"
#include "core/m_option.h"
-#include "core/m_struct.h"
#include "core/av_opts.h"
#include "video/img_format.h"
@@ -326,27 +325,21 @@ static int vf_open(vf_instance_t *vf, char *args)
return 1;
}
-#undef ST_OFF
-#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
+#define OPT_BASE_STRUCT struct vf_priv_s
static const m_option_t vf_opts_fields[] = {
- {"graph", ST_OFF(cfg_graph), CONF_TYPE_STRING, CONF_MIN, 1},
- {"sws_flags", ST_OFF(cfg_sws_flags), CONF_TYPE_INT64},
- {"o", ST_OFF(cfg_avopts), CONF_TYPE_STRING},
+ OPT_STRING("graph", cfg_graph, M_OPT_MIN, .min = 1),
+ OPT_INT64("sws_flags", cfg_sws_flags, 0),
+ OPT_STRING("o", cfg_avopts, 0),
{0}
};
-static const m_struct_t vf_opts = {
- "lavfi",
- sizeof(struct vf_priv_s),
- &vf_priv_dflt,
- vf_opts_fields
-};
-
const vf_info_t vf_info_lavfi = {
"libavfilter bridge",
"lavfi",
"",
"",
vf_open,
- &vf_opts
+ .priv_size = sizeof(struct vf_priv_s),
+ .priv_defaults = &vf_priv_dflt,
+ .options = vf_opts_fields,
};