aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-04-10 22:43:25 +0200
committerClément Bœsch <ubitux@gmail.com>2013-04-10 23:16:03 +0200
commit8da1fff85a90b2fad1310e629ed2056d6c43f50e (patch)
tree5d2b159b96daf0d88a513be459362c78e86f5993 /libavfilter
parentf8eabab04d1b429bc0332c06a46ae3c344a4cb15 (diff)
downloadffmpeg-8da1fff85a90b2fad1310e629ed2056d6c43f50e.tar.gz
lavfi/pp: switch to an AVOptions-based system.
Also add and use the '|' separator instead of ':' since it's incompatible with the new option system...
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/avfilter.c1
-rw-r--r--libavfilter/vf_pp.c18
2 files changed, 15 insertions, 4 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index cd47f47d39..13e9ac9098 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -686,6 +686,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
!strcmp(filter->filter->name, "format") ||
!strcmp(filter->filter->name, "noformat") ||
!strcmp(filter->filter->name, "perms") ||
+ !strcmp(filter->filter->name, "pp" ) ||
!strcmp(filter->filter->name, "aperms") ||
!strcmp(filter->filter->name, "resample") ||
!strcmp(filter->filter->name, "showspectrum") ||
diff --git a/libavfilter/vf_pp.c b/libavfilter/vf_pp.c
index b7f35d3628..7dfb448790 100644
--- a/libavfilter/vf_pp.c
+++ b/libavfilter/vf_pp.c
@@ -31,21 +31,29 @@
#include "libpostproc/postprocess.h"
typedef struct {
+ const AVClass *class;
+ char *subfilters;
int mode_id;
pp_mode *modes[PP_QUALITY_MAX + 1];
void *pp_ctx;
} PPFilterContext;
+#define OFFSET(x) offsetof(PPFilterContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+static const AVOption pp_options[] = {
+ { "subfilters", "set postprocess subfilters", OFFSET(subfilters), AV_OPT_TYPE_STRING, {.str="de"}, .flags = FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(pp);
+
static av_cold int pp_init(AVFilterContext *ctx, const char *args)
{
int i;
PPFilterContext *pp = ctx->priv;
- if (!args || !*args)
- args = "de";
-
for (i = 0; i <= PP_QUALITY_MAX; i++) {
- pp->modes[i] = pp_get_mode_by_name_and_quality(args, i);
+ pp->modes[i] = pp_get_mode_by_name_and_quality(pp->subfilters, i);
if (!pp->modes[i])
return AVERROR_EXTERNAL;
}
@@ -171,4 +179,6 @@ AVFilter avfilter_vf_pp = {
.inputs = pp_inputs,
.outputs = pp_outputs,
.process_command = pp_process_command,
+ .priv_class = &pp_class,
+
};