diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-04-10 22:43:25 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-04-10 23:16:03 +0200 |
commit | 8da1fff85a90b2fad1310e629ed2056d6c43f50e (patch) | |
tree | 5d2b159b96daf0d88a513be459362c78e86f5993 /libavfilter/vf_pp.c | |
parent | f8eabab04d1b429bc0332c06a46ae3c344a4cb15 (diff) | |
download | ffmpeg-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/vf_pp.c')
-rw-r--r-- | libavfilter/vf_pp.c | 18 |
1 files changed, 14 insertions, 4 deletions
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, + }; |