Re: [PATCH 1/2] usb: gadget/uvc: remove connect/disconnect calls on open/release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Peter,

On Monday 06 May 2013 10:35:25 Peter Chen wrote:
> On Sun, May 5, 2013 at 2:22 AM, Bhupesh SHARMA wrote:

[snip]

> > The whole point of having a user-space application governing the behavior
> > of UVC webcam gadget as per commands from a UVC host is to plug the same
> > with a real video capture source driver to provide the video frames
> > captured from say a camera sensor and route the UVC specific control
> > requests to a real video capture device by converting the same to
> > equivalent V4L2 commands.
> > 
> > Let's take an example. Let's say you have a camera sensor that supports
> > capture in two modes:
> > 
> > 1. 640*480, YUV422 (default mode)
> > 2. 640*480, JPEG
> > 
> > Lets say the UVC webcam gadget suggest to the host that it supports
> > 640*480, YUV422 output by default (to be in sync with the characteristics
> > of the actual capture source).
> > 
> > Now on the Host, some user tries to open the UVC webcam appearing to him
> > as one /dev/videoX node using the CHEESE application, and he
> > tries to capture frames in MJPEG format as it is also supported by the UVC
> > webcam, no before streaming frames this control command should be routed
> > as a V4L2_S_FMT(640*480, JPEG) command to the V4L2 video capture driver.
> > This is where the user-space application comes into picture.
> > 
> > Also note that the format is selected from the Host side before the
> > streaming is started. So, you should not connect to the UDC, unless you
> > have the user-space application up and running and is present to pass
> > relevant UVC commands (after converting them to equivalent V4L2 commands)
> > to the video capture driver.
> 
> I am curious is it possible the above two things done by kernel layer eg,
> usb camera driver layer.

It might be possible, but would be pretty complex and hackish, as the V4L2 
subsystem hasn't been designed with access from kernelspace in mind. Moreover, 
capturing directly from a V4L2 device will not cover all use cases. You might 
want to build a UVC device that processes data before streaming it, or that 
even generates data in software. All this needs to be done in userspace.

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux