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>
This commit is contained in:
Michael Niedermayer 2013-10-22 19:01:36 +02:00
commit cf47a6a1a0
3 changed files with 19 additions and 15 deletions

View File

@ -47,6 +47,7 @@
#include "libavutil/eval.h" #include "libavutil/eval.h"
#include "libavutil/dict.h" #include "libavutil/dict.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "libavutil/cpu.h"
#include "cmdutils.h" #include "cmdutils.h"
#include "version.h" #include "version.h"
#if CONFIG_NETWORK #if CONFIG_NETWORK
@ -808,6 +809,18 @@ do { \
return 0; 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) int opt_loglevel(void *optctx, const char *opt, const char *arg)
{ {
const struct { const char *name; int level; } log_levels[] = { 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; 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) int opt_timelimit(void *optctx, const char *opt, const char *arg)
{ {
#if HAVE_SETRLIMIT #if HAVE_SETRLIMIT

View File

@ -81,6 +81,11 @@ void uninit_opts(void);
*/ */
void log_callback_help(void* ptr, int level, const char* fmt, va_list vl); 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 * Fallback for options that are not explicitly handled, these will be
* parsed through AVOptions. * 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_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_codec_debug(void *optctx, const char *opt, const char *arg);
int opt_opencl(void *optctx, const char *opt, const char *arg); int opt_opencl(void *optctx, const char *opt, const char *arg);