On 11 January 2009 22:29:20 GWater wrote:
> Vasily Khoruzhick schrieb:
> > On 11 January 2009 15:25:56 Hans de Goede wrote:
> >> Vasily Khoruzhick wrote:
> >>> Hi, Hans
> >>>
> >>> Recent sn9c20x driver written by microdia project
> >>> (http://groups.goolge.com/group/microdia) introduce new output format -
> >>> sn9c20x-i420. This format is actually scrambled yuv420, so it's very
> >>> easy and fast to convert it to yuv420. This patch adds sn9c20x-i420
> >>> decoder to the libv4l-0.5.7
> >>
> >> Hi,
> >>
> >> As you've probably already seen from the release mail, I've just
> >> released libv4l-0.5.8, which includes your patch.
> >>
> >> Is there any more image format conversion code inside the sn9c20x
> >> driver? If so it would be really good to move that to userspace too,
> >> once that is done the driver can be moved in to the mainline kernel (if
> >> considered ready by its devs)
> >
> > Nope, there's no more image format conversion code inside the sn9c20x
> > driver, but I really don't know if it's time to move driver into the
> > mainline kernel. I think we should discuss this question on the microdia
> > maillist.
> >
> >> Regards,
> >>
> >> Hans
> >
> > Regards
> > Vasily
>
> Got myself the 0.5.8 release from fedora updates-testing and it works
> nicely with my bandwidth-dependent JPEG-compression patch.
>
> Therefore I'd like to push that patch now. I attached it again. Maybe
> someone wants add something to the two lines I wrote ;) .
>
> GWater

Yep, I want to make a little modification:

jpeg var should be set to 0 by default, and it should be forced to 1 on FULL 
and HALF -speed devices. In this case user can enable jpeg if he wants to :)
From 78089650321d5efc48c45855bf939ae372d489f5 Mon Sep 17 00:00:00 2001
From: Vasily Khoruzhick <[email protected]>
Date: Sat, 10 Jan 2009 17:29:15 +0200
Subject: [PATCH 1/2] Use UDIA_DEBUG for "Found Header" message


Signed-off-by: Vasily Khoruzhick <[email protected]>
---
 sn9c20x-usb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sn9c20x-usb.c b/sn9c20x-usb.c
index f001016..7cd6367 100644
--- a/sn9c20x-usb.c
+++ b/sn9c20x-usb.c
@@ -469,7 +469,7 @@ int usb_sn9c20x_detect_frame(unsigned char *buf, unsigned int buf_length)
 	}
 	for (index = 0; index < buf_length - 63; index++) {
 		if (memcmp(buf + index, frame_header, 6) == 0) {
-			UDIA_INFO("Found Header at %d\n", index);
+			UDIA_DEBUG("Found Header at %d\n", index);
 			return index;
 		}
 	}
-- 
1.6.1

From af44b7575ee8231d194ea2797868fc88a812319f Mon Sep 17 00:00:00 2001
From: Vasily Khoruzhick <[email protected]>
Date: Sun, 11 Jan 2009 23:37:53 +0200
Subject: [PATCH 2/2] Disable JPEG for high speed USB 2.0 connections


Signed-off-by: Vasily Khoruzhick <[email protected]>
---
 sn9c20x-usb.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/sn9c20x-usb.c b/sn9c20x-usb.c
index 7cd6367..39079c8 100644
--- a/sn9c20x-usb.c
+++ b/sn9c20x-usb.c
@@ -57,7 +57,7 @@ static __u8 bulk;
  * @var jpeg
  *  Module parameter to enable/disable JPEG format
  */
-__u8 jpeg = 1;
+static __u8 jpeg;
 
 /**
  * @var bandwidth
@@ -827,6 +827,11 @@ static int usb_sn9c20x_probe(struct usb_interface *interface, const struct usb_d
 
 	usb_sn9c20x_default_settings(dev);
 
+	if (dev->udev->speed != USB_SPEED_HIGH || bandwidth != 8) {
+		UDIA_WARN("Low bandwidth bus detected. Enabling jpeg compression\n")
+		jpeg = 1;
+	}
+
 	return 0;
 
 free_dev:
-- 
1.6.1

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to