msdk: return a right pointer for Y410 when mapping a frame

This commit is contained in:
Haihao Xiang 2019-05-31 16:22:08 +08:00 committed by Víctor Manuel Jáquez Leal
parent ba24af0490
commit 9da737d6aa
2 changed files with 6 additions and 0 deletions

View file

@ -231,6 +231,10 @@ gst_msdk_system_memory_map_full (GstMemory * base_mem, GstMapInfo * info,
/* The first channel in memory is V for MFX_FOURCC_AYUV (GST_VIDEO_FORMAT_VUYA) format */
if (mem->surface->Info.FourCC == MFX_FOURCC_AYUV)
return mem->surface->Data.V;
#if (MFX_VERSION >= 1027)
else if (mem->surface->Info.FourCC == MFX_FOURCC_Y410)
return mem->surface->Data.U; /* Data.Y410 */
#endif
else
return mem->surface->Data.Y;
}

View file

@ -238,6 +238,8 @@ gst_video_meta_map_msdk_memory (GstVideoMeta * meta, guint plane,
/* The first channel in memory is V for GST_VIDEO_FORMAT_VUYA */
if (meta->format == GST_VIDEO_FORMAT_VUYA)
*data = mem->surface->Data.V + offset;
else if (meta->format == GST_VIDEO_FORMAT_Y410)
*data = mem->surface->Data.U + offset; /* Data.Y410 */
else
*data = mem->surface->Data.Y + offset;
*stride = pitch;