lavfi/qrencode: switch to query_func2()

This commit is contained in:
Anton Khirnov 2024-10-01 12:02:29 +02:00
parent f10986a5ec
commit 534eef2ace
1 changed files with 10 additions and 6 deletions

View File

@ -671,7 +671,9 @@ static int request_frame(AVFilterLink *outlink)
return ff_filter_frame(outlink, frame); 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; enum AVPixelFormat pix_fmt;
FFDrawContext draw; FFDrawContext draw;
@ -686,7 +688,7 @@ static int qrencodesrc_query_formats(AVFilterContext *ctx)
(ret = ff_add_format(&fmts, pix_fmt)) < 0) (ret = ff_add_format(&fmts, pix_fmt)) < 0)
return ret; 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[] = { static const AVFilterPad qrencodesrc_outputs[] = {
@ -707,7 +709,7 @@ const AVFilter ff_vsrc_qrencodesrc = {
.uninit = uninit, .uninit = uninit,
.inputs = NULL, .inputs = NULL,
FILTER_OUTPUTS(qrencodesrc_outputs), FILTER_OUTPUTS(qrencodesrc_outputs),
FILTER_QUERY_FUNC(qrencodesrc_query_formats), FILTER_QUERY_FUNC2(qrencodesrc_query_formats),
}; };
#endif // CONFIG_QRENCODESRC_FILTER #endif // CONFIG_QRENCODESRC_FILTER
@ -772,9 +774,11 @@ static int qrencode_config_input(AVFilterLink *inlink)
return 0; 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) static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
@ -818,7 +822,7 @@ const AVFilter ff_vf_qrencode = {
.uninit = uninit, .uninit = uninit,
FILTER_INPUTS(avfilter_vf_qrencode_inputs), FILTER_INPUTS(avfilter_vf_qrencode_inputs),
FILTER_OUTPUTS(ff_video_default_filterpad), FILTER_OUTPUTS(ff_video_default_filterpad),
FILTER_QUERY_FUNC(qrencode_query_formats), FILTER_QUERY_FUNC2(qrencode_query_formats),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
}; };