diff mbox series

[FFmpeg-devel,22/24] lavfi/vf_mergeplanes: switch to query_func2()

Message ID 20241012170239.9170-22-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_mergeplanes.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_mergeplanes.c b/libavfilter/vf_mergeplanes.c
index 9f7930d44b..d97438a2c4 100644
--- a/libavfilter/vf_mergeplanes.c
+++ b/libavfilter/vf_mergeplanes.c
@@ -121,9 +121,11 @@  static av_cold int init(AVFilterContext *ctx)
     return 0;
 }
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+                         AVFilterFormatsConfig **cfg_in,
+                         AVFilterFormatsConfig **cfg_out)
 {
-    MergePlanesContext *s = ctx->priv;
+    const MergePlanesContext *s = ctx->priv;
     AVFilterFormats *formats = NULL;
     int i, ret;
 
@@ -137,12 +139,12 @@  static int query_formats(AVFilterContext *ctx)
     }
 
     for (i = 0; i < s->nb_inputs; i++)
-        if ((ret = ff_formats_ref(formats, &ctx->inputs[i]->outcfg.formats)) < 0)
+        if ((ret = ff_formats_ref(formats, &cfg_in[i]->formats)) < 0)
             return ret;
 
     formats = NULL;
     if ((ret = ff_add_format(&formats, s->out_fmt)) < 0 ||
-        (ret = ff_formats_ref(formats, &ctx->outputs[0]->incfg.formats)) < 0)
+        (ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0)
         return ret;
 
     return 0;
@@ -318,6 +320,6 @@  const AVFilter ff_vf_mergeplanes = {
     .activate      = activate,
     .inputs        = NULL,
     FILTER_OUTPUTS(mergeplanes_outputs),
-    FILTER_QUERY_FUNC(query_formats),
+    FILTER_QUERY_FUNC2(query_formats),
     .flags         = AVFILTER_FLAG_DYNAMIC_INPUTS,
 };