msdk: set some parameters in mfxFrameData for a MFX_FOURCC_AYUV frame
authorHaihao Xiang <haihao.xiang@intel.com>
Fri, 8 Mar 2019 04:20:56 +0000 (12:20 +0800)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 25 Mar 2019 09:50:33 +0000 (09:50 +0000)
sys/msdk/gstmsdkallocator_libva.c
sys/msdk/gstmsdksystemmemory.c

index 02fcf51..7208d93 100644 (file)
@@ -320,6 +320,15 @@ gst_msdk_frame_lock (mfxHDL pthis, mfxMemId mid, mfxFrameData * data)
         data->B = data->R;
         break;
 #endif
+      case VA_FOURCC_AYUV:
+        data->PitchHigh = (mfxU16) (mem_id->image.pitches[0] / (1 << 16));
+        data->PitchLow = (mfxU16) (mem_id->image.pitches[0] % (1 << 16));
+        data->V = buf + mem_id->image.offsets[0];
+        data->U = data->V + 1;
+        data->Y = data->V + 2;
+        data->A = data->V + 3;
+        break;
+
       default:
         g_assert_not_reached ();
         break;
index ecd1592..53711a5 100644 (file)
@@ -121,6 +121,17 @@ ensure_data (GstMsdkSystemMemory * mem)
       mem->surface->Data.Pitch = mem->destination_pitches[0];
       break;
 #endif
+    case GST_VIDEO_FORMAT_VUYA:
+      mem->surface->Data.V = mem->cached_data[0];
+      mem->surface->Data.U = mem->surface->Data.V + 1;
+      mem->surface->Data.Y = mem->surface->Data.V + 2;
+      mem->surface->Data.A = mem->surface->Data.V + 3;
+      mem->surface->Data.PitchHigh =
+          (mfxU16) (mem->destination_pitches[0] / (1 << 16));
+      mem->surface->Data.PitchLow =
+          (mfxU16) (mem->destination_pitches[0] % (1 << 16));
+      break;
+
     default:
       g_assert_not_reached ();
       break;