-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Philip,

replace the patch from you collection with this one :)

play with it carefully.

To reduce bandwidth for jpeg set quirks to 0x440
you can also reduce probable compression ratio for calculator by setting
jpg_compression=1 or other number. default is 4.
with 1 i get some times corrupted images.

Am 17.11.2011 17:29, schrieb Philip Gladstone:
> I have put the patches that I am using on:
> http://pskreporter.info/uvc.pf
> 
> Unfortunately, these patches also include a change to convert from 
> uvc_trace to pr_debug, so there are a lot more changes than
> necessary.
> 
> Philip
> 
> On 11/17/2011 11:03 AM, Sandro Hawke wrote:
>>> Could I be a pain and ask for a link to the thread about the
>>> patch, or to the patch itself please.
>> I would very much appreciate this, too.
>> 
>> - Sandro



- -- 
Regards,
Alexey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7qYKIACgkQw8E0jNwoJm+8lgCglVquyr5CEsv1lBqVlftDWq5y
Ma8An0PHVjgKQW+InCIkF6HD/Y/752c9
=ds+g
-----END PGP SIGNATURE-----
diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c
index a240d43..8bf364c 100644
--- a/drivers/media/video/uvc/uvc_driver.c
+++ b/drivers/media/video/uvc/uvc_driver.c
@@ -48,6 +48,7 @@ unsigned int uvc_no_drop_param;
 static unsigned int uvc_quirks_param = -1;
 unsigned int uvc_trace_param;
 unsigned int uvc_timeout_param = UVC_CTRL_STREAMING_TIMEOUT;
+unsigned int uvc_jpeg_comp_param;
 
 /* ------------------------------------------------------------------------
  * Video formats
@@ -365,6 +366,10 @@ static int uvc_parse_format(struct uvc_device *dev,
 		format->fcc = V4L2_PIX_FMT_MJPEG;
 		format->flags = UVC_FMT_FLAG_COMPRESSED;
 		format->bpp = 0;
+		if ((uvc_jpeg_comp_param > 0) && ( 16 >= uvc_jpeg_comp_param))
+			format->bpp = uvc_jpeg_comp_param;
+		else
+			format->bpp = 4;
 		ftype = UVC_VS_FRAME_MJPEG;
 		break;
 
@@ -2026,6 +2031,8 @@ module_param_named(trace, uvc_trace_param, uint, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(trace, "Trace level bitmask");
 module_param_named(timeout, uvc_timeout_param, uint, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(timeout, "Streaming control requests timeout");
+module_param_named(jpg_compression, uvc_jpeg_comp_param, uint, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(jpg_compression, "JPG compression ratio for bandwidth quirk");
 
 /* ------------------------------------------------------------------------
  * Driver initialization and cleanup
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
index db0ba20..b417ca4 100644
--- a/drivers/media/video/uvc/uvc_video.c
+++ b/drivers/media/video/uvc/uvc_video.c
@@ -120,8 +120,10 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream,
 		ctrl->dwMaxVideoFrameSize =
 			frame->dwMaxVideoFrameBufferSize;
 
-	if (!(format->flags & UVC_FMT_FLAG_COMPRESSED) &&
-	    stream->dev->quirks & UVC_QUIRK_FIX_BANDWIDTH &&
+	if ((!(format->flags & UVC_FMT_FLAG_COMPRESSED) ||
+	      (format->fcc == V4L2_PIX_FMT_MJPEG)) &&
+	    (stream->dev->quirks & UVC_QUIRK_FIX_BANDWIDTH ||
+	     stream->dev->quirks & UVC_QUIRK_FIX_JPEG_BANDWIDTH) &&
 	    stream->intf->num_altsetting > 1) {
 		u32 interval;
 		u32 bandwidth;
@@ -150,7 +152,8 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream,
 		 * resolutions working while not preventing two simultaneous
 		 * VGA streams at 15 fps.
 		 */
-		bandwidth = max_t(u32, bandwidth, 1024);
+		if(!(stream->dev->quirks & UVC_QUIRK_DISABLE_URB_1024))
+			bandwidth = max_t(u32, bandwidth, 1024);
 
 		ctrl->dwMaxPayloadTransferSize = bandwidth;
 	}
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
index 50c9490..a738ac8 100644
--- a/drivers/media/video/uvc/uvcvideo.h
+++ b/drivers/media/video/uvc/uvcvideo.h
@@ -122,9 +122,11 @@
 #define UVC_QUIRK_BUILTIN_ISIGHT	0x00000008
 #define UVC_QUIRK_STREAM_NO_FID		0x00000010
 #define UVC_QUIRK_IGNORE_SELECTOR_UNIT	0x00000020
+#define UVC_QUIRK_FIX_JPEG_BANDWIDTH	0x00000040
 #define UVC_QUIRK_FIX_BANDWIDTH		0x00000080
 #define UVC_QUIRK_PROBE_DEF		0x00000100
 #define UVC_QUIRK_RESTRICT_FRAME_RATE	0x00000200
+#define UVC_QUIRK_DISABLE_URB_1024	0x00000400
 
 /* Format flags */
 #define UVC_FMT_FLAG_COMPRESSED		0x00000001
_______________________________________________
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to