mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-08 10:11:04 +08:00
fftools/cmdutils.c: Add cmd line option to override detection of cpu count.
This commit is contained in:
@@ -71,6 +71,7 @@ AVDictionary *format_opts, *codec_opts, *resample_opts;
|
||||
static FILE *report_file;
|
||||
static int report_file_level = AV_LOG_DEBUG;
|
||||
int hide_banner = 0;
|
||||
int cpu_count = -1;
|
||||
|
||||
enum show_muxdemuxers {
|
||||
SHOW_DEFAULT,
|
||||
@@ -853,6 +854,32 @@ int opt_cpuflags(void *optctx, const char *opt, const char *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int opt_cpucount(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
int ret;
|
||||
int count;
|
||||
|
||||
static const AVOption opts[] = {
|
||||
{"count", NULL, 0, AV_OPT_TYPE_INT, { .i64 = -1}, -1, INT_MAX, NULL},
|
||||
{NULL},
|
||||
};
|
||||
static const AVClass class = {
|
||||
.class_name = "cpucount",
|
||||
.item_name = av_default_item_name,
|
||||
.option = opts,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
};
|
||||
const AVClass *pclass = &class;
|
||||
|
||||
ret = av_opt_eval_int(&pclass, opts, arg, &count);
|
||||
|
||||
if (!ret) {
|
||||
av_force_cpu_count(count);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int opt_loglevel(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
const struct { const char *name; int level; } log_levels[] = {
|
||||
|
Reference in New Issue
Block a user