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: libv4lconvert: Add support for V4L2_PIX_FMT_Y16_BE
Author:  Ricardo Ribalda Delgado <[email protected]>
Date:    Mon May 18 17:07:20 2015 +0200

Y16_BE is the big-endian version of Y16.

Signed-off-by: Ricardo Ribalda Delgado <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>

 lib/libv4lconvert/libv4lconvert-priv.h |    4 ++--
 lib/libv4lconvert/libv4lconvert.c      |    8 ++++++--
 lib/libv4lconvert/rgbyuv.c             |   10 ++++++----
 3 files changed, 14 insertions(+), 8 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=b11a7ac323f6c30fa9eb772965880833f367c828

diff --git a/lib/libv4lconvert/libv4lconvert-priv.h 
b/lib/libv4lconvert/libv4lconvert-priv.h
index c19bbd4..b77e3d3 100644
--- a/lib/libv4lconvert/libv4lconvert-priv.h
+++ b/lib/libv4lconvert/libv4lconvert-priv.h
@@ -157,10 +157,10 @@ void v4lconvert_grey_to_yuv420(const unsigned char *src, 
unsigned char *dest,
                const struct v4l2_format *src_fmt);
 
 void v4lconvert_y16_to_rgb24(const unsigned char *src, unsigned char *dest,
-               int width, int height);
+               int width, int height, int little_endian);
 
 void v4lconvert_y16_to_yuv420(const unsigned char *src, unsigned char *dest,
-               const struct v4l2_format *src_fmt);
+               const struct v4l2_format *src_fmt, int little_endian);
 
 void v4lconvert_rgb32_to_rgb24(const unsigned char *src, unsigned char *dest,
                int width, int height, int bgr);
diff --git a/lib/libv4lconvert/libv4lconvert.c 
b/lib/libv4lconvert/libv4lconvert.c
index 57d0176..f62aea1 100644
--- a/lib/libv4lconvert/libv4lconvert.c
+++ b/lib/libv4lconvert/libv4lconvert.c
@@ -139,6 +139,7 @@ static const struct v4lconvert_pixfmt 
supported_src_pixfmts[] = {
        { V4L2_PIX_FMT_Y6,               8,     20,     20,     0 },
        { V4L2_PIX_FMT_Y10BPACK,        10,     20,     20,     0 },
        { V4L2_PIX_FMT_Y16,             16,     20,     20,     0 },
+       { V4L2_PIX_FMT_Y16_BE,          16,     20,     20,     0 },
 };
 
 static const struct v4lconvert_pixfmt supported_dst_pixfmts[] = {
@@ -1005,6 +1006,7 @@ static int v4lconvert_convert_pixfmt(struct 
v4lconvert_data *data,
        }
 
        case V4L2_PIX_FMT_Y16:
+       case V4L2_PIX_FMT_Y16_BE:
                if (src_size < (width * height * 2)) {
                        V4LCONVERT_ERR("short y16 data frame\n");
                        errno = EPIPE;
@@ -1013,11 +1015,13 @@ static int v4lconvert_convert_pixfmt(struct 
v4lconvert_data *data,
                switch (dest_pix_fmt) {
                case V4L2_PIX_FMT_RGB24:
                case V4L2_PIX_FMT_BGR24:
-                       v4lconvert_y16_to_rgb24(src, dest, width, height);
+                       v4lconvert_y16_to_rgb24(src, dest, width, height,
+                                       src_pix_fmt == V4L2_PIX_FMT_Y16);
                        break;
                case V4L2_PIX_FMT_YUV420:
                case V4L2_PIX_FMT_YVU420:
-                       v4lconvert_y16_to_yuv420(src, dest, fmt);
+                       v4lconvert_y16_to_yuv420(src, dest, fmt,
+                                        src_pix_fmt == V4L2_PIX_FMT_Y16);
                        break;
                }
                break;
diff --git a/lib/libv4lconvert/rgbyuv.c b/lib/libv4lconvert/rgbyuv.c
index 75c42aa..695255a 100644
--- a/lib/libv4lconvert/rgbyuv.c
+++ b/lib/libv4lconvert/rgbyuv.c
@@ -588,11 +588,12 @@ void v4lconvert_rgb565_to_yuv420(const unsigned char 
*src, unsigned char *dest,
 }
 
 void v4lconvert_y16_to_rgb24(const unsigned char *src, unsigned char *dest,
-               int width, int height)
+               int width, int height, int little_endian)
 {
        int j;
 
-       src++; /*Y16 is little endian*/
+       if (little_endian)
+               src++;
 
        while (--height >= 0) {
                for (j = 0; j < width; j++) {
@@ -605,11 +606,12 @@ void v4lconvert_y16_to_rgb24(const unsigned char *src, 
unsigned char *dest,
 }
 
 void v4lconvert_y16_to_yuv420(const unsigned char *src, unsigned char *dest,
-               const struct v4l2_format *src_fmt)
+               const struct v4l2_format *src_fmt, int little_endian)
 {
        int x, y;
 
-       src++; /*Y16 is little endian*/
+       if (little_endian)
+               src++;
 
        /* Y */
        for (y = 0; y < src_fmt->fmt.pix.height; y++)

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

Reply via email to