msdk: return the right pointer for GST_VIDEO_FORMAT_VUYA frame
authorHaihao Xiang <haihao.xiang@intel.com>
Thu, 14 Mar 2019 04:05:58 +0000 (12:05 +0800)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 25 Mar 2019 09:50:33 +0000 (09:50 +0000)
The first component for GST_VIDEO_FORMAT_VUYA in memory is V.

sys/msdk/gstmsdkvideomemory.c

index 2648468..5823e78 100644 (file)
@@ -235,7 +235,11 @@ gst_video_meta_map_msdk_memory (GstVideoMeta * meta, guint plane,
   pitch = mem_id->pitch;
 #endif
 
-  *data = mem->surface->Data.Y + offset;
+  /* 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
+    *data = mem->surface->Data.Y + offset;
   *stride = pitch;
 
   info->flags = flags;