msdk: return a right pointer for VUYA format
authorHaihao Xiang <haihao.xiang@intel.com>
Fri, 31 May 2019 06:09:40 +0000 (14:09 +0800)
committerHaihao Xiang <haihao.xiang@intel.com>
Fri, 31 May 2019 06:51:35 +0000 (14:51 +0800)
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

index 336e83f..62f5c8f 100644 (file)
@@ -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