aboutsummaryrefslogtreecommitdiff
path: root/cmdutils.c
diff options
context:
space:
mode:
authorAnton Khirnov2013-03-28 09:29:00 +0100
committerAnton Khirnov2013-04-11 20:46:11 +0200
commit921046008f5335601f9d76dc3a768eb5cd91e1b9 (patch)
treef150aa2d70a137423891a5c232d4af8791e96cde /cmdutils.c
parente19e8aeeaaff3d4bc8f6065764c93f0298782ac6 (diff)
cmdutils: allow -h filter=<name> to print information about a filter.
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c
index f43f70120a..feee51ce51 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1268,6 +1268,44 @@ 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 *f = avfilter_get_by_name(name);
+ int i, count;
+
+ if (!name) {
+ av_log(NULL, AV_LOG_ERROR, "No filter name specified.\n");
+ return;
+ } else if (!f) {
+ av_log(NULL, AV_LOG_ERROR, "Unknown filter '%s'.\n", name);
+ return;
+ }
+
+ printf("Filter %s [%s]:\n", f->name, f->description);
+
+ printf(" Inputs:\n");
+ count = avfilter_pad_count(f->inputs);
+ for (i = 0; i < count; i++) {
+ printf(" %d %s (%s)\n", i, avfilter_pad_get_name(f->inputs, i),
+ media_type_string(avfilter_pad_get_type(f->inputs, i)));
+ }
+ if (f->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)
+ printf(" dynamic (depending on the options)\n");
+
+ printf(" Outputs:\n");
+ count = avfilter_pad_count(f->outputs);
+ for (i = 0; i < count; i++) {
+ printf(" %d %s (%s)\n", i, avfilter_pad_get_name(f->outputs, i),
+ media_type_string(avfilter_pad_get_type(f->outputs, i)));
+ }
+ if (f->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS)
+ printf(" dynamic (depending on the options)\n");
+
+ if (f->priv_class)
+ show_help_children(f->priv_class, AV_OPT_FLAG_VIDEO_PARAM |
+ AV_OPT_FLAG_AUDIO_PARAM);
+}
+
int show_help(void *optctx, const char *opt, const char *arg)
{
char *topic, *par;
@@ -1288,6 +1326,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);
}