diff mbox

[FFmpeg-devel,V3,03/11] ffmpeg: support dump bit stream filter options

Message ID fadac5f1-699f-f616-8c23-521508dcd496@gmail.com
State New
Headers show

Commit Message

Jun Zhao March 14, 2018, 5:41 a.m. UTC
From 6b8f199d0028afb3f0a6a10275e4055ddce91a6a Mon Sep 17 00:00:00 2001
From: Jun Zhao <mypopydev@gmail.com>
Date: Thu, 8 Mar 2018 13:50:31 +0800
Subject: [PATCH V3 03/11] ffmpeg: support dump bit stream filter options.

Support dump bit stream filter option in ffmpeg -h full and
ffmpeg -h bsf=FooBar.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
---
 fftools/cmdutils.c   | 17 +++++++++++++++++
 fftools/ffmpeg_opt.c |  3 ++-
 2 files changed, 19 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer March 16, 2018, 12:51 a.m. UTC | #1
On Wed, Mar 14, 2018 at 01:41:52PM +0800, Jun Zhao wrote:
> 

>  cmdutils.c   |   17 +++++++++++++++++
>  ffmpeg_opt.c |    3 ++-
>  2 files changed, 19 insertions(+), 1 deletion(-)
> 354b73b3bf935d05abb5b3ddc9566f1852bcd773  0003-ffmpeg-support-dump-bit-stream-filter-options.patch
> From 6b8f199d0028afb3f0a6a10275e4055ddce91a6a Mon Sep 17 00:00:00 2001
> From: Jun Zhao <mypopydev@gmail.com>
> Date: Thu, 8 Mar 2018 13:50:31 +0800
> Subject: [PATCH V3 03/11] ffmpeg: support dump bit stream filter options.
> 
> Support dump bit stream filter option in ffmpeg -h full and
> ffmpeg -h bsf=FooBar.
> 
> Signed-off-by: Jun Zhao <mypopydev@gmail.com>
> ---
>  fftools/cmdutils.c   | 17 +++++++++++++++++
>  fftools/ffmpeg_opt.c |  3 ++-
>  2 files changed, 19 insertions(+), 1 deletion(-)

will apply

thx

[...]
diff mbox

Patch

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 0c7d13c27a..f9d87f6724 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1897,6 +1897,21 @@  static void show_help_filter(const char *name)
 }
 #endif
 
+static void show_help_bsf(const char *name)
+{
+    const AVBitStreamFilter *bsf = av_bsf_get_by_name(name);
+
+    if (!bsf) {
+        av_log(NULL, AV_LOG_ERROR, "Unknown bit stream filter '%s'.\n", name);
+        return;
+    }
+
+    printf("Bit stream filter %s\n", bsf->name);
+    if (bsf->priv_class)
+        show_help_children(bsf->priv_class, AV_OPT_FLAG_BSF_PARAM);
+    printf("\n");
+}
+
 int show_help(void *optctx, const char *opt, const char *arg)
 {
     char *topic, *par;
@@ -1923,6 +1938,8 @@  int show_help(void *optctx, const char *opt, const char *arg)
     } else if (!strcmp(topic, "filter")) {
         show_help_filter(par);
 #endif
+    } else if (!strcmp(topic, "bsf")) {
+        show_help_bsf(par);
     } else {
         show_help_default(topic, par);
     }
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 1b591d9695..d7a7eb0662 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -3114,7 +3114,7 @@  void show_help_default(const char *opt, const char *arg)
            "    -h      -- print basic options\n"
            "    -h long -- print more options\n"
            "    -h full -- print all options (including all format and codec specific options, very long)\n"
-           "    -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter\n"
+           "    -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf\n"
            "    See man %s for detailed description of the options.\n"
            "\n", program_name);
 
@@ -3159,6 +3159,7 @@  void show_help_default(const char *opt, const char *arg)
 #endif
         show_help_children(swr_get_class(), AV_OPT_FLAG_AUDIO_PARAM);
         show_help_children(avfilter_get_class(), AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM);
+        show_help_children(av_bsf_get_class(), AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_BSF_PARAM);
     }
 }