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 support for YUV 420 planar and semi-planar formats
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Sun Oct 31 16:32:28 2021 +0000

Now that planes support is in place, add support for YUV and
YVU 4:2:0 planar and semi-planar formats.

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

 contrib/test/v4l2grab.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=365915aa694d9c1a66b59bb718456fdd6fefa67c
diff --git a/contrib/test/v4l2grab.c b/contrib/test/v4l2grab.c
index 5dab5bb09d93..af2a5bc0acaf 100644
--- a/contrib/test/v4l2grab.c
+++ b/contrib/test/v4l2grab.c
@@ -281,6 +281,34 @@ static void copy_two_pixels(struct v4l2_format *fmt,
                for (i = 0; i < 2; i++)
                        convert_yuv(enc, plane0[y_off + (i << 1)], u, v, dst);
 
+               break;
+       case V4L2_PIX_FMT_NV12:
+       case V4L2_PIX_FMT_NV21:
+               if (fourcc == V4L2_PIX_FMT_NV12) {
+                       u = plane1[0];
+                       v = plane1[1];
+               } else {
+                       u = plane1[1];
+                       v = plane1[0];
+               }
+
+               for (i = 0; i < 2; i++)
+                       convert_yuv(enc, plane0[i], u, v, dst);
+
+               break;
+       case V4L2_PIX_FMT_YUV420:
+       case V4L2_PIX_FMT_YVU420:
+               if (fourcc == V4L2_PIX_FMT_YUV420) {
+                       u = plane1[0];
+                       v = plane2[0];
+               } else {
+                       u = plane2[0];
+                       v = plane1[0];
+               }
+
+               for (i = 0; i < 2; i++)
+                       convert_yuv(enc, plane0[i], u, v, dst);
+
                break;
        default:
        case V4L2_PIX_FMT_BGR24:
@@ -325,6 +353,19 @@ static unsigned int convert_to_rgb24(struct v4l2_format 
*fmt,
        case V4L2_PIX_FMT_BGR24:
                depth = 24;
                break;
+       case V4L2_PIX_FMT_NV12:
+       case V4L2_PIX_FMT_NV21:
+               num_planes = 2;
+               depth = 8;                              /* Depth of plane 0 */
+               h_dec = 1;
+               break;
+       case V4L2_PIX_FMT_YUV420:
+       case V4L2_PIX_FMT_YVU420:
+               num_planes = 3;
+               depth = 8;                              /* Depth of plane 0 */
+               h_dec = 1;
+               w_dec = 1;
+               break;
        case V4L2_PIX_FMT_RGB565:
        case V4L2_PIX_FMT_RGB565X:
        case V4L2_PIX_FMT_YUYV:
@@ -1010,6 +1051,10 @@ int main(int argc, char **argv)
        case V4L2_PIX_FMT_UYVY:
        case V4L2_PIX_FMT_YVYU:
        case V4L2_PIX_FMT_VYUY:
+       case V4L2_PIX_FMT_NV12:
+       case V4L2_PIX_FMT_NV21:
+       case V4L2_PIX_FMT_YUV420:
+       case V4L2_PIX_FMT_YVU420:
                out_buf = malloc(3 * x_res * y_res);
                if (!out_buf) {
                        perror("Cannot allocate memory");

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

Reply via email to