diff mbox series

[FFmpeg-devel,14/16] lavfi/vf_stack_{vaapi, qsv}: replace query_formats with a pixfmt list

Message ID 20241001105421.28967-14-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/16] lavfi/buffersink: move the option sanity check to init | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Oct. 1, 2024, 10:54 a.m. UTC
---
 libavfilter/stack_internal.c |  2 +-
 libavfilter/vf_stack_qsv.c   | 17 ++++++-----------
 libavfilter/vf_stack_vaapi.c | 13 ++++---------
 3 files changed, 11 insertions(+), 21 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/stack_internal.c b/libavfilter/stack_internal.c
index b473fa982d..fcec119bac 100644
--- a/libavfilter/stack_internal.c
+++ b/libavfilter/stack_internal.c
@@ -350,7 +350,7 @@  static const AVFilterPad stack_outputs[] = {
         .init           = api##_stack_init,                             \
         .uninit         = api##_stack_uninit,                           \
         .activate       = stack_activate,                               \
-        FILTER_QUERY_FUNC(api##_stack_query_formats),                   \
+        FILTER_PIXFMTS_ARRAY(api ## _stack_pix_fmts),                   \
         FILTER_OUTPUTS(stack_outputs),                                  \
         .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,                 \
         .flags          = AVFILTER_FLAG_DYNAMIC_INPUTS | filter_flags,  \
diff --git a/libavfilter/vf_stack_qsv.c b/libavfilter/vf_stack_qsv.c
index 9c4ca4abd2..82fb3c09a3 100644
--- a/libavfilter/vf_stack_qsv.c
+++ b/libavfilter/vf_stack_qsv.c
@@ -223,17 +223,12 @@  static av_cold void qsv_stack_uninit(AVFilterContext *ctx)
     av_freep(&sctx->qsv_param.ext_buf);
 }
 
-static int qsv_stack_query_formats(AVFilterContext *ctx)
-{
-    static const enum AVPixelFormat pixel_formats[] = {
-        AV_PIX_FMT_NV12,
-        AV_PIX_FMT_P010,
-        AV_PIX_FMT_QSV,
-        AV_PIX_FMT_NONE,
-    };
-
-    return ff_set_common_formats_from_list(ctx, pixel_formats);
-}
+static const enum AVPixelFormat qsv_stack_pix_fmts[] = {
+    AV_PIX_FMT_NV12,
+    AV_PIX_FMT_P010,
+    AV_PIX_FMT_QSV,
+    AV_PIX_FMT_NONE,
+};
 
 #include "stack_internal.c"
 
diff --git a/libavfilter/vf_stack_vaapi.c b/libavfilter/vf_stack_vaapi.c
index 602a7825a3..9ab4d8ab5b 100644
--- a/libavfilter/vf_stack_vaapi.c
+++ b/libavfilter/vf_stack_vaapi.c
@@ -220,15 +220,10 @@  static av_cold void vaapi_stack_uninit(AVFilterContext *avctx)
     av_freep(&sctx->rects);
 }
 
-static int vaapi_stack_query_formats(AVFilterContext *avctx)
-{
-    static const enum AVPixelFormat pixel_formats[] = {
-        AV_PIX_FMT_VAAPI,
-        AV_PIX_FMT_NONE,
-    };
-
-    return ff_set_common_formats_from_list(avctx, pixel_formats);
-}
+static const enum AVPixelFormat vaapi_stack_pix_fmts[] = {
+    AV_PIX_FMT_VAAPI,
+    AV_PIX_FMT_NONE,
+};
 
 #include "stack_internal.c"