[FFmpeg-devel] [PATCH v2 04/10] qsv: load user plugin for MFX_VERSION < 2.0
Haihao Xiang
haihao.xiang at intel.com
Mon Aug 16 10:33:19 EEST 2021
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/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals
[2]: https://github.com/oneapi-src/oneVPL
---
libavcodec/qsv.c | 9 ++++++++-
libavcodec/qsv_internal.h | 2 ++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 93cd4892dc..8ac2293b57 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>
@@ -36,10 +35,16 @@
#include "avcodec.h"
#include "qsv_internal.h"
+#define QSV_HAVE_USER_PLUGIN !QSV_ONEVPL
+
#if QSV_VERSION_ATLEAST(1, 12)
#include "mfxvp8.h"
#endif
+#if QSV_HAVE_USER_PLUGIN
+#include <mfxplugin.h>
+#endif
+
int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
{
switch (codec_id) {
@@ -286,6 +291,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;
@@ -329,6 +335,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 3eed35c13a..10114f1c00 100644
--- a/libavcodec/qsv_internal.h
+++ b/libavcodec/qsv_internal.h
@@ -60,6 +60,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;
mfxHDL handle;
--
2.17.1
More information about the ffmpeg-devel
mailing list