@@ -178,10 +178,10 @@ int v4lconvert_y10b_to_yuv420(struct v4lconvert_data *data,
const unsigned char *src, unsigned char *dest, int width, int height);
void v4lconvert_rgb565_to_rgb24(const unsigned char *src, unsigned char *dest,
- int width, int height);
+ int width, int height, int stride);
void v4lconvert_rgb565_to_bgr24(const unsigned char *src, unsigned char *dest,
- int width, int height);
+ int width, int height, int stride);
void v4lconvert_rgb565_to_yuv420(const unsigned char *src, unsigned char *dest,
const struct v4l2_format *src_fmt, int yvu);
@@ -1282,10 +1282,10 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data *data,
}
switch (dest_pix_fmt) {
case V4L2_PIX_FMT_RGB24:
- v4lconvert_rgb565_to_rgb24(src, dest, width, height);
+ v4lconvert_rgb565_to_rgb24(src, dest, width, height, bytesperline);
break;
case V4L2_PIX_FMT_BGR24:
- v4lconvert_rgb565_to_bgr24(src, dest, width, height);
+ v4lconvert_rgb565_to_bgr24(src, dest, width, height, bytesperline);
break;
case V4L2_PIX_FMT_YUV420:
v4lconvert_rgb565_to_yuv420(src, dest, fmt, 0);
@@ -511,7 +511,7 @@ void v4lconvert_swap_uv(const unsigned char *src, unsigned char *dest,
}
void v4lconvert_rgb565_to_rgb24(const unsigned char *src, unsigned char *dest,
- int width, int height)
+ int width, int height, int stride)
{
int j;
while (--height >= 0) {
@@ -525,11 +525,12 @@ void v4lconvert_rgb565_to_rgb24(const unsigned char *src, unsigned char *dest,
src += 2;
}
+ src += stride - 2 * width;
}
}
void v4lconvert_rgb565_to_bgr24(const unsigned char *src, unsigned char *dest,
- int width, int height)
+ int width, int height, int stride)
{
int j;
while (--height >= 0) {
@@ -543,6 +544,7 @@ void v4lconvert_rgb565_to_bgr24(const unsigned char *src, unsigned char *dest,
src += 2;
}
+ src += stride - 2 * width;
}
}