From 4d69398ddac3ec6040fd7a6500c8907336758c2a Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 12 Oct 2024 18:41:20 +0200 Subject: [PATCH] lavfi/vf_remap: switch to query_func2() --- libavfilter/vf_remap.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libavfilter/vf_remap.c b/libavfilter/vf_remap.c index df81c247eb..cc83aa7ffe 100644 --- a/libavfilter/vf_remap.c +++ b/libavfilter/vf_remap.c @@ -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, };