msdk: set some parameters in mfxFrameData for a MFX_FOURCC_A2RGB10 frame
authorHaihao Xiang <haihao.xiang@intel.com>
Thu, 21 Mar 2019 08:14:47 +0000 (16:14 +0800)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 9 Apr 2019 14:26:02 +0000 (14:26 +0000)
sys/msdk/gstmsdkallocator_libva.c
sys/msdk/gstmsdksystemmemory.c

index 46990b5..ef94bf7 100644 (file)
@@ -331,7 +331,13 @@ gst_msdk_frame_lock (mfxHDL pthis, mfxMemId mid, mfxFrameData * data)
         data->Y = data->V + 2;
         data->A = data->V + 3;
         break;
-
+      case VA_FOURCC_A2R10G10B10:
+        data->Pitch = mem_id->image.pitches[0];
+        data->R = buf + mem_id->image.offsets[0];
+        data->G = data->R;
+        data->B = data->R;
+        data->A = data->R;
+        break;
       default:
         g_assert_not_reached ();
         break;
index 53711a5..336e83f 100644 (file)
@@ -131,7 +131,13 @@ ensure_data (GstMsdkSystemMemory * mem)
       mem->surface->Data.PitchLow =
           (mfxU16) (mem->destination_pitches[0] % (1 << 16));
       break;
-
+    case GST_VIDEO_FORMAT_BGR10A2_LE:
+      mem->surface->Data.R = mem->cached_data[0];
+      mem->surface->Data.G = mem->surface->Data.R;
+      mem->surface->Data.B = mem->surface->Data.R;
+      mem->surface->Data.A = mem->surface->Data.R;
+      mem->surface->Data.Pitch = mem->destination_pitches[0];
+      break;
     default:
       g_assert_not_reached ();
       break;