waylandsink/wlvideoformat: add mappings for many common formats
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Wed, 26 Feb 2014 15:41:11 +0000 (17:41 +0200)
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Tue, 17 Jun 2014 11:51:23 +0000 (13:51 +0200)
ext/wayland/wlvideoformat.c

index 075551f..48f9fe5 100644 (file)
@@ -40,10 +40,41 @@ static const wl_VideoFormat formats[] = {
 #if G_BYTE_ORDER == G_BIG_ENDIAN
   {WL_SHM_FORMAT_XRGB8888, GST_VIDEO_FORMAT_xRGB},
   {WL_SHM_FORMAT_ARGB8888, GST_VIDEO_FORMAT_ARGB},
+  {WL_SHM_FORMAT_XBGR8888, GST_VIDEO_FORMAT_xBGR},
+  {WL_SHM_FORMAT_RGBX8888, GST_VIDEO_FORMAT_RGBx},
+  {WL_SHM_FORMAT_BGRX8888, GST_VIDEO_FORMAT_BGRx},
+  {WL_SHM_FORMAT_ABGR8888, GST_VIDEO_FORMAT_ABGR},
+  {WL_SHM_FORMAT_RGBA8888, GST_VIDEO_FORMAT_RGBA},
+  {WL_SHM_FORMAT_BGRA8888, GST_VIDEO_FORMAT_BGRA},
 #else
   {WL_SHM_FORMAT_XRGB8888, GST_VIDEO_FORMAT_BGRx},
   {WL_SHM_FORMAT_ARGB8888, GST_VIDEO_FORMAT_BGRA},
+  {WL_SHM_FORMAT_XBGR8888, GST_VIDEO_FORMAT_RGBx},
+  {WL_SHM_FORMAT_RGBX8888, GST_VIDEO_FORMAT_xBGR},
+  {WL_SHM_FORMAT_BGRX8888, GST_VIDEO_FORMAT_xRGB},
+  {WL_SHM_FORMAT_ABGR8888, GST_VIDEO_FORMAT_RGBA},
+  {WL_SHM_FORMAT_RGBA8888, GST_VIDEO_FORMAT_ABGR},
+  {WL_SHM_FORMAT_BGRA8888, GST_VIDEO_FORMAT_ARGB},
 #endif
+  {WL_SHM_FORMAT_RGB888, GST_VIDEO_FORMAT_RGB},
+  {WL_SHM_FORMAT_BGR888, GST_VIDEO_FORMAT_BGR},
+  {WL_SHM_FORMAT_RGB565, GST_VIDEO_FORMAT_RGB16},
+  {WL_SHM_FORMAT_BGR565, GST_VIDEO_FORMAT_BGR16},
+
+  {WL_SHM_FORMAT_YUYV, GST_VIDEO_FORMAT_YUY2},
+  {WL_SHM_FORMAT_YVYU, GST_VIDEO_FORMAT_YVYU},
+  {WL_SHM_FORMAT_UYVY, GST_VIDEO_FORMAT_UYVY},
+  {WL_SHM_FORMAT_AYUV, GST_VIDEO_FORMAT_AYUV},
+  {WL_SHM_FORMAT_NV12, GST_VIDEO_FORMAT_NV12},
+  {WL_SHM_FORMAT_NV21, GST_VIDEO_FORMAT_NV21},
+  {WL_SHM_FORMAT_NV16, GST_VIDEO_FORMAT_NV16},
+  {WL_SHM_FORMAT_YUV410, GST_VIDEO_FORMAT_YUV9},
+  {WL_SHM_FORMAT_YVU410, GST_VIDEO_FORMAT_YVU9},
+  {WL_SHM_FORMAT_YUV411, GST_VIDEO_FORMAT_Y41B},
+  {WL_SHM_FORMAT_YUV420, GST_VIDEO_FORMAT_I420},
+  {WL_SHM_FORMAT_YVU420, GST_VIDEO_FORMAT_YV12},
+  {WL_SHM_FORMAT_YUV422, GST_VIDEO_FORMAT_Y42B},
+  {WL_SHM_FORMAT_YUV444, GST_VIDEO_FORMAT_v308},
 };
 
 enum wl_shm_format