[FFmpeg-devel] [PATCH 02/21] lavfi/vf_showpalette: convert to query_func2()

Anton Khirnov anton at khirnov.net
Tue Oct 15 12:47:25 EEST 2024


---
 libavfilter/vf_showpalette.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_showpalette.c b/libavfilter/vf_showpalette.c
index e887d07092..db1a224f04 100644
--- a/libavfilter/vf_showpalette.c
+++ b/libavfilter/vf_showpalette.c
@@ -41,17 +41,19 @@ static const AVOption showpalette_options[] = {
 
 AVFILTER_DEFINE_CLASS(showpalette);
 
-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_PAL8,  AV_PIX_FMT_NONE};
     static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE};
     int ret = ff_formats_ref(ff_make_format_list(in_fmts),
-                             &ctx->inputs[0]->outcfg.formats);
+                             &cfg_in[0]->formats);
     if (ret < 0)
         return ret;
 
     return ff_formats_ref(ff_make_format_list(out_fmts),
-                          &ctx->outputs[0]->incfg.formats);
+                          &cfg_out[0]->formats);
 }
 
 static int config_output(AVFilterLink *outlink)
@@ -116,6 +118,6 @@ const AVFilter ff_vf_showpalette = {
     .priv_size     = sizeof(ShowPaletteContext),
     FILTER_INPUTS(showpalette_inputs),
     FILTER_OUTPUTS(showpalette_outputs),
-    FILTER_QUERY_FUNC(query_formats),
+    FILTER_QUERY_FUNC2(query_formats),
     .priv_class    = &showpalette_class,
 };
-- 
2.43.0



More information about the ffmpeg-devel mailing list