[FFmpeg-devel] [PATCH] lavfi: add flags to filter specific options

Stefano Sabatini stefasab at gmail.com
Mon Aug 13 13:09:50 CEST 2012


On date Thursday 2012-08-09 23:00:54 +0200, Stefano Sabatini encoded:
> ---
>  libavfilter/af_aformat.c       |    9 +++--
>  libavfilter/af_amerge.c        |    5 ++-
>  libavfilter/af_amix.c          |   14 ++++---
>  libavfilter/af_asetnsamples.c  |   11 ++++--
>  libavfilter/af_asyncts.c       |   13 ++++---
>  libavfilter/af_channelmap.c    |    6 ++-
>  libavfilter/af_channelsplit.c  |    5 ++-
>  libavfilter/af_join.c          |    9 +++--
>  libavfilter/af_silencedetect.c |   12 ++++--
>  libavfilter/asrc_aevalsrc.c    |   18 +++++----
>  libavfilter/asrc_anullsrc.c    |   15 +++++---
>  libavfilter/asrc_flite.c       |   18 ++++++----
>  libavfilter/avf_concat.c       |   10 ++++--
>  libavfilter/avf_showwaves.c    |   15 +++++---
>  libavfilter/buffersrc.c        |   28 ++++++++-------
>  libavfilter/vf_ass.c           |    4 ++-
>  libavfilter/vf_blackdetect.c   |   15 +++++---
>  libavfilter/vf_delogo.c        |   15 ++++----
>  libavfilter/vf_drawtext.c      |   78 ++++++++++++++++++++-------------------
>  libavfilter/vf_fade.c          |   17 +++++----
>  libavfilter/vf_fps.c           |    4 ++-
>  libavfilter/vf_lut.c           |   23 ++++++------
>  libavfilter/vf_overlay.c       |    8 +++--
>  libavfilter/vsrc_cellauto.c    |   36 ++++++++++---------
>  libavfilter/vsrc_life.c        |   35 ++++++++++--------
>  libavfilter/vsrc_mandelbrot.c  |   40 +++++++++++----------
>  libavfilter/vsrc_testsrc.c     |   31 ++++++++++------
>  27 files changed, 284 insertions(+), 210 deletions(-)

Anyone willing to comment on this?

Note: I followed two distinct styles in the patch:
1.
#define A AV_OPT_FLAG_AUDIO_PARAM
#define A AV_OPT_FLAG_FILTERING_PARAM
...
{ "sample_fmts",     "A comma-separated list of sample formats.", OFFSET(formats_str), AV_OPT_TYPE_STRING, .flags=F|A },

2.
#define FLAGS .flags=AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
...
{ "sample_fmts",     "A comma-separated list of sample formats.", OFFSET(formats_str), AV_OPT_TYPE_STRING, FLAGS },

I switched from 1. to 2. (which I slightly prefer) when editing the
patch, but I can switch back to 1. if people prefer that.

Problems: iteration over component classes requires that no filters
can share the same class, so I'll need to duplicate the shared classes
(relevant in lut and movie).
-- 
FFmpeg = Fundamental Foolish Magnificient Perfectionist Extravagant Guru


More information about the ffmpeg-devel mailing list