From f39bcd3920c5f5e876f2907db795b06411fa6cb9 Mon Sep 17 00:00:00 2001 From: Haihao Xiang Date: Mon, 25 Feb 2019 12:18:05 +0800 Subject: msdk: set some parameters in mfxFrameData for a RGB16 frame --- sys/msdk/gstmsdkallocator_libva.c | 6 ++++++ sys/msdk/gstmsdksystemmemory.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/sys/msdk/gstmsdkallocator_libva.c b/sys/msdk/gstmsdkallocator_libva.c index db3ab73dc..30154517b 100644 --- a/sys/msdk/gstmsdkallocator_libva.c +++ b/sys/msdk/gstmsdkallocator_libva.c @@ -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; diff --git a/sys/msdk/gstmsdksystemmemory.c b/sys/msdk/gstmsdksystemmemory.c index 69d366208..3b659a34d 100644 --- a/sys/msdk/gstmsdksystemmemory.c +++ b/sys/msdk/gstmsdksystemmemory.c @@ -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; -- cgit v1.2.3