diff mbox series

[FFmpeg-devel,11/16] lavfi/qrencode: switch to query_func2()

Message ID 20241001105421.28967-11-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/qrencode.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/qrencode.c b/libavfilter/qrencode.c
index dae169b57f..d3f55013d3 100644
--- a/libavfilter/qrencode.c
+++ b/libavfilter/qrencode.c
@@ -671,7 +671,9 @@  static int request_frame(AVFilterLink *outlink)
     return ff_filter_frame(outlink, frame);
 }
 
-static int qrencodesrc_query_formats(AVFilterContext *ctx)
+static int qrencodesrc_query_formats(const AVFilterContext *ctx,
+                                     AVFilterFormatsConfig **cfg_in,
+                                     AVFilterFormatsConfig **cfg_out)
 {
     enum AVPixelFormat pix_fmt;
     FFDrawContext draw;
@@ -686,7 +688,7 @@  static int qrencodesrc_query_formats(AVFilterContext *ctx)
             (ret = ff_add_format(&fmts, pix_fmt)) < 0)
             return ret;
 
-    return ff_set_common_formats(ctx, fmts);
+    return ff_set_common_formats2(ctx, cfg_in, cfg_out, fmts);
 }
 
 static const AVFilterPad qrencodesrc_outputs[] = {
@@ -707,7 +709,7 @@  const AVFilter ff_vsrc_qrencodesrc = {
     .uninit        = uninit,
     .inputs        = NULL,
     FILTER_OUTPUTS(qrencodesrc_outputs),
-    FILTER_QUERY_FUNC(qrencodesrc_query_formats),
+    FILTER_QUERY_FUNC2(qrencodesrc_query_formats),
 };
 
 #endif // CONFIG_QRENCODESRC_FILTER
@@ -772,9 +774,11 @@  static int qrencode_config_input(AVFilterLink *inlink)
     return 0;
 }
 
-static int qrencode_query_formats(AVFilterContext *ctx)
+static int qrencode_query_formats(const AVFilterContext *ctx,
+                                  AVFilterFormatsConfig **cfg_in,
+                                  AVFilterFormatsConfig **cfg_out)
 {
-    return ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0));
+    return ff_set_common_formats2(ctx, cfg_in, cfg_out, ff_draw_supported_pixel_formats(0));
 }
 
 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
@@ -818,7 +822,7 @@  const AVFilter ff_vf_qrencode = {
     .uninit        = uninit,
     FILTER_INPUTS(avfilter_vf_qrencode_inputs),
     FILTER_OUTPUTS(ff_video_default_filterpad),
-    FILTER_QUERY_FUNC(qrencode_query_formats),
+    FILTER_QUERY_FUNC2(qrencode_query_formats),
     .flags         = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
 };