diff mbox

[FFmpeg-devel,2/2] lavc/qsv: force internal allocator for MFX_FOURCC_VP9_SEGMAP surface

Message ID 1569752516-6274-2-git-send-email-zhong.li@intel.com
State New
Headers show

Commit Message

Zhong Li Sept. 29, 2019, 10:21 a.m. UTC
Return MFX_ERR_UNSUPPORTED for MFX_FOURCC_VP9_SEGMAP to force internal allocator.
See https://github.com/Intel-Media-SDK/MediaSDK/issues/762 for more detail

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavcodec/qsv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox

Patch

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 994c9eb..3608c3e 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -576,6 +576,16 @@  static mfxStatus qsv_frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req,
             return MFX_ERR_MEMORY_ALLOC;
         }
     } else if (req->Type & MFX_MEMTYPE_INTERNAL_FRAME) {
+        /* MFX_MAKEFOURCC('V','P','8','S') is used for MFX_FOURCC_VP9_SEGMAP surface
+         * in MSDK and this surface is an internal surface. The external allocator
+         * shouldn't be used for this surface allocation.
+         * Return UNSUPPORTED and force MSDK allocates surface using the internal allocator
+         *
+         * See https://github.com/Intel-Media-SDK/MediaSDK/issues/762
+         */
+        if (req->Info.FourCC == MFX_MAKEFOURCC ('V', 'P', '8', 'S')) {
+            return MFX_ERR_UNSUPPORTED;
+        }
         /* internal frames -- allocate a new hw frames context */
         AVHWFramesContext *ext_frames_ctx = (AVHWFramesContext*)ctx->hw_frames_ctx->data;
         mfxFrameInfo      *i  = &req->Info;