aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-11 01:14:01 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-11 01:18:18 +0200
commitab6091f8e21df7280f2b50fd6226bbc130fb060a (patch)
treec4fbd5b558abb6993e5aeb9b6dd3eeca095c86f7 /libavfilter
parent8ac7090c233c0677e59ee5cf7a5817e02c9ec914 (diff)
parent7536c671040f1f3ebc9f0d3b7831dac71436b775 (diff)
downloadffmpeg-ab6091f8e21df7280f2b50fd6226bbc130fb060a.tar.gz
Merge commit '7536c671040f1f3ebc9f0d3b7831dac71436b775'
* commit '7536c671040f1f3ebc9f0d3b7831dac71436b775': vf_yadif: switch to an AVOptions-based system. Conflicts: doc/filters.texi libavfilter/vf_yadif.c libavfilter/yadif.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/avfilter.c1
-rw-r--r--libavfilter/vf_yadif.c70
2 files changed, 29 insertions, 42 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 916d661ac7..8fe2389c80 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -714,6 +714,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
!strcmp(filter->filter->name, "unsharp" ) ||
// !strcmp(filter->filter->name, "scale" ) ||
!strcmp(filter->filter->name, "select") ||
+ !strcmp(filter->filter->name, "yadif" ) ||
0
;
diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index 80076f7517..5d8934b3c6 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -344,32 +344,6 @@ static int request_frame(AVFilterLink *link)
return 0;
}
-#define OFFSET(x) offsetof(YADIFContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
-
-#define CONST(name, help, val, unit) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit }
-
-static const AVOption yadif_options[] = {
- { "mode", "specify the interlacing mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=YADIF_MODE_SEND_FRAME}, 0, 3, FLAGS, "mode"},
- CONST("send_frame", "send one frame for each frame", YADIF_MODE_SEND_FRAME, "mode"),
- CONST("send_field", "send one frame for each field", YADIF_MODE_SEND_FIELD, "mode"),
- CONST("send_frame_nospatial", "send one frame for each frame, but skip spatial interlacing check", YADIF_MODE_SEND_FRAME_NOSPATIAL, "mode"),
- CONST("send_field_nospatial", "send one frame for each field, but skip spatial interlacing check", YADIF_MODE_SEND_FIELD_NOSPATIAL, "mode"),
-
- { "parity", "specify the assumed picture field parity", OFFSET(parity), AV_OPT_TYPE_INT, {.i64=YADIF_PARITY_AUTO}, -1, 1, FLAGS, "parity" },
- CONST("tff", "assume top field first", YADIF_PARITY_TFF, "parity"),
- CONST("bff", "assume bottom field first", YADIF_PARITY_BFF, "parity"),
- CONST("auto", "auto detect parity", YADIF_PARITY_AUTO, "parity"),
-
- { "deint", "specify which frames to deinterlace", OFFSET(deint), AV_OPT_TYPE_INT, {.i64=YADIF_DEINT_ALL}, 0, 1, FLAGS, "deint" },
- CONST("all", "deinterlace all frames", YADIF_DEINT_ALL, "deint"),
- CONST("interlaced", "only deinterlace frames marked as interlaced", YADIF_DEINT_INTERLACED, "deint"),
-
- {NULL},
-};
-
-AVFILTER_DEFINE_CLASS(yadif);
-
static av_cold void uninit(AVFilterContext *ctx)
{
YADIFContext *yadif = ctx->priv;
@@ -420,16 +394,6 @@ static int query_formats(AVFilterContext *ctx)
return 0;
}
-static av_cold int init(AVFilterContext *ctx, const char *args)
-{
- YADIFContext *yadif = ctx->priv;
-
- av_log(ctx, AV_LOG_VERBOSE, "mode:%d parity:%d deint:%d\n",
- yadif->mode, yadif->parity, yadif->deint);
-
- return 0;
-}
-
static int config_props(AVFilterLink *link)
{
AVFilterContext *ctx = link->src;
@@ -463,6 +427,33 @@ static int config_props(AVFilterLink *link)
return 0;
}
+
+#define OFFSET(x) offsetof(YADIFContext, x)
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+#define CONST(name, help, val, unit) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit }
+
+static const AVOption yadif_options[] = {
+ { "mode", "specify the interlacing mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=YADIF_MODE_SEND_FRAME}, 0, 3, FLAGS, "mode"},
+ CONST("send_frame", "send one frame for each frame", YADIF_MODE_SEND_FRAME, "mode"),
+ CONST("send_field", "send one frame for each field", YADIF_MODE_SEND_FIELD, "mode"),
+ CONST("send_frame_nospatial", "send one frame for each frame, but skip spatial interlacing check", YADIF_MODE_SEND_FRAME_NOSPATIAL, "mode"),
+ CONST("send_field_nospatial", "send one frame for each field, but skip spatial interlacing check", YADIF_MODE_SEND_FIELD_NOSPATIAL, "mode"),
+
+ { "parity", "specify the assumed picture field parity", OFFSET(parity), AV_OPT_TYPE_INT, {.i64=YADIF_PARITY_AUTO}, -1, 1, FLAGS, "parity" },
+ CONST("tff", "assume top field first", YADIF_PARITY_TFF, "parity"),
+ CONST("bff", "assume bottom field first", YADIF_PARITY_BFF, "parity"),
+ CONST("auto", "auto detect parity", YADIF_PARITY_AUTO, "parity"),
+
+ { "deint", "specify which frames to deinterlace", OFFSET(deint), AV_OPT_TYPE_INT, {.i64=YADIF_DEINT_ALL}, 0, 1, FLAGS, "deint" },
+ CONST("all", "deinterlace all frames", YADIF_DEINT_ALL, "deint"),
+ CONST("interlaced", "only deinterlace frames marked as interlaced", YADIF_DEINT_INTERLACED, "deint"),
+
+ {NULL},
+};
+
+AVFILTER_DEFINE_CLASS(yadif);
+
static const AVFilterPad avfilter_vf_yadif_inputs[] = {
{
.name = "default",
@@ -482,20 +473,15 @@ static const AVFilterPad avfilter_vf_yadif_outputs[] = {
{ NULL }
};
-static const char *const shorthand[] = { "mode", "parity", "deint", NULL };
-
AVFilter avfilter_vf_yadif = {
.name = "yadif",
.description = NULL_IF_CONFIG_SMALL("Deinterlace the input image."),
.priv_size = sizeof(YADIFContext),
- .init = init,
+ .priv_class = &yadif_class,
.uninit = uninit,
.query_formats = query_formats,
.inputs = avfilter_vf_yadif_inputs,
.outputs = avfilter_vf_yadif_outputs,
-
- .priv_class = &yadif_class,
- .shorthand = shorthand,
};