lavfi/vf_edgedetect: switch to query_func2()

This commit is contained in:
Anton Khirnov 2024-10-04 10:09:29 +02:00
parent 87a619c549
commit f59c1b8a0c
1 changed files with 5 additions and 3 deletions

View File

@ -97,7 +97,9 @@ static av_cold int init(AVFilterContext *ctx)
return 0; return 0;
} }
static int query_formats(AVFilterContext *ctx) static int query_formats(const AVFilterContext *ctx,
AVFilterFormatsConfig **cfg_in,
AVFilterFormatsConfig **cfg_out)
{ {
const EdgeDetectContext *edgedetect = ctx->priv; const EdgeDetectContext *edgedetect = ctx->priv;
static const enum AVPixelFormat wires_pix_fmts[] = {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}; static const enum AVPixelFormat wires_pix_fmts[] = {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE};
@ -114,7 +116,7 @@ static int query_formats(AVFilterContext *ctx)
} else { } else {
av_assert0(0); av_assert0(0);
} }
return ff_set_common_formats_from_list(ctx, pix_fmts); return ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, pix_fmts);
} }
static int config_props(AVFilterLink *inlink) static int config_props(AVFilterLink *inlink)
@ -258,7 +260,7 @@ const AVFilter ff_vf_edgedetect = {
.uninit = uninit, .uninit = uninit,
FILTER_INPUTS(edgedetect_inputs), FILTER_INPUTS(edgedetect_inputs),
FILTER_OUTPUTS(ff_video_default_filterpad), FILTER_OUTPUTS(ff_video_default_filterpad),
FILTER_QUERY_FUNC(query_formats), FILTER_QUERY_FUNC2(query_formats),
.priv_class = &edgedetect_class, .priv_class = &edgedetect_class,
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
}; };