From bdaaddb65c7e779ac377cd1ac5c7be90145c6a8b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 15 Oct 2024 11:24:35 +0200 Subject: [PATCH] lavfi/vf_stack: convert to query_func2() --- libavfilter/vf_stack.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/libavfilter/vf_stack.c b/libavfilter/vf_stack.c index 8328048649..19c6c2971f 100644 --- a/libavfilter/vf_stack.c +++ b/libavfilter/vf_stack.c @@ -63,18 +63,22 @@ typedef struct StackContext { FFFrameSync fs; } StackContext; -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - StackContext *s = ctx->priv; + const StackContext *s = ctx->priv; int reject_flags = AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_HWACCEL | AV_PIX_FMT_FLAG_PAL; if (s->fillcolor_enable) { - 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)); } - return ff_set_common_formats(ctx, ff_formats_pixdesc_filter(0, reject_flags)); + return ff_set_common_formats2(ctx, cfg_in, cfg_out, + ff_formats_pixdesc_filter(0, reject_flags)); } static av_cold int init(AVFilterContext *ctx) @@ -462,7 +466,7 @@ const AVFilter ff_vf_hstack = { .priv_class = &stack_class, .priv_size = sizeof(StackContext), FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .init = init, .uninit = uninit, .activate = activate, @@ -479,7 +483,7 @@ const AVFilter ff_vf_vstack = { .priv_class = &stack_class, .priv_size = sizeof(StackContext), FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .init = init, .uninit = uninit, .activate = activate, @@ -507,7 +511,7 @@ const AVFilter ff_vf_xstack = { .priv_size = sizeof(StackContext), .priv_class = &xstack_class, FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .init = init, .uninit = uninit, .activate = activate,