diff mbox series

[FFmpeg-devel,18/24] lavfi/vf_paletteuse: switch to query_func2()

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

Patch

diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
index 0cd00d520e..100f462750 100644
--- a/libavfilter/vf_paletteuse.c
+++ b/libavfilter/vf_paletteuse.c
@@ -136,18 +136,20 @@  AVFILTER_DEFINE_CLASS(paletteuse);
 
 static int load_apply_palette(FFFrameSync *fs);
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+                         AVFilterFormatsConfig **cfg_in,
+                         AVFilterFormatsConfig **cfg_out)
 {
     static const enum AVPixelFormat in_fmts[]    = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE};
     static const enum AVPixelFormat inpal_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE};
     static const enum AVPixelFormat out_fmts[]   = {AV_PIX_FMT_PAL8,  AV_PIX_FMT_NONE};
     int ret;
     if ((ret = ff_formats_ref(ff_make_format_list(in_fmts),
-                              &ctx->inputs[0]->outcfg.formats)) < 0 ||
+                              &cfg_in[0]->formats)) < 0 ||
         (ret = ff_formats_ref(ff_make_format_list(inpal_fmts),
-                              &ctx->inputs[1]->outcfg.formats)) < 0 ||
+                              &cfg_in[1]->formats)) < 0 ||
         (ret = ff_formats_ref(ff_make_format_list(out_fmts),
-                              &ctx->outputs[0]->incfg.formats)) < 0)
+                              &cfg_out[0]->formats)) < 0)
         return ret;
     return 0;
 }
@@ -1004,6 +1006,6 @@  const AVFilter ff_vf_paletteuse = {
     .activate      = activate,
     FILTER_INPUTS(paletteuse_inputs),
     FILTER_OUTPUTS(paletteuse_outputs),
-    FILTER_QUERY_FUNC(query_formats),
+    FILTER_QUERY_FUNC2(query_formats),
     .priv_class    = &paletteuse_class,
 };