Hi Hans, On Sunday 14 February 2010 15:26:09 Hans Verkuil wrote: > On Sunday 14 February 2010 14:41:29 Mauro Carvalho Chehab wrote: > > Hans Verkuil wrote: > > > Hi all, > > > > > > I've been investigating some problems with my qv4l2 utility and I > > > encountered some inconsistencies in the streaming I/O documentation > > > and the videobuf implementation. > > > > > > I would like to know which is correct. [snip] > > > 2) The VIDIOC_REQBUFS documentation states that it should be possible > > > to use a count of 0, in which case it should do an implicit STREAMOFF. > > > This is currently not implemented. I have included a patch for this > > > below and if there are no issues with it, then I'll make a pull > > > request for this. > > > > This can eventually break some application. I think it is safer to fix > > the specs. > > I don't really see how this would break an application and I think that > some drivers that do not use videobuf already support this. The reason why > I think this is a good idea to support it is that this makes it very easy > to check which streaming mode is supported without actually allocating > anything. > > I was actually using this in qv4l2 with uvc until I tried it with the mxb > driver and discovered that videobuf didn't support it. I am definitely in > favor of fixing the code instead of the spec in this case. Using a count of 0 to free buffers definitely needs to be supported, so videobuf must be fixed. However, I don't think VIDIOC_REQBUFS should issue an implicit VIDIOC_STREAMOFF. It should instead return -EBUSY if streaming is in progress, or if buffers are still mapped in the userspace memory space. Performing implicit actions make drivers more complex and error prone. I don't see any harm in requiring userspace to call VIDIOC_STREAMOFF before freeing buffers. -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html