Hi Vivek,

On Friday 24 July 2009 16:42:15 Vivek Bardia wrote:
> On Sat, Jul 11, 2009 at 3:44 AM, Laurent Pinchart wrote:
> > On Thursday 09 July 2009 09:19:39 Vivek Bardia wrote:

[snip]

> > > Meanwhile I am also trying to add support for MPEG2 - TS, Here are the
> > > few places which I thought would require update in the UVC driver code
> > >
> > > a.) uvc_driver.c - Format parsing support for Stream based payloads,
> > > MPEG2-TS payload
> >
> > That should be easy. You will have to modify the uvc_format structure to
> > add MPEG2-TS specific fields (rearrange the existing fields using unions
> > like in uvc_entity).
> >
> > As stream-based formats don't have frame descriptors, you will also have
> > to walk through the driver and modify code that assumes each format has
> > at least one frame descriptor. You could work around that by creating a
> > dummy frame descriptor, like for the DV format, but I think it's now time
> > to get rid of the "at least one frame per format" requirement.
>
> I have added simple parsing support for MPEG2-TS format and works fine
> with the device as of now. I have created a dummy frame for now.
>
> > > b.) uvc_video.c - parameters negotiation, VS Interface Control
> > > Selectors support.
> >
> > VS controls (I suppose you're talking about the "generate key frame" and
> > "update frame segment" controls) should be easy to support. They might
> > require new V4L2 controls though. Parameters negotiation will be handled
> > through V4L2 controls, so that might require a rework of the current
> > control handling code.
>
> Not Supported by the device as of now.
>
> > > c.) video streaming code to handle MaxVideoFrameSize, BmFramingInfo ?
> > > this is the part I am bit jittery about.
> >
> > I don't think that will be too difficult. Or maybe I don't see the
> > difficulty yet :-)
>
> With respect to the handling of dwMaxVideoFrameSize, According to the
> UVC 1.1 specifications this field can be ignored if bmFramingInfo bits
> is not enabled. This is for a MPG2-TS stream.
>
> But then in this case, the device returns dwMaxVideoFrameSize,
> dwMaxPayloadTransferSize to be 0. uvc_alloc_buffers call in VIDIOC_REQBUFS
> ioctl and uvc_alloc_urb_buffers call in uvc_init_video_isoc will always fail
> as dwMaxVideoFrameSize will be 0.

Right, that's a problem. In that case the uvcvideo driver should decide on an 
appropriate buffer size. Too small buffers will result in high CPU usage, and 
too big buffers will result in higher latency before MPEG2-TS data reach 
userspace. In your experience, how could/should that buffer size be computed ?

> In case I give it a hard-coded value for both, the DQBUF happens only
> once and then select function blocks on the file descriptor. I am
> using the V4L2 video capture example(
> http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.
>html ).
>
> Could you guide us on how to proceed from this point.

Could you please send me the output of lsusb -v for your device (using 
usbutils 0.72 or newer, 0.73+ preferred) and send me a patch for the MPEG2-TS 
descriptors parsing ? I will then review the patch and have a look at what the 
next step should be.

Best regards,

Laurent Pinchart

_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to