This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l2grab: add RGB 32 format and variants
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Sun Oct 31 22:53:43 2021 +0000

Those are pretty simple to add. As we don't have much to do with
that, just ignore the alpha channel, if present.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 contrib/test/v4l2grab.c | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=a13eec2cb2e88c48ab2ba88163df61900ac0db33
diff --git a/contrib/test/v4l2grab.c b/contrib/test/v4l2grab.c
index af2a5bc0acaf..04cd6653ebf4 100644
--- a/contrib/test/v4l2grab.c
+++ b/contrib/test/v4l2grab.c
@@ -310,6 +310,28 @@ static void copy_two_pixels(struct v4l2_format *fmt,
                        convert_yuv(enc, plane0[i], u, v, dst);
 
                break;
+       case V4L2_PIX_FMT_RGB32:
+       case V4L2_PIX_FMT_ARGB32:
+       case V4L2_PIX_FMT_XRGB32:
+               for (i = 0; i < 2; i++) {
+                       *(*dst)++ = plane0[1];
+                       *(*dst)++ = plane0[2];
+                       *(*dst)++ = plane0[3];
+
+                       plane0 += 4;
+               }
+               break;
+       case V4L2_PIX_FMT_BGR32:
+       case V4L2_PIX_FMT_ABGR32:
+       case V4L2_PIX_FMT_XBGR32:
+               for (i = 0; i < 2; i++) {
+                       *(*dst)++ = plane0[2];
+                       *(*dst)++ = plane0[1];
+                       *(*dst)++ = plane0[0];
+
+                       plane0 += 4;
+               }
+               break;
        default:
        case V4L2_PIX_FMT_BGR24:
                for (i = 0; i < 2; i++) {
@@ -348,11 +370,18 @@ static unsigned int convert_to_rgb24(struct v4l2_format 
*fmt,
        else
                enc = fmt->fmt.pix.ycbcr_enc;
 
-       /* Depth should be multiple of 4 */
        switch (fmt->fmt.pix.pixelformat) {
        case V4L2_PIX_FMT_BGR24:
                depth = 24;
                break;
+       case V4L2_PIX_FMT_RGB32:
+       case V4L2_PIX_FMT_ARGB32:
+       case V4L2_PIX_FMT_XRGB32:
+       case V4L2_PIX_FMT_BGR32:
+       case V4L2_PIX_FMT_ABGR32:
+       case V4L2_PIX_FMT_XBGR32:
+               depth = 32;
+               break;
        case V4L2_PIX_FMT_NV12:
        case V4L2_PIX_FMT_NV21:
                num_planes = 2;
@@ -1047,6 +1076,12 @@ int main(int argc, char **argv)
        case V4L2_PIX_FMT_RGB565:
        case V4L2_PIX_FMT_RGB565X:
        case V4L2_PIX_FMT_RGB24:
+       case V4L2_PIX_FMT_RGB32:
+       case V4L2_PIX_FMT_ARGB32:
+       case V4L2_PIX_FMT_XRGB32:
+       case V4L2_PIX_FMT_BGR32:
+       case V4L2_PIX_FMT_ABGR32:
+       case V4L2_PIX_FMT_XBGR32:
        case V4L2_PIX_FMT_YUYV:
        case V4L2_PIX_FMT_UYVY:
        case V4L2_PIX_FMT_YVYU:

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to