Browse code

cmdutils: support filters in the help topic system.

Clément Bœsch authored on 2013/03/31 22:04:04
Showing 1 changed files
... ...
@@ -1613,6 +1613,28 @@ static void show_help_muxer(const char *name)
1613 1613
         show_help_children(fmt->priv_class, AV_OPT_FLAG_ENCODING_PARAM);
1614 1614
 }
1615 1615
 
1616
+static void show_help_filter(const char *name)
1617
+{
1618
+    const AVFilter *filter;
1619
+
1620
+    if (!name) {
1621
+        av_log(NULL, AV_LOG_ERROR, "No filter name specified.\n");
1622
+        return;
1623
+    }
1624
+    filter = avfilter_get_by_name(name);
1625
+    if (!filter) {
1626
+        av_log(NULL, AV_LOG_ERROR, "Filter '%s' not found.\n", name);
1627
+        return;
1628
+    }
1629
+    printf("Filter %s\n", filter->name);
1630
+    if (filter->description)
1631
+        printf("  %s\n", filter->description);
1632
+    if (filter->priv_class)
1633
+        show_help_children(filter->priv_class, AV_OPT_FLAG_FILTERING_PARAM);
1634
+    else
1635
+        printf("No AVOption available\n");
1636
+}
1637
+
1616 1638
 int show_help(void *optctx, const char *opt, const char *arg)
1617 1639
 {
1618 1640
     char *topic, *par;
... ...
@@ -1633,6 +1655,8 @@ int show_help(void *optctx, const char *opt, const char *arg)
1633 1633
         show_help_demuxer(par);
1634 1634
     } else if (!strcmp(topic, "muxer")) {
1635 1635
         show_help_muxer(par);
1636
+    } else if (!strcmp(topic, "filter")) {
1637
+        show_help_filter(par);
1636 1638
     } else {
1637 1639
         show_help_default(topic, par);
1638 1640
     }