aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/qsvdec.c
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2020-08-19 09:43:12 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2022-08-12 10:43:39 +0800
commitc77149bc37f5a200e635c60bf6eb4efc7b03af91 (patch)
tree18507a6a99e3624c4ad3a9e05df5e53b07db5fc7 /libavcodec/qsvdec.c
parent63cda40930a228e490e107f4fc945688696cef2a (diff)
downloadffmpeg-c77149bc37f5a200e635c60bf6eb4efc7b03af91.tar.gz
qsv: restrict OPAQUE memory to MFX_VERSION < 2.0
OPAQUE memory 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
Diffstat (limited to 'libavcodec/qsvdec.c')
-rw-r--r--libavcodec/qsvdec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index edbe7bcdee..8b718a08ff 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -187,7 +187,11 @@ static int qsv_init_session(AVCodecContext *avctx, QSVContext *q, mfxSession ses
ret = ff_qsv_init_session_frames(avctx, &q->internal_qs.session,
&q->frames_ctx, q->load_plugins,
+#if QSV_HAVE_OPAQUE
q->iopattern == MFX_IOPATTERN_OUT_OPAQUE_MEMORY,
+#else
+ 0,
+#endif
q->gpu_copy);
if (ret < 0) {
av_buffer_unref(&q->frames_ctx.hw_frames_ctx);
@@ -300,10 +304,15 @@ static int qsv_decode_preinit(AVCodecContext *avctx, QSVContext *q, enum AVPixel
AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx;
if (!iopattern) {
+#if QSV_HAVE_OPAQUE
if (frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME)
iopattern = MFX_IOPATTERN_OUT_OPAQUE_MEMORY;
else if (frames_hwctx->frame_type & MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET)
iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
+#else
+ if (frames_hwctx->frame_type & MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET)
+ iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
+#endif
}
}