lavfi/vf_remap: switch to query_func2()

This commit is contained in:
Anton Khirnov 2024-10-12 18:41:20 +02:00
parent dcd5a51e0a
commit 4d69398dda

View File

@ -82,9 +82,11 @@ typedef struct ThreadData {
int step;
} ThreadData;
static int query_formats(AVFilterContext *ctx)
static int query_formats(const AVFilterContext *ctx,
AVFilterFormatsConfig **cfg_in,
AVFilterFormatsConfig **cfg_out)
{
RemapContext *s = ctx->priv;
const RemapContext *s = ctx->priv;
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_YUV444P,
@ -116,14 +118,14 @@ static int query_formats(AVFilterContext *ctx)
int ret;
pix_formats = ff_make_format_list(s->format ? gray_pix_fmts : pix_fmts);
if ((ret = ff_formats_ref(pix_formats, &ctx->inputs[0]->outcfg.formats)) < 0 ||
(ret = ff_formats_ref(pix_formats, &ctx->outputs[0]->incfg.formats)) < 0)
if ((ret = ff_formats_ref(pix_formats, &cfg_in[0]->formats)) < 0 ||
(ret = ff_formats_ref(pix_formats, &cfg_out[0]->formats)) < 0)
return ret;
map_formats = ff_make_format_list(map_fmts);
if ((ret = ff_formats_ref(map_formats, &ctx->inputs[1]->outcfg.formats)) < 0)
if ((ret = ff_formats_ref(map_formats, &cfg_in[1]->formats)) < 0)
return ret;
return ff_formats_ref(map_formats, &ctx->inputs[2]->outcfg.formats);
return ff_formats_ref(map_formats, &cfg_in[2]->formats);
}
/**
@ -403,7 +405,7 @@ const AVFilter ff_vf_remap = {
.activate = activate,
FILTER_INPUTS(remap_inputs),
FILTER_OUTPUTS(remap_outputs),
FILTER_QUERY_FUNC(query_formats),
FILTER_QUERY_FUNC2(query_formats),
.priv_class = &remap_class,
.flags = AVFILTER_FLAG_SLICE_THREADS,
};