[FFmpeg-devel] [PATCH 2/2] cmdutils: support filters in the help topic system.

Michael Niedermayer michaelni at gmx.at
Sun Mar 31 18:06:11 CEST 2013


On Sun, Mar 31, 2013 at 03:06:00PM +0200, Clément Bœsch wrote:
> ---
>  cmdutils.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/cmdutils.c b/cmdutils.c
> index ca1c965..22f7590 100644
> --- a/cmdutils.c
> +++ b/cmdutils.c
> @@ -1606,6 +1606,28 @@ static void show_help_muxer(const char *name)
>          show_help_children(fmt->priv_class, AV_OPT_FLAG_ENCODING_PARAM);
>  }
>  
> +static void show_help_filter(const char *name)
> +{
> +    const AVFilter *filter;
> +
> +    if (!name) {
> +        av_log(NULL, AV_LOG_ERROR, "No filter name specified.\n");
> +        return;
> +    }
> +    filter = avfilter_get_by_name(name);
> +    if (!filter) {
> +        av_log(NULL, AV_LOG_ERROR, "Filter '%s' not found.\n", name);
> +        return;
> +    }
> +    printf("Filter %s\n", filter->name);
> +    if (filter->description)
> +        printf("  %s\n", filter->description);
> +    if (filter->priv_class)
> +        show_help_children(filter->priv_class, AV_OPT_FLAG_FILTERING_PARAM);
> +    else
> +        printf("No AVOption available\n");
> +}
> +
>  int show_help(void *optctx, const char *opt, const char *arg)
>  {
>      char *topic, *par;
> @@ -1626,6 +1648,8 @@ int show_help(void *optctx, const char *opt, const char *arg)
>          show_help_demuxer(par);
>      } else if (!strcmp(topic, "muxer")) {
>          show_help_muxer(par);
> +    } else if (!strcmp(topic, "filter")) {
> +        show_help_filter(par);
>      } else {
>          show_help_default(topic, par);

LGTM

thnaks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130331/346be17e/attachment.asc>


More information about the ffmpeg-devel mailing list