summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_stereo3d.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_stereo3d.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_stereo3d.c')
-rw-r--r--video/filter/vf_stereo3d.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/video/filter/vf_stereo3d.c b/video/filter/vf_stereo3d.c
index 555e87f78e..9d546388ff 100644
--- a/video/filter/vf_stereo3d.c
+++ b/video/filter/vf_stereo3d.c
@@ -30,7 +30,6 @@
#include "video/img_format.h"
#include "video/mp_image.h"
#include "vf.h"
-#include "core/m_struct.h"
#include "core/m_option.h"
#include "libavutil/common.h"
@@ -66,7 +65,7 @@ typedef enum stereo_code {
} stereo_code;
typedef struct component {
- stereo_code fmt;
+ int fmt;
unsigned int width;
unsigned int height;
unsigned int off_left;
@@ -455,22 +454,15 @@ const struct m_opt_choice_alternatives stereo_code_names[] = {
{ NULL, 0}
};
-#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[] = {
- {"in", ST_OFF(in.fmt), CONF_TYPE_CHOICE, .priv = (void *)stereo_code_names},
- {"out", ST_OFF(out.fmt), CONF_TYPE_CHOICE, .priv = (void *)stereo_code_names},
- { NULL, NULL, 0, 0, 0, 0, NULL }
+ OPT_GENERAL(int, "in", in.fmt, 0, .type = CONF_TYPE_CHOICE,
+ .priv = (void *)stereo_code_names),
+ OPT_GENERAL(int, "out", out.fmt, 0, .type = CONF_TYPE_CHOICE,
+ .priv = (void *)stereo_code_names),
+ {0}
};
-static const m_struct_t vf_opts = {
- "stereo3d",
- sizeof(struct vf_priv_s),
- &vf_priv_default,
- vf_opts_fields
-};
-
-
//==info struct==//
const vf_info_t vf_info_stereo3d = {
"stereoscopic 3d view",
@@ -478,5 +470,7 @@ const vf_info_t vf_info_stereo3d = {
"Gordon Schmidt",
"view stereoscopic videos",
vf_open,
- &vf_opts
+ .priv_size = sizeof(struct vf_priv_s),
+ .priv_defaults = &vf_priv_default,
+ .options = vf_opts_fields,
};