aboutsummaryrefslogtreecommitdiffstats
path: root/cmdutils.c
diff options
context:
space:
mode:
authorStephen Hutchinson <qyot27@gmail.com>2013-08-11 12:17:57 -0400
committerMichael Niedermayer <michaelni@gmx.at>2013-11-19 22:09:48 +0100
commit69cf626f9c1ba29e66ff62e2b835dcfc3031db8d (patch)
tree0e0497a8d16597be564c76628179e1bf0993a966 /cmdutils.c
parentd5d29ae3b0375320a7a34f85a5a90e8362550dbb (diff)
downloadffmpeg-69cf626f9c1ba29e66ff62e2b835dcfc3031db8d.tar.gz
cmdutils: Add -buildconf option.
The output is formatted to display one option per line. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c
index b10a552243..e9545fe080 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1079,6 +1079,32 @@ 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? " " : "";
+ char str[] = { FFMPEG_CONFIGURATION };
+ char *conflist, *remove_tilde, *splitconf;
+
+ // Change all the ' --' strings to '~--' so that
+ // they can be identified as tokens.
+ while( (conflist = strstr(str, " --")) != NULL ) {
+ strncpy(conflist, "~--", 3);
+ }
+
+ // Compensate for the weirdness this would cause
+ // when passing 'pkg-config --static'.
+ while( (remove_tilde = strstr(str, "pkg-config~")) != NULL ) {
+ strncpy(remove_tilde, "pkg-config ",11);
+ }
+
+ splitconf = strtok(str, "~");
+ av_log(NULL, level, "\n%sconfiguration:\n",indent);
+ while(splitconf != NULL) {
+ av_log(NULL, level, "%s%s%s\n", indent, indent, splitconf);
+ splitconf = strtok(NULL, "~");
+ }
+}
+
void show_banner(int argc, char **argv, const OptionDef *options)
{
int idx = locate_option(argc, argv, options, "version");
@@ -1099,6 +1125,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