lavfi/vf_paletteuse: switch to query_func2()

This commit is contained in:
Anton Khirnov 2024-10-12 18:28:12 +02:00
parent 18e43c2d39
commit 4faf6c6f0d

View File

@ -136,18 +136,20 @@ AVFILTER_DEFINE_CLASS(paletteuse);
static int load_apply_palette(FFFrameSync *fs);
static int query_formats(AVFilterContext *ctx)
static int query_formats(const AVFilterContext *ctx,
AVFilterFormatsConfig **cfg_in,
AVFilterFormatsConfig **cfg_out)
{
static const enum AVPixelFormat in_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE};
static const enum AVPixelFormat inpal_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE};
static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE};
int ret;
if ((ret = ff_formats_ref(ff_make_format_list(in_fmts),
&ctx->inputs[0]->outcfg.formats)) < 0 ||
&cfg_in[0]->formats)) < 0 ||
(ret = ff_formats_ref(ff_make_format_list(inpal_fmts),
&ctx->inputs[1]->outcfg.formats)) < 0 ||
&cfg_in[1]->formats)) < 0 ||
(ret = ff_formats_ref(ff_make_format_list(out_fmts),
&ctx->outputs[0]->incfg.formats)) < 0)
&cfg_out[0]->formats)) < 0)
return ret;
return 0;
}
@ -1004,6 +1006,6 @@ const AVFilter ff_vf_paletteuse = {
.activate = activate,
FILTER_INPUTS(paletteuse_inputs),
FILTER_OUTPUTS(paletteuse_outputs),
FILTER_QUERY_FUNC(query_formats),
FILTER_QUERY_FUNC2(query_formats),
.priv_class = &paletteuse_class,
};