[FFmpeg-cvslog] lavfi/vf_quirc: use FILTER_PIXFMTS_ARRAY() instead of query_formats()

Anton Khirnov git at videolan.org
Tue Oct 15 11:45:02 EEST 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Oct 12 18:41:20 2024 +0200| [c19f3fe61bd42f227316d2c227e6e0c1f064258f] | committer: Anton Khirnov

lavfi/vf_quirc: use FILTER_PIXFMTS_ARRAY() instead of query_formats()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c19f3fe61bd42f227316d2c227e6e0c1f064258f
---

 libavfilter/vf_quirc.c | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/libavfilter/vf_quirc.c b/libavfilter/vf_quirc.c
index afd172fa34..d44233af5c 100644
--- a/libavfilter/vf_quirc.c
+++ b/libavfilter/vf_quirc.c
@@ -71,23 +71,6 @@ static int config_input(AVFilterLink *inlink)
     return 0;
 }
 
-static int query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_GRAY8,
-        AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
-        AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
-        AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
-        AV_PIX_FMT_NV12, AV_PIX_FMT_NV21,
-        AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P,
-        AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
-        AV_PIX_FMT_YUVJ440P,
-        AV_PIX_FMT_NONE
-    };
-
-    return ff_set_common_formats_from_list(ctx, pix_fmts);
-}
-
 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 {
     FilterLink *inl = ff_filter_link(inlink);
@@ -154,6 +137,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     return ff_filter_frame(outlink, frame);
 }
 
+static const enum AVPixelFormat pix_fmts[] = {
+    AV_PIX_FMT_GRAY8,
+    AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
+    AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
+    AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
+    AV_PIX_FMT_NV12, AV_PIX_FMT_NV21,
+    AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P,
+    AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
+    AV_PIX_FMT_YUVJ440P,
+    AV_PIX_FMT_NONE
+};
+
 static const AVClass quirc_class = {
     .class_name = "quirc",
     .version    = LIBAVUTIL_VERSION_INT,
@@ -178,7 +173,7 @@ const AVFilter ff_vf_quirc = {
     .uninit      = uninit,
     FILTER_INPUTS(inputs),
     FILTER_OUTPUTS(ff_video_default_filterpad),
-    FILTER_QUERY_FUNC(query_formats),
+    FILTER_PIXFMTS_ARRAY(pix_fmts),
     .flags       = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC |
                    AVFILTER_FLAG_METADATA_ONLY,
 };



More information about the ffmpeg-cvslog mailing list