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

Anton Khirnov anton at khirnov.net
Sat Oct 12 20:02:33 EEST 2024


---
 libavfilter/vf_paletteuse.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

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



More information about the ffmpeg-devel mailing list