diff mbox series

[FFmpeg-devel,08/16] lavfi/f_graphmonitor: switch to query_func2()

Message ID 20241001105421.28967-8-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/16] lavfi/buffersink: move the option sanity check to init | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Oct. 1, 2024, 10:54 a.m. UTC
---
 libavfilter/f_graphmonitor.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/f_graphmonitor.c b/libavfilter/f_graphmonitor.c
index 0ed1085610..453d1e82de 100644
--- a/libavfilter/f_graphmonitor.c
+++ b/libavfilter/f_graphmonitor.c
@@ -146,9 +146,10 @@  static av_cold int init(AVFilterContext *ctx)
     return 0;
 }
 
-static int query_formats(AVFilterContext *ctx)
+static int query_formats(const AVFilterContext *ctx,
+                         AVFilterFormatsConfig **cfg_in,
+                         AVFilterFormatsConfig **cfg_out)
 {
-    AVFilterLink *outlink = ctx->outputs[0];
     static const enum AVPixelFormat pix_fmts[] = {
         AV_PIX_FMT_RGBA,
         AV_PIX_FMT_NONE
@@ -156,7 +157,7 @@  static int query_formats(AVFilterContext *ctx)
     int ret;
 
     AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
-    if ((ret = ff_formats_ref(fmts_list, &outlink->incfg.formats)) < 0)
+    if ((ret = ff_formats_ref(fmts_list, &cfg_out[0]->formats)) < 0)
         return ret;
 
     return 0;
@@ -587,7 +588,7 @@  const AVFilter ff_vf_graphmonitor = {
     .activate      = activate,
     FILTER_INPUTS(ff_video_default_filterpad),
     FILTER_OUTPUTS(graphmonitor_outputs),
-    FILTER_QUERY_FUNC(query_formats),
+    FILTER_QUERY_FUNC2(query_formats),
     .process_command = ff_filter_process_command,
 };
 
@@ -605,7 +606,7 @@  const AVFilter ff_avf_agraphmonitor = {
     .activate      = activate,
     FILTER_INPUTS(ff_audio_default_filterpad),
     FILTER_OUTPUTS(graphmonitor_outputs),
-    FILTER_QUERY_FUNC(query_formats),
+    FILTER_QUERY_FUNC2(query_formats),
     .process_command = ff_filter_process_command,
 };
 #endif // CONFIG_AGRAPHMONITOR_FILTER