[FFmpeg-devel] [PATCH 1/2] cmdutils: Add -buildconf option.

Stephen Hutchinson qyot27 at gmail.com
Sat Aug 10 10:04:15 CEST 2013


Currently, its output is exactly the same as the 'configuration:'
line when invoking one of the binaries.
---
 cmdutils.c             | 15 +++++++++++++++
 cmdutils.h             |  7 +++++++
 cmdutils_common_opts.h |  1 +
 3 files changed, 23 insertions(+)

diff --git a/cmdutils.c b/cmdutils.c
index 6eb093d..fed8213 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1066,6 +1066,13 @@ static void print_program_info(int flags, int level)
     av_log(NULL, level, "%sconfiguration: " FFMPEG_CONFIGURATION "\n", indent);
 }
 
+static void print_buildconf(int flags, int level)
+{
+    const char *indent = flags & INDENT? "  " : "";
+
+    av_log(NULL, level, "\n%sconfiguration:\n" "%s%s"FFMPEG_CONFIGURATION "\n", indent, indent, indent);
+}
+
 void show_banner(int argc, char **argv, const OptionDef *options)
 {
     int idx = locate_option(argc, argv, options, "version");
@@ -1086,6 +1093,14 @@ int show_version(void *optctx, const char *opt, const char *arg)
     return 0;
 }
 
+int show_buildconf(void *optctx, const char *opt, const char *arg)
+{
+    av_log_set_callback(log_callback_help);
+    print_buildconf      (INDENT|0, AV_LOG_INFO);
+
+    return 0;
+}
+
 int show_license(void *optctx, const char *opt, const char *arg)
 {
 #if CONFIG_NONFREE
diff --git a/cmdutils.h b/cmdutils.h
index 3af4476..4d5d2f4 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -412,6 +412,13 @@ void show_banner(int argc, char **argv, const OptionDef *options);
 int show_version(void *optctx, const char *opt, const char *arg);
 
 /**
+ * Print the build configuration of the program to stdout. The contents
+ * depend on the definition of FFMPEG_CONFIGURATION.
+ * This option processing function does not utilize the arguments.
+ */
+int show_buildconf(void *optctx, const char *opt, const char *arg);
+
+/**
  * Print the license of the program to stdout. The license depends on
  * the license of the libraries compiled into the program.
  * This option processing function does not utilize the arguments.
diff --git a/cmdutils_common_opts.h b/cmdutils_common_opts.h
index b57abaf..48b0af2 100644
--- a/cmdutils_common_opts.h
+++ b/cmdutils_common_opts.h
@@ -4,6 +4,7 @@
     { "help"       , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
     { "-help"      , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
     { "version"    , OPT_EXIT, {.func_arg = show_version},      "show version" },
+    { "buildconf"  , OPT_EXIT, {.func_arg = show_buildconf},    "show build configuration" },
     { "formats"    , OPT_EXIT, {.func_arg = show_formats  },    "show available formats" },
     { "codecs"     , OPT_EXIT, {.func_arg = show_codecs   },    "show available codecs" },
     { "decoders"   , OPT_EXIT, {.func_arg = show_decoders },    "show available decoders" },
-- 
1.8.1.2



More information about the ffmpeg-devel mailing list