[FFmpeg-cvslog] qsv: restrict user plugin to MFX_VERSION < 2.0

Haihao Xiang git at videolan.org
Fri Aug 12 06:01:04 EEST 2022


ffmpeg | branch: master | Haihao Xiang <haihao.xiang at intel.com> | Tue Aug 18 15:20:38 2020 +0800| [6aea2243824e1c0bb7c259912a6d6f7e537545ee] | committer: Haihao Xiang

qsv: restrict user plugin to MFX_VERSION < 2.0

User plugin isn't supported for MFX_VERSION >= 2.0[1][2]. This is in
preparation for oneVPL Support

[1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals
[2] https://github.com/oneapi-src/oneVPL

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

 libavcodec/qsv.c          | 8 +++++++-
 libavcodec/qsv_internal.h | 2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index c56e32ed1f..d62c19de8d 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -19,7 +19,6 @@
  */
 
 #include <mfxvideo.h>
-#include <mfxplugin.h>
 #include <mfxjpeg.h>
 
 #include <stdio.h>
@@ -37,9 +36,14 @@
 #include "qsv_internal.h"
 
 #define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl))
+#define QSV_HAVE_USER_PLUGIN    !QSV_ONEVPL
 
 #include "mfxvp8.h"
 
+#if QSV_HAVE_USER_PLUGIN
+#include <mfxplugin.h>
+#endif
+
 int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
 {
     switch (codec_id) {
@@ -329,6 +333,7 @@ enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type)
 static int qsv_load_plugins(mfxSession session, const char *load_plugins,
                             void *logctx)
 {
+#if QSV_HAVE_USER_PLUGIN
     if (!load_plugins || !*load_plugins)
         return 0;
 
@@ -372,6 +377,7 @@ load_plugin_fail:
         if (err < 0)
             return err;
     }
+#endif
 
     return 0;
 
diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h
index cb1e55ae30..949955bda0 100644
--- a/libavcodec/qsv_internal.h
+++ b/libavcodec/qsv_internal.h
@@ -65,6 +65,8 @@
     ((MFX_VERSION.Major > (MAJOR)) ||                           \
     (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR)))
 
+#define QSV_ONEVPL       QSV_VERSION_ATLEAST(2, 0)
+
 typedef struct QSVMid {
     AVBufferRef *hw_frames_ref;
     mfxHDLPair *handle_pair;



More information about the ffmpeg-cvslog mailing list