v4l2: Fix conflict between libdrm and v4l2 fourcc
authorNikhil Devshatwar <nikhil.nd@ti.com>
Wed, 12 Mar 2014 13:40:52 +0000 (19:10 +0530)
committerNikhil Devshatwar <nikhil.nd@ti.com>
Tue, 25 Mar 2014 09:02:51 +0000 (14:32 +0530)
For ARGB8888 format, libdrm(AR24) and v4l2 framework(RGB4)
both use different fourcc.
This patch sets fourcc to RGB4 when calling v4l2 ioctl for
AR24 color format.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
util/v4l2.c

index 33293e2ef43a51f9b1c179339c4e1130dfb6682c..634983499e5dc7ca7d3fc43355827c1802ac4d6d 100644 (file)
@@ -286,6 +286,9 @@ v4l2_open(int argc, char **argv, uint32_t *fourcc,
                format.fmt.pix.pixelformat = *fourcc;
                format.fmt.pix.width = *width;
                format.fmt.pix.height = *height;
+               if(*fourcc == FOURCC_STR("AR24"))
+                       format.fmt.pix.pixelformat = FOURCC_STR("RGB4");
+
        }
 
        if ((format.fmt.pix.width == 0) || (format.fmt.pix.height == 0) ||