[FFmpeg-devel] [PATCH 103/218] avfilter/vf_threshold: Use formats list instead of query function

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Thu Sep 30 16:40:44 EEST 2021


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavfilter/vf_threshold.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/libavfilter/vf_threshold.c b/libavfilter/vf_threshold.c
index 65da3734b0..1b8fde4439 100644
--- a/libavfilter/vf_threshold.c
+++ b/libavfilter/vf_threshold.c
@@ -43,8 +43,6 @@ static const AVOption threshold_options[] = {
 
 AVFILTER_DEFINE_CLASS(threshold);
 
-static int query_formats(AVFilterContext *ctx)
-{
     static const enum AVPixelFormat pix_fmts[] = {
         AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
         AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
@@ -67,9 +65,6 @@ static int query_formats(AVFilterContext *ctx)
         AV_PIX_FMT_NONE
     };
 
-    return ff_set_common_formats_from_list(ctx, pix_fmts);
-}
-
 typedef struct ThreadData {
     AVFrame *in;
     AVFrame *threshold;
@@ -355,7 +350,7 @@ const AVFilter ff_vf_threshold = {
     .activate      = activate,
     FILTER_INPUTS(inputs),
     FILTER_OUTPUTS(outputs),
-    FILTER_QUERY_FUNC(query_formats),
+    FILTER_PIXFMTS_ARRAY(pix_fmts),
     .flags         = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS,
     .process_command = ff_filter_process_command,
 };
-- 
2.30.2



More information about the ffmpeg-devel mailing list