diff mbox series

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

Message ID 20241015094744.10713-2-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/21] lavfi/vf_setparams: convert to query_func2() | expand

Checks

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

Commit Message

Anton Khirnov Oct. 15, 2024, 9:47 a.m. UTC
---
 libavfilter/vf_showpalette.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

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