aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-22 19:01:36 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-10-22 19:07:28 +0200
commitcf47a6a1a0848567d1453f2830d567f22e551dca (patch)
treeb67e45211796ec4045fbbba753cb533a45ebc22a
parentc2f3715cb3fce093137591e3005de3e831b1f9fd (diff)
parentf825d42bccdb9f89669a586951de7f66a81e80a5 (diff)
downloadffmpeg-cf47a6a1a0848567d1453f2830d567f22e551dca.tar.gz
Merge commit 'f825d42bccdb9f89669a586951de7f66a81e80a5'
* commit 'f825d42bccdb9f89669a586951de7f66a81e80a5': avplay: Accept cpuflags option Conflicts: cmdutils_common_opts.h doc/ffmpeg.texi doc/fftools-common-opts.texi ffmpeg_opt.c See: 1060e9ce5454e7ac009969ab2cf8f7cd83a69ac3 Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--cmdutils.c25
-rw-r--r--cmdutils.h7
-rw-r--r--cmdutils_common_opts.h2
3 files changed, 19 insertions, 15 deletions
diff --git a/cmdutils.c b/cmdutils.c
index aea02c0e5f..90ad48f620 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -47,6 +47,7 @@
#include "libavutil/eval.h"
#include "libavutil/dict.h"
#include "libavutil/opt.h"
+#include "libavutil/cpu.h"
#include "cmdutils.h"
#include "version.h"
#if CONFIG_NETWORK
@@ -808,6 +809,18 @@ do { \
return 0;
}
+int opt_cpuflags(void *optctx, const char *opt, const char *arg)
+{
+ int ret;
+ unsigned flags = av_get_cpu_flags();
+
+ if ((ret = av_parse_cpu_caps(&flags, arg)) < 0)
+ return ret;
+
+ av_force_cpu_flags(flags);
+ return 0;
+}
+
int opt_loglevel(void *optctx, const char *opt, const char *arg)
{
const struct { const char *name; int level; } log_levels[] = {
@@ -960,18 +973,6 @@ int opt_max_alloc(void *optctx, const char *opt, const char *arg)
return 0;
}
-int opt_cpuflags(void *optctx, const char *opt, const char *arg)
-{
- int ret;
- unsigned flags = av_get_cpu_flags();
-
- if ((ret = av_parse_cpu_caps(&flags, arg)) < 0)
- return ret;
-
- av_force_cpu_flags(flags);
- return 0;
-}
-
int opt_timelimit(void *optctx, const char *opt, const char *arg)
{
#if HAVE_SETRLIMIT
diff --git a/cmdutils.h b/cmdutils.h
index 2e9b604a97..49bb765724 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -82,6 +82,11 @@ void uninit_opts(void);
void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
/**
+ * Override the cpuflags.
+ */
+int opt_cpuflags(void *optctx, const char *opt, const char *arg);
+
+/**
* Fallback for options that are not explicitly handled, these will be
* parsed through AVOptions.
*/
@@ -96,8 +101,6 @@ int opt_report(const char *opt);
int opt_max_alloc(void *optctx, const char *opt, const char *arg);
-int opt_cpuflags(void *optctx, const char *opt, const char *arg);
-
int opt_codec_debug(void *optctx, const char *opt, const char *arg);
int opt_opencl(void *optctx, const char *opt, const char *arg);
diff --git a/cmdutils_common_opts.h b/cmdutils_common_opts.h
index b57abaf618..9c265fc5f7 100644
--- a/cmdutils_common_opts.h
+++ b/cmdutils_common_opts.h
@@ -18,7 +18,7 @@
{ "v", HAS_ARG, {.func_arg = opt_loglevel}, "set logging level", "loglevel" },
{ "report" , 0, {(void*)opt_report}, "generate a report" },
{ "max_alloc" , HAS_ARG, {.func_arg = opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },
- { "cpuflags" , HAS_ARG | OPT_EXPERT, {.func_arg = opt_cpuflags}, "force specific cpu flags", "flags" },
+ { "cpuflags" , HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags }, "force specific cpu flags", "flags" },
#if CONFIG_OPENCL
{ "opencl_options", HAS_ARG, {.func_arg = opt_opencl}, "set OpenCL environment options" },
#endif