[FFmpeg-devel] [PATCH 2/2] cmdutils: add show_help_protocol for get protocol options

Steven Liu lq at chinaffmpeg.org
Fri Nov 22 10:56:39 EET 2019


Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 fftools/cmdutils.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 84f98b7c04..fe18093ce1 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1870,6 +1870,21 @@ static void show_help_demuxer(const char *name)
         show_help_children(fmt->priv_class, AV_OPT_FLAG_DECODING_PARAM);
 }
 
+static void show_help_protocol(const char *name)
+{
+    const URLProtocol *proto = av_find_protocol_by_name(name);;
+
+    if (!proto) {
+        av_log(NULL, AV_LOG_ERROR, "Unknown protocol '%s'.\n", name);
+        return;
+    }
+
+    printf("Protocol %s:\n", name);
+
+    if (proto->priv_data_class)
+        show_help_children(proto->priv_data_class, AV_OPT_FLAG_DECODING_PARAM);
+}
+
 static void show_help_muxer(const char *name)
 {
     const AVCodecDescriptor *desc;
@@ -2000,6 +2015,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, "protocol")) {
+        show_help_protocol(par);
 #if CONFIG_AVFILTER
     } else if (!strcmp(topic, "filter")) {
         show_help_filter(par);
-- 
2.15.1





More information about the ffmpeg-devel mailing list