From 1ec231b85dd9fb330fc193baffd1bb5fddd80bd9 Mon Sep 17 00:00:00 2001 From: Haihao Xiang Date: Fri, 31 May 2019 14:09:40 +0800 Subject: [PATCH] msdk: return a right pointer for VUYA format The first channel in memory is V for VUYA format, note GST_VIDEO_FORMAT_VUYA is mapped to MFX_FOURCC_AYUV in this plugin --- sys/msdk/gstmsdksystemmemory.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/msdk/gstmsdksystemmemory.c b/sys/msdk/gstmsdksystemmemory.c index 336e83f49f..62f5c8f305 100644 --- a/sys/msdk/gstmsdksystemmemory.c +++ b/sys/msdk/gstmsdksystemmemory.c @@ -217,7 +217,11 @@ gst_msdk_system_memory_map_full (GstMemory * base_mem, GstMapInfo * info, return NULL; } - return mem->surface->Data.Y; + /* 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; + else + return mem->surface->Data.Y; } static void