Hi Jean-Philippe,

On Tuesday 08 February 2011 16:13:56 jean-philippe francois wrote:
> Hi,
> 
> With the current uvc code, class specific setup request are redirected
> to userspace.
> However, in order to decode these request, userspace needs some
> information, that are currently available in the gadget descriptor. Which
> is kernel code.
> 
> Let's take an example request :
> 
> bRequestType = 0xa1
> bRequest = 0x87 (UVC_GET_DEF)
> wValue = 0x200;
> wIndex = 0x200;
> wLength = 2;
> 
> wIndex is (UnitId | Interface)
> 
> Interface = 0 means control interface.
> Now, to translate wValue into a CS (Control Selector Code), I need to map
> UnitId to an entity type.
> 
> To do this, I can look in the driver/usb/gadget/webcam.c file, and
> find the answer :
>  UnitID = 2 means processing unit.
> 
> I can (and will) hardcode this mapping (UnitId = 2  <=> Processing Unit) in
> my userspace setup request handling code.
> 
> But then I make a camera with two input unit, a selector unit,
> and my userspace code is broken :(
> 
> What's the plan for future enhancement of this code ?

webcam.c is sample code only. For real-world applications you're supposed to 
write your own gadget driver than instanciates a UVC function, and develop a 
userspace application (which can be based on uvc-gadget - note the GPL license 
though) that matches your driver.

There's currently no plan to export the descriptors to the application. Do you 
think that would be useful ?

-- 
Regards,

Laurent Pinchart
_______________________________________________
Linux-uvc-devel mailing list
Linux-uvc-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to