v4l2: Correctly map RGB32 format
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 7 Mar 2014 22:31:29 +0000 (17:31 -0500)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 30 Apr 2014 19:36:07 +0000 (15:36 -0400)
In v4l2 specification, RGB32 has the alpha, or pading, first, not last.
See http://linuxtv.org/downloads/v4l-dvb-apis/packed-rgb.html .

https://bugzilla.gnome.org/show_bug.cgi?id=540941

sys/v4l2/gstv4l2object.c

index b8f66c04ee7466d418934ee9cd993141d16d0722..4313c3468d846114fe44f454a922367f82597dd0 100644 (file)
@@ -1093,7 +1093,7 @@ gst_v4l2_object_v4l2fourcc_to_video_format (guint32 fourcc)
       format = GST_VIDEO_FORMAT_BGR;
       break;
     case V4L2_PIX_FMT_RGB32:
-      format = GST_VIDEO_FORMAT_RGBx;
+      format = GST_VIDEO_FORMAT_xRGB;
       break;
     case V4L2_PIX_FMT_BGR32:
       format = GST_VIDEO_FORMAT_BGRx;
@@ -1430,8 +1430,8 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
       case GST_VIDEO_FORMAT_BGR:
         fourcc = V4L2_PIX_FMT_BGR24;
         break;
-      case GST_VIDEO_FORMAT_RGBx:
-      case GST_VIDEO_FORMAT_RGBA:
+      case GST_VIDEO_FORMAT_xRGB:
+      case GST_VIDEO_FORMAT_ARGB:
         fourcc = V4L2_PIX_FMT_RGB32;
         break;
       case GST_VIDEO_FORMAT_BGRx: