lavfi/vf_showpalette: convert to query_func2()

This commit is contained in:
Anton Khirnov 2024-10-15 11:24:35 +02:00
parent a96244df77
commit 965e9b646e
1 changed files with 6 additions and 4 deletions

View File

@ -41,17 +41,19 @@ static const AVOption showpalette_options[] = {
AVFILTER_DEFINE_CLASS(showpalette); AVFILTER_DEFINE_CLASS(showpalette);
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_PAL8, AV_PIX_FMT_NONE}; static const enum AVPixelFormat in_fmts[] = {AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE};
static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE}; static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE};
int ret = ff_formats_ref(ff_make_format_list(in_fmts), int ret = ff_formats_ref(ff_make_format_list(in_fmts),
&ctx->inputs[0]->outcfg.formats); &cfg_in[0]->formats);
if (ret < 0) if (ret < 0)
return ret; return ret;
return ff_formats_ref(ff_make_format_list(out_fmts), return ff_formats_ref(ff_make_format_list(out_fmts),
&ctx->outputs[0]->incfg.formats); &cfg_out[0]->formats);
} }
static int config_output(AVFilterLink *outlink) static int config_output(AVFilterLink *outlink)
@ -116,6 +118,6 @@ const AVFilter ff_vf_showpalette = {
.priv_size = sizeof(ShowPaletteContext), .priv_size = sizeof(ShowPaletteContext),
FILTER_INPUTS(showpalette_inputs), FILTER_INPUTS(showpalette_inputs),
FILTER_OUTPUTS(showpalette_outputs), FILTER_OUTPUTS(showpalette_outputs),
FILTER_QUERY_FUNC(query_formats), FILTER_QUERY_FUNC2(query_formats),
.priv_class = &showpalette_class, .priv_class = &showpalette_class,
}; };