msdk: map P012_LE to MFX_FOURCC_P016

MFX_FOURCC_P016 is used for semi planar 12 bits YUV format in MediaSDK
This commit is contained in:
Haihao Xiang 2020-03-10 15:32:43 +08:00
parent 4d70add5b6
commit 4d31299c12
2 changed files with 14 additions and 0 deletions

View file

@ -80,6 +80,7 @@ ensure_data (GstMsdkSystemMemory * mem)
switch (GST_VIDEO_INFO_FORMAT (info)) {
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_P010_10LE:
case GST_VIDEO_FORMAT_P012_LE:
mem->surface->Data.Y = mem->cached_data[0];
mem->surface->Data.UV = mem->cached_data[1];
mem->surface->Data.Pitch = mem->destination_pitches[0];

View file

@ -66,6 +66,10 @@ static const struct map gst_msdk_video_format_to_mfx_map[] = {
#if (MFX_VERSION >= 1027)
GST_VIDEO_INFO_TO_MFX_MAP (Y210, YUV422, Y210),
GST_VIDEO_INFO_TO_MFX_MAP (Y410, YUV444, Y410),
#endif
#if (MFX_VERSION >= 1031)
/* P016 is used for semi-planar 12 bits format in MSDK */
GST_VIDEO_INFO_TO_MFX_MAP (P012_LE, YUV420, P016),
#endif
{0, 0, 0}
};
@ -341,6 +345,15 @@ gst_msdk_set_mfx_frame_info_from_video_info (mfxFrameInfo * mfx_info,
break;
#endif
#if (MFX_VERSION >= 1031)
case MFX_FOURCC_P016:
mfx_info->BitDepthLuma = 12;
mfx_info->BitDepthChroma = 12;
mfx_info->Shift = 1;
break;
#endif
default:
break;
}