[PATCH] libv4lconvert: Fix support for Y16 pixel format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Y16 is a little-endian format. The original implementation assumed that
it was big-endian.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@xxxxxxxxx>
---
 lib/libv4lconvert/rgbyuv.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/libv4lconvert/rgbyuv.c b/lib/libv4lconvert/rgbyuv.c
index 0f30192..75c42aa 100644
--- a/lib/libv4lconvert/rgbyuv.c
+++ b/lib/libv4lconvert/rgbyuv.c
@@ -591,6 +591,9 @@ void v4lconvert_y16_to_rgb24(const unsigned char *src, unsigned char *dest,
 		int width, int height)
 {
 	int j;
+
+	src++; /*Y16 is little endian*/
+
 	while (--height >= 0) {
 		for (j = 0; j < width; j++) {
 			*dest++ = *src;
@@ -606,6 +609,8 @@ void v4lconvert_y16_to_yuv420(const unsigned char *src, unsigned char *dest,
 {
 	int x, y;
 
+	src++; /*Y16 is little endian*/
+
 	/* Y */
 	for (y = 0; y < src_fmt->fmt.pix.height; y++)
 		for (x = 0; x < src_fmt->fmt.pix.width; x++){
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux