[FFmpeg-cvslog] lavfi/vf_showpalette: convert to query_func2()

Anton Khirnov git at videolan.org
Thu Oct 17 12:12:26 EEST 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Oct 15 11:24:35 2024 +0200| [965e9b646ed050f6767fa2e1fc7156ea8e67f943] | committer: Anton Khirnov

lavfi/vf_showpalette: convert to query_func2()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=965e9b646ed050f6767fa2e1fc7156ea8e67f943
---

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



More information about the ffmpeg-cvslog mailing list