Re: streaming capture semantics

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



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ä
syrjala@xxxxxx
http://www.sci.fi/~syrjala/





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux