msdk: set correct parameters for BGRx frame

Otherwise when mapping BGRx frame onto CPU's memory, CPU will get wrong
data for B, G, R components

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2205>
This commit is contained in:
Haihao Xiang 2021-04-29 09:35:51 +08:00
parent 5835f2aa8d
commit 6750123d5c
2 changed files with 2 additions and 0 deletions

View file

@ -110,6 +110,7 @@ ensure_data (GstMsdkSystemMemory * mem)
mem->surface->Data.Pitch = mem->destination_pitches[0];
break;
case GST_VIDEO_FORMAT_BGRA:
case GST_VIDEO_FORMAT_BGRx:
mem->surface->Data.B = mem->cached_data[0];
mem->surface->Data.G = mem->surface->Data.B + 1;
mem->surface->Data.R = mem->surface->Data.B + 2;

View file

@ -239,6 +239,7 @@ gst_video_meta_map_msdk_memory (GstVideoMeta * meta, guint plane,
switch (meta->format) {
case GST_VIDEO_FORMAT_BGRA:
case GST_VIDEO_FORMAT_BGRx:
*data = mem->surface->Data.B + offset;
break;