From 546797cecfe8ca67bbef6de39b84e6410293b42b Mon Sep 17 00:00:00 2001 From: Haihao Xiang Date: Mon, 21 Jan 2019 12:25:36 +0800 Subject: [PATCH] msdkdec: set the mfx picture structure to MFX_PICSTRUCT_PROGRESSIVE if it is unknown The picture structure in the output parameters from MFXVideoDECODE_Query is set to MFX_PICSTRUCT_UNKNOWN for some codecs, so the structure of the corresponding mfx surfaces created for decoding are unknown. The pipeline will be broken when these surfaces are used as the input for msdkvpp. Example pipeline: gst-launch-1.0 filesrc location=input_vp8.webm ! matroskademux ! msdkvp8dec ! msdkvpp ! fakesink Error message: 0:00:00.031568911 14259 0x55b79dc684a0 ERROR msdkvpp gstmsdkvpp.c:728:gst_msdkvpp_transform: MSDK Failed to do VPP ERROR: from element /GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0: Internal data stream error. This is a workaround for the above issue --- sys/msdk/gstmsdkdec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/msdk/gstmsdkdec.c b/sys/msdk/gstmsdkdec.c index 217cd20..94511e6 100644 --- a/sys/msdk/gstmsdkdec.c +++ b/sys/msdk/gstmsdkdec.c @@ -345,6 +345,13 @@ gst_msdkdec_init_decoder (GstMsdkDec * thiz) msdk_status_to_string (status)); } + /* Force the structure to MFX_PICSTRUCT_PROGRESSIVE if it is unknow to + * work-around MSDK issue: + * https://github.com/Intel-Media-SDK/MediaSDK/issues/1139 + */ + if (thiz->param.mfx.FrameInfo.PicStruct == MFX_PICSTRUCT_UNKNOWN) + thiz->param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE; + status = MFXVideoDECODE_QueryIOSurf (session, &thiz->param, &request); if (status < MFX_ERR_NONE) { GST_ERROR_OBJECT (thiz, "Query IO surfaces failed (%s)", -- 2.7.4