Skip to contentSkip to conversation

media: gspca_vc032x - wrong bytesperline

PATCH In review Luca Bonissi 2 participants 3 messages Jan 26, 2015 – Jan 28, 2015 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: gspca_vc032x - wrong bytesperline

Hi!

I found a problem on vc032x gspca usb webcam subdriver: "bytesperline" property is wrong for YUYV and YVYU formats. With recent v4l-utils library (>=0.9.1), that uses "bytesperline" for pixel format conversion, the result is a wrong jerky image.

Patch tested on my laptop (USB webcam Logitech Orbicam 046d:0892).

media/usb/gspca/vc032x.c 2015-01-12 00:28:39.423311693 +0100 renamed from media/usb/gspca/vc032x.c.orig 2014-08-04 00:25:02.000000000 +0200 +4 -4
@@ -68,12 +68,12 @@
 
 static const struct v4l2_pix_format vc0321_mode[] = {
        {320, 240, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
-               .bytesperline = 320,
+               .bytesperline = 320 * 2,
                .sizeimage = 320 * 240 * 2,
                .colorspace = V4L2_COLORSPACE_SRGB,
                .priv = 1},
        {640, 480, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
-               .bytesperline = 640,
+               .bytesperline = 640 * 2,
                .sizeimage = 640 * 480 * 2,
                .colorspace = V4L2_COLORSPACE_SRGB,
                .priv = 0},
@@ -97,12 +97,12 @@
 };
 static const struct v4l2_pix_format bi_mode[] = {
        {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
-               .bytesperline = 320,
+               .bytesperline = 320 * 2,
                .sizeimage = 320 * 240 * 2,
                .colorspace = V4L2_COLORSPACE_SRGB,
                .priv = 2},
        {640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
-               .bytesperline = 640,
+               .bytesperline = 640 * 2,
                .sizeimage = 640 * 480 * 2,
                .colorspace = V4L2_COLORSPACE_SRGB,
                .priv = 1},
#1 lore raw

Sorry, forgot to include related link to kernel bugzilla:

https://bugzilla.kernel.org/show_bug.cgi?id=91181

Ciao!
Luca

Quoted 9 lines · Luca Bonissi

Hi!

I found a problem on vc032x gspca usb webcam subdriver: "bytesperline" property is wrong for YUYV and YVYU formats.
With recent v4l-utils library (>=0.9.1), that uses "bytesperline" for pixel format conversion, the result is a wrong jerky image.

Patch tested on my laptop (USB webcam Logitech Orbicam 046d:0892).

#2 lore raw
In reply to Luca Bonissi

Hi,

Quoted 6 lines · Luca Bonissi

Hi!

I found a problem on vc032x gspca usb webcam subdriver: "bytesperline" property is wrong for YUYV and YVYU formats. With recent v4l-utils library (>=0.9.1), that uses "bytesperline" for pixel format conversion, the result is a wrong jerky image.

Patch tested on my laptop (USB webcam Logitech Orbicam 046d:0892).

Thanks, I've added this patch to my gspca tree, and send a pull-req to Mauro to get it added to 3.20 .

Regards,

Hans

Quoted 38 lines
media/usb/gspca/vc032x.c 2015-01-12 00:28:39.423311693 +0100 renamed from media/usb/gspca/vc032x.c.orig 2014-08-04 00:25:02.000000000 +0200 +4 -5
@@ -68,12 +68,12 @@
 
  static const struct v4l2_pix_format vc0321_mode[] = {
         {320, 240, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
-               .bytesperline = 320,
+               .bytesperline = 320 * 2,
                 .sizeimage = 320 * 240 * 2,
                 .colorspace = V4L2_COLORSPACE_SRGB,
                 .priv = 1},
         {640, 480, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
-               .bytesperline = 640,
+               .bytesperline = 640 * 2,
                 .sizeimage = 640 * 480 * 2,
                 .colorspace = V4L2_COLORSPACE_SRGB,
                 .priv = 0},
@@ -97,12 +97,12 @@
  };
  static const struct v4l2_pix_format bi_mode[] = {
         {320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
-               .bytesperline = 320,
+               .bytesperline = 320 * 2,
                 .sizeimage = 320 * 240 * 2,
                 .colorspace = V4L2_COLORSPACE_SRGB,
                 .priv = 2},
         {640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
-               .bytesperline = 640,
+               .bytesperline = 640 * 2,
                 .sizeimage = 640 * 480 * 2,
                 .colorspace = V4L2_COLORSPACE_SRGB,
                 .priv = 1},
 
--

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