Hi, On Thursday 19 July 2007 09:44, Philip Heron wrote: > Hi Luca, > > Luca Risolia wrote: > >> You should not assume that a read() call will read a whole > >> buffer at once. > > > > This is not correct. One read() should provide one frame exactly, In > > facts, the V4L2 API states: > > > > "read() attempts to read up to count bytes from file descriptor fd into > > the buffer starting at buf. [...] Regardless of the count value each > > read() call will provide at most one frame (two fields) worth of data. > > What I think this means is that the driver should return either count > bytes or a full frames worth - whichever is smaller. Any value smaller > again should also be valid. > > > [...] > > read() never returns a "snapshot" of a buffer being filled. Using a > > single buffer the driver will stop capturing when the application starts > > reading the buffer until the read is finished. [...]" > > This means that a frame is guaranteed not to be overwritten by another > frame as it's being read, so an application can take as long as it needs > reading it.
Thanks Phil, that's what I was about to say :-) The V4L2 API doesn't force applications to read() a while buffer at once. Regards, Laurent Pinchart _______________________________________________ Linux-uvc-devel mailing list Linux-uvc-devel@lists.berlios.de https://lists.berlios.de/mailman/listinfo/linux-uvc-devel