diff mbox series

[FFmpeg-devel,23/24] lavfi/vf_remap: switch to query_func2()

Message ID 20241012170239.9170-23-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/24] lavfi/vf_frei0r: switch to query_func2() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Anton Khirnov Oct. 12, 2024, 5:02 p.m. UTC
---
 libavfilter/vf_remap.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
diff mbox series

Patch

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,
 };