msdkdec: Update frame info from video parameters

A 10bit stream may have different depth values for Luma and Chroma, and
MSDK requires the frame info must match the corresponding video
parameters
This commit is contained in:
Haihao Xiang 2019-07-25 22:55:09 +08:00 committed by Sebastian Dröge
parent 68057cee98
commit ef81c9d6c4
3 changed files with 15 additions and 0 deletions

View file

@ -205,6 +205,8 @@ get_surface (GstMsdkDec * thiz, GstBuffer * buffer)
goto failed_unref_buffer2;
}
gst_msdk_update_mfx_frame_info_from_mfx_video_param (&i->surface->Info,
&thiz->param);
thiz->decoded_msdk_surfaces = g_list_append (thiz->decoded_msdk_surfaces, i);
return i;

View file

@ -377,3 +377,12 @@ gst_msdk_get_video_format_from_mfx_fourcc (mfxU32 fourcc)
return GST_VIDEO_FORMAT_UNKNOWN;
}
void
gst_msdk_update_mfx_frame_info_from_mfx_video_param (mfxFrameInfo * mfx_info,
mfxVideoParam * param)
{
mfx_info->BitDepthLuma = param->mfx.FrameInfo.BitDepthLuma;
mfx_info->BitDepthChroma = param->mfx.FrameInfo.BitDepthChroma;
mfx_info->Shift = param->mfx.FrameInfo.Shift;
}

View file

@ -74,6 +74,10 @@ gst_msdk_get_surface_from_buffer (GstBuffer * buf);
GstVideoFormat
gst_msdk_get_video_format_from_mfx_fourcc (mfxU32 fourcc);
void
gst_msdk_update_mfx_frame_info_from_mfx_video_param (mfxFrameInfo * mfx_info,
mfxVideoParam * param);
G_END_DECLS
#endif /* __MSDK_H__ */