[FFmpeg-devel] [PATCH 16/21] lavfi/vf_vpp_qsv: convert to query_func2()

Anton Khirnov anton at khirnov.net
Tue Oct 15 12:47:39 EEST 2024


---
 libavfilter/vf_vpp_qsv.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index 7f05f1fab0..37d41aa44b 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -932,9 +932,11 @@ static const AVOption vpp_options[] = {
     { NULL }
 };
 
-static int vpp_query_formats(AVFilterContext *ctx)
+static int vpp_query_formats(const AVFilterContext *ctx,
+                             AVFilterFormatsConfig **cfg_in,
+                             AVFilterFormatsConfig **cfg_out)
 {
-    VPPContext *vpp = ctx->priv;
+    const VPPContext *vpp = ctx->priv;
     int ret, i = 0;
     static const enum AVPixelFormat in_pix_fmts[] = {
         AV_PIX_FMT_YUV420P,
@@ -951,7 +953,7 @@ static int vpp_query_formats(AVFilterContext *ctx)
     static enum AVPixelFormat out_pix_fmts[4];
 
     ret = ff_formats_ref(ff_make_format_list(in_pix_fmts),
-                         &ctx->inputs[0]->outcfg.formats);
+                         &cfg_in[0]->formats);
     if (ret < 0)
         return ret;
 
@@ -968,10 +970,10 @@ static int vpp_query_formats(AVFilterContext *ctx)
     out_pix_fmts[i++] = AV_PIX_FMT_NONE;
 
     return ff_formats_ref(ff_make_format_list(out_pix_fmts),
-                          &ctx->outputs[0]->incfg.formats);
+                          &cfg_out[0]->formats);
 }
 
-DEFINE_QSV_FILTER(vpp, vpp, "VPP", FILTER_QUERY_FUNC(vpp_query_formats));
+DEFINE_QSV_FILTER(vpp, vpp, "VPP", FILTER_QUERY_FUNC2(vpp_query_formats));
 
 #endif
 
-- 
2.43.0



More information about the ffmpeg-devel mailing list