diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-03-31 15:04:04 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-03-31 18:22:23 +0200 |
commit | 999a46b12c8ac378fb099ec2e8dc498baea8ddef (patch) | |
tree | 75f8c0247cac7c92ff005ae806d8bcbde82e9c1b /cmdutils.c | |
parent | 7d8ad6c1fa11ec548fc63427656989e0e7c6af8b (diff) | |
download | ffmpeg-999a46b12c8ac378fb099ec2e8dc498baea8ddef.tar.gz |
cmdutils: support filters in the help topic system.
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c index a280ff3d7c..09a5ce139c 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -1613,6 +1613,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; @@ -1633,6 +1655,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); } |