[FFmpeg-cvslog] cmdutils: add an option for listing stream dispositions

Anton Khirnov git at videolan.org
Tue Nov 16 12:06:11 EET 2021


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Nov 12 17:05:56 2021 +0100| [d4ae2a20e8783a3658d47bae952ae681c6465a39] | committer: Anton Khirnov

cmdutils: add an option for listing stream dispositions

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d4ae2a20e8783a3658d47bae952ae681c6465a39
---

 doc/fftools-common-opts.texi |  3 +++
 fftools/cmdutils.c           | 10 ++++++++++
 fftools/cmdutils.h           |  6 ++++++
 3 files changed, 19 insertions(+)

diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi
index 7643dd8396..d9145704d6 100644
--- a/doc/fftools-common-opts.texi
+++ b/doc/fftools-common-opts.texi
@@ -167,6 +167,9 @@ Show available sample formats.
 @item -layouts
 Show channel names and standard channel layouts.
 
+ at item -dispositions
+Show stream dispositions.
+
 @item -colors
 Show recognized color names.
 
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 426ba6c99f..594eeef379 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1820,6 +1820,16 @@ int show_sample_fmts(void *optctx, const char *opt, const char *arg)
     return 0;
 }
 
+int show_dispositions(void *optctx, const char *opt, const char *arg)
+{
+    for (int i = 0; i < 32; i++) {
+        const char *str = av_disposition_to_string(1 << i);
+        if (str)
+            printf("%s\n", str);
+    }
+    return 0;
+}
+
 static void show_help_codec(const char *name, int encoder)
 {
     const AVCodecDescriptor *desc;
diff --git a/fftools/cmdutils.h b/fftools/cmdutils.h
index 30f0b79725..64dd7266bc 100644
--- a/fftools/cmdutils.h
+++ b/fftools/cmdutils.h
@@ -238,6 +238,7 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
     { "pix_fmts",    OPT_EXIT,             { .func_arg = show_pix_fmts },    "show available pixel formats" },          \
     { "layouts",     OPT_EXIT,             { .func_arg = show_layouts },     "show standard channel layouts" },         \
     { "sample_fmts", OPT_EXIT,             { .func_arg = show_sample_fmts }, "show available audio sample formats" },   \
+    { "dispositions", OPT_EXIT,            { .func_arg = show_dispositions}, "show available stream dispositions" },    \
     { "colors",      OPT_EXIT,             { .func_arg = show_colors },      "show available color names" },            \
     { "loglevel",    HAS_ARG,              { .func_arg = opt_loglevel },     "set logging level", "loglevel" },         \
     { "v",           HAS_ARG,              { .func_arg = opt_loglevel },     "set logging level", "loglevel" },         \
@@ -577,6 +578,11 @@ int show_layouts(void *optctx, const char *opt, const char *arg);
  */
 int show_sample_fmts(void *optctx, const char *opt, const char *arg);
 
+/**
+ * Print a listing containing all supported stream dispositions.
+ */
+int show_dispositions(void *optctx, const char *opt, const char *arg);
+
 /**
  * Print a listing containing all the color names and values recognized
  * by the program.



More information about the ffmpeg-cvslog mailing list