From 9da737d6aa26d5baf1d0d92db4f3b6f307a06828 Mon Sep 17 00:00:00 2001 From: Haihao Xiang Date: Fri, 31 May 2019 16:22:08 +0800 Subject: [PATCH] msdk: return a right pointer for Y410 when mapping a frame --- sys/msdk/gstmsdksystemmemory.c | 4 ++++ sys/msdk/gstmsdkvideomemory.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sys/msdk/gstmsdksystemmemory.c b/sys/msdk/gstmsdksystemmemory.c index 51bde407a5..8bb797c018 100644 --- a/sys/msdk/gstmsdksystemmemory.c +++ b/sys/msdk/gstmsdksystemmemory.c @@ -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; } diff --git a/sys/msdk/gstmsdkvideomemory.c b/sys/msdk/gstmsdkvideomemory.c index 5823e7843b..2b85f30866 100644 --- a/sys/msdk/gstmsdkvideomemory.c +++ b/sys/msdk/gstmsdkvideomemory.c @@ -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;