diff mbox series

[FFmpeg-devel,062/218] avfilter/vf_colorlevels: Use formats list instead of query function

Message ID PR3PR03MB6665E0636A1988F1CE1B77B88FAA9@PR3PR03MB6665.eurprd03.prod.outlook.com
State Accepted
Commit f182e0c64f249b1b1096a726758ad8f4984d2243
Headers show
Series [FFmpeg-devel,001/218] avfilter/f_reverse: Don't use redundant query_formats function | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 30, 2021, 1:40 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_colorlevels.c | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
index 552b701a2d..c089740b0a 100644
--- a/libavfilter/vf_colorlevels.c
+++ b/libavfilter/vf_colorlevels.c
@@ -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,
 };