The patch should also change usb_sn9c20x_init to aloow a value of 0, 1
and 2, as well as make it default to 2 instead of 1 if you use another
value then those 3

On Wed, Jan 14, 2009 at 5:17 PM, GWater <[email protected]> wrote:
> Hans de Goede schrieb:
>>
>> GWater wrote:
>>>
>>> Vasily Khoruzhick schrieb:
>>>>
>>>> On 11 January 2009 23:44:38 GWater wrote:
>>>>>
>>>>> Vasily Khoruzhick schrieb:
>>>>>>
>>>>>> 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 :)
>>>>>
>>>>> I thought about that, too.
>>>>>
>>>>> However I got to the conlcusion that this way people with LOW- and
>>>>> FULL-
>>>>> speed devices can't disable JPEG.
>>>>>
>>>>> My patch however does still allow everyone to choose:
>>>>> LOW- and FULL-speed users can choose anyway and HIGH-speed users can
>>>>> use
>>>>> the "bandwidth" setting to work around the forced non-JPEG output. And
>>>>> a
>>>>> bandwidth (alternate-)setting of 7 should still offer enough speed for
>>>>> JPEG.
>>>>>
>>>>> Please consider this.
>>>>>
>>>>> GWater
>>>>
>>>> On usb-1 bus you can't use any format except jpeg :) So users has no
>>>> choice if they use sn9c20x cam on usb-1 :)
>>>
>>> Still,
>>> there is the possibility of USB_SPEED_VARIABLE and USB_SPEED_UNKOWN.
>>>
>>> What about these poor users?
>>>
>>
>> Why not just make the jpeg flag an int, set it to -1 by default and make
>> the speed check:
>>
>> if (jpeg == -1) {
>>        if (dev->udev->speed == USB_SPEED_HIGH && bandwidth == 8)
>>                jpeg = 0;
>>        else
>>                jpeg = 1;
>> }
>>
>> Then default jpeg will depend on speed, and the user can force it either
>> way.
>>
>> Regards,
>>
>> Hans
>>
>> >>
>
> To finish this discussion here is a patch which should implement the above
> idea.
>
> GWater
>
> From cff8bbce8d6380e4f2f54f5fdadc977ad4f915c1 Mon Sep 17 00:00:00 2001
> From: GWater <[email protected]>
> Date: Wed, 14 Jan 2009 23:16:15 +0100
> Subject: [PATCH] Disable JPEG for high-speed USB 2.0 by default
>
> Signed-off-by: GWater <[email protected]>
> ---
>  sn9c20x-usb.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/sn9c20x-usb.c b/sn9c20x-usb.c
> index f001016..62fcdb9 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;
> +__u8 jpeg = 2;
>
>  /**
>  * @var bandwidth
> @@ -827,6 +827,13 @@ static int usb_sn9c20x_probe(struct usb_interface
> *interface, const struct usb_d
>
>        usb_sn9c20x_default_settings(dev);
>
> +       if (jpeg == 2) {
> +               if (dev->udev->speed == USB_SPEED_HIGH && bandwidth == 8)
> +                       jpeg = 0;
> +               else
> +                       jpeg = 1;
> +       }
> +
>        return 0;
>
>  free_dev:
> --
> 1.6.0.6
>
>
>

--~--~---------~--~----~------------~-------~--~----~
Lets make microdia webcams plug'n play, (currently plug'n pray)
To post to this group, send email to [email protected]
Visit us online https://groups.google.com/group/microdia
-~----------~----~----~----~------~----~------~--~---

Reply via email to