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...@intel.com>
Signed-off-by: Haihao Xiang <haihao.xi...@intel.com>
---
 libavcodec/qsv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

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;
-- 
2.7.4

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to