avfilter/vf_colorlevels: Use formats list instead of query function

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-09-27 15:15:16 +02:00
parent 5ee2bd6e8b
commit f182e0c64f

View File

@ -84,22 +84,6 @@ static const AVOption colorlevels_options[] = {
AVFILTER_DEFINE_CLASS(colorlevels);
static int query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_0RGB, AV_PIX_FMT_0BGR,
AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR,
AV_PIX_FMT_RGB0, AV_PIX_FMT_BGR0,
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
AV_PIX_FMT_RGB48, AV_PIX_FMT_BGR48,
AV_PIX_FMT_RGBA64, AV_PIX_FMT_BGRA64,
AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA,
AV_PIX_FMT_NONE
};
return ff_set_common_formats_from_list(ctx, pix_fmts);
}
typedef struct ThreadData {
const uint8_t *srcrow;
uint8_t *dstrow;
@ -388,7 +372,13 @@ const AVFilter ff_vf_colorlevels = {
.priv_class = &colorlevels_class,
FILTER_INPUTS(colorlevels_inputs),
FILTER_OUTPUTS(colorlevels_outputs),
FILTER_QUERY_FUNC(query_formats),
FILTER_PIXFMTS(AV_PIX_FMT_0RGB, AV_PIX_FMT_0BGR,
AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR,
AV_PIX_FMT_RGB0, AV_PIX_FMT_BGR0,
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
AV_PIX_FMT_RGB48, AV_PIX_FMT_BGR48,
AV_PIX_FMT_RGBA64, AV_PIX_FMT_BGRA64,
AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
.process_command = ff_filter_process_command,
};