Re: Device or resource busy

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



Hello!

On Sat, Aug 02, 2003 at 02:05:07PM +0100, Matt Brocklehurst wrote:
> Hi,
>       Yes im doing streaming (well attempting to!!!), the streamon /
> dqbuf - are those v4l 2 commands? Cos im using v4l one atm...

In v4l1 it is similar. Look at the
/usr/src/linux-2.4.21/Documentation/videdo4linux/API.html

Little snippet from there:
----------------------------------------------------
/* setup everything */
VIDIOCMCAPTURE(0)
while (whatever) {
   VIDIOCMCAPTURE(1)
   VIDIOCSYNC(0)
   /* process frame 0 while the hardware captures frame 1 */
   VIDIOCMCAPTURE(0)
   VIDIOCSYNC(1)
   /* process frame 1 while the hardware captures frame 0 */
}
----------------------------------------------------

Of course, you can use more then two buffers:

for (i = 0; i < n; i++) {
  VIDIOCMCAPTURE(i);
}
i=0; while (...) {
  VIDIOCSYNC(i);
  Do what you want with i-th buffer
  VIDIOCMCAPTURE(i);
  i++; if (i >= n) i = 0;
}


-- 
Andrey Vasilyev




[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