mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 16:22:37 +00:00
cmdutils: add -cpuflags.
This allows globally forcing specific cpuflags (or lack thereof) Useful for debugging and benchmarking Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
04f7eee709
commit
1060e9ce54
13
cmdutils.c
13
cmdutils.c
@ -535,6 +535,19 @@ int opt_max_alloc(const char *opt, const char *arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int opt_cpuflags(const char *opt, const char *arg)
|
||||||
|
{
|
||||||
|
char *tail;
|
||||||
|
long flags = strtol(arg, &tail, 10);
|
||||||
|
|
||||||
|
if (*tail) {
|
||||||
|
av_log(NULL, AV_LOG_FATAL, "Invalid cpuflags \"%s\".\n", arg);
|
||||||
|
exit_program(1);
|
||||||
|
}
|
||||||
|
av_force_cpu_flags(flags);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int opt_codec_debug(const char *opt, const char *arg)
|
int opt_codec_debug(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
av_log_set_level(AV_LOG_DEBUG);
|
av_log_set_level(AV_LOG_DEBUG);
|
||||||
|
@ -85,6 +85,8 @@ int opt_report(const char *opt);
|
|||||||
|
|
||||||
int opt_max_alloc(const char *opt, const char *arg);
|
int opt_max_alloc(const char *opt, const char *arg);
|
||||||
|
|
||||||
|
int opt_cpuflags(const char *opt, const char *arg);
|
||||||
|
|
||||||
int opt_codec_debug(const char *opt, const char *arg);
|
int opt_codec_debug(const char *opt, const char *arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,3 +16,4 @@
|
|||||||
{ "debug", HAS_ARG, {(void*)opt_codec_debug}, "set debug flags", "flags" },
|
{ "debug", HAS_ARG, {(void*)opt_codec_debug}, "set debug flags", "flags" },
|
||||||
{ "report", 0, {(void*)opt_report}, "generate a report" },
|
{ "report", 0, {(void*)opt_report}, "generate a report" },
|
||||||
{ "max_alloc", HAS_ARG, {(void*)opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },
|
{ "max_alloc", HAS_ARG, {(void*)opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },
|
||||||
|
{ "cpuflags", HAS_ARG, {(void*)opt_cpuflags}, "force specific cpu flags", "flags" },
|
||||||
|
Loading…
Reference in New Issue
Block a user