msdk: map MFX_FOURCC_Y416 to VA_FOURCC_Y416

Y416 is used for packed 12 bits 4:4:4:4 YUV format in media driver, the
RT format is VA_RT_FORMAT_YUV444_12
This commit is contained in:
Haihao Xiang 2020-03-12 13:12:33 +08:00
parent e769df9689
commit 55ed9458b5
2 changed files with 11 additions and 0 deletions

View file

@ -145,6 +145,9 @@ gst_msdk_frame_alloc (mfxHDL pthis, mfxFrameAllocRequest * req,
if (format == VA_RT_FORMAT_YUV422 && va_fourcc == VA_FOURCC_Y216)
format = VA_RT_FORMAT_YUV422_12;
if (format == VA_RT_FORMAT_YUV444 && va_fourcc == VA_FOURCC_Y416)
format = VA_RT_FORMAT_YUV444_12;
#endif
va_status = vaCreateSurfaces (gst_msdk_context_get_handle (context),
@ -409,6 +412,13 @@ gst_msdk_frame_lock (mfxHDL pthis, mfxMemId mid, mfxFrameData * data)
data->Pitch = mem_id->image.pitches[0];
data->U = buf + mem_id->image.offsets[0]; /* data->Y410 */
break;
case VA_FOURCC_Y416:
data->Pitch = mem_id->image.pitches[0];
data->U = buf + mem_id->image.offsets[0];
data->Y = data->U + 2;
data->V = data->U + 4;
data->A = data->U + 6;
break;
#endif
case VA_FOURCC_ABGR:
data->Pitch = mem_id->image.pitches[0];

View file

@ -65,6 +65,7 @@ static const struct fourcc_map gst_msdk_fourcc_mfx_to_va[] = {
#if (MFX_VERSION >= 1031)
FOURCC_MFX_TO_VA (P016, P016),
FOURCC_MFX_TO_VA (Y216, Y216),
FOURCC_MFX_TO_VA (Y416, Y416),
#endif
#if (MFX_VERSION >= 1028)
FOURCC_MFX_TO_VA (RGB565, RGB565),