msdk: set right BitDepth and Shift for Y210 mfx frame
authorHaihao Xiang <haihao.xiang@intel.com>
Thu, 30 May 2019 04:20:54 +0000 (12:20 +0800)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Sat, 29 Jun 2019 14:15:32 +0000 (14:15 +0000)
BitDepth is 10 and Shitf must be set to 1 when creating Y210 mfx
frame in MSDK

sys/msdk/msdk.c

index 8d8411b..bc1d110 100644 (file)
@@ -282,10 +282,19 @@ gst_msdk_set_mfx_frame_info_from_video_info (mfxFrameInfo * mfx_info,
   mfx_info->ChromaFormat =
       gst_msdk_get_mfx_chroma_from_format (GST_VIDEO_INFO_FORMAT (info));
 
-  if (mfx_info->FourCC == MFX_FOURCC_P010) {
-    mfx_info->BitDepthLuma = 10;
-    mfx_info->BitDepthChroma = 10;
-    mfx_info->Shift = 1;
+  switch (mfx_info->FourCC) {
+    case MFX_FOURCC_P010:
+#if (MFX_VERSION >= 1027)
+    case MFX_FOURCC_Y210:
+#endif
+      mfx_info->BitDepthLuma = 10;
+      mfx_info->BitDepthChroma = 10;
+      mfx_info->Shift = 1;
+
+      break;
+
+    default:
+      break;
   }
 
   return;