msdk: set some parameters in mfxFrameData for a RGB16 frame
authorHaihao Xiang <haihao.xiang@intel.com>
Mon, 25 Feb 2019 04:18:05 +0000 (12:18 +0800)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Wed, 27 Feb 2019 15:22:43 +0000 (15:22 +0000)
sys/msdk/gstmsdkallocator_libva.c
sys/msdk/gstmsdksystemmemory.c

index db3ab73dc4f512f0c8095228b3448eb0c380d7ff..30154517b36df14edae8499e29253eebe83cb384 100644 (file)
@@ -312,6 +312,12 @@ gst_msdk_frame_lock (mfxHDL pthis, mfxMemId mid, mfxFrameData * data)
         data->B = data->R + 2;
         data->A = data->R + 3;
         break;
+      case VA_FOURCC_RGB565:
+        data->Pitch = mem_id->image.pitches[0];
+        data->R = buf + mem_id->image.offsets[0];
+        data->G = data->R;
+        data->B = data->R;
+        break;
       default:
         g_assert_not_reached ();
         break;
index 69d3662086fca470f8299058866972712f89ab16..3b659a34dfb476e0bf4bcb0f46832b5472aa163a 100644 (file)
@@ -113,6 +113,12 @@ ensure_data (GstMsdkSystemMemory * mem)
       mem->surface->Data.B = mem->surface->Data.R + 2;
       mem->surface->Data.Pitch = mem->destination_pitches[0];
       break;
+    case GST_VIDEO_FORMAT_RGB16:
+      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.Pitch = mem->destination_pitches[0];
+      break;
     default:
       g_assert_not_reached ();
       break;