On Fri, Jul 05, 2002 at 03:40:29PM -0400, Bilal Khan wrote:
>
> How does streaming video capture work?
>
> I ask the video device for 8 buffers using ioctl:VIDIOC_REQBUFS
> then query for the addresses using ioctl:VIDIOC_QUERYBUF
> and then mmap the addresses to say, data[0] - data[7] and
> finally, use ioctl:VIDIOC_QBUF and ioctl:VIDIOC_STREAMON
> to start the streaming capture.
>
> Now the buffers start rolling in.
>
> If I just render data[0], then it (looks like) I am rendering
> every 8th frame. Should I:
Well according to the docs you should:
// enqueue the buffers
for (i = 0 ; i < buffers;i++)
ioctl(VIDIOC_QBUF, i);
ioctl(VIDIOC_STREAMON);
i = 0;
while (1) {
select(); // wait for a buffer to be filled
ioctl(VIDIOC_DQBUF, i); // dequeue the buffer, now the driver won't
write to this buffer.
copy stuff out of the buffer.
ioctl(VIDIOC_QBUF, i); // enqueu the buffer
i++;
}
--
Ville Syrj�l�
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/
_______________________________________________
Video4linux-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/video4linux-list