Ronald Bultje wrote: > Hello, > > I'm having two uncertainties about video4linux2. > > 1) About how to use VIDIOC_DQBUF. From the v4l2 site: > "VIDIOC_DQBUF immediately returns an error if there is no buffer > ready (it never blocks)." > However, when I look in bttc-driver.c, the ioctl handler (VIDIOC_DQBUF): > "retval = videobuf_waiton(&buf->vb,0,1);" > Which (I'd say) does block for the frame to be completed capturing. Yes, it does. I'd say you have found a bug. It is trivial to fix throught: Just change that to "videobuf_waiton(&buf->vb,1,1)". > Am I wrong here? Or is the v4l2 API documentation > (http://thedirks.org/v4l2/) outdated and has this been changed? Hasn't changed. But while looking at it: Maybe we should make the block / nonblock behaviour depend on the file flags? i.e. don't block if O_NONBLOCK is set, and block otherwise, thus give DQBUF the same semantics read() has. Comments? > 2) Would it be possible (i.e. allowed) to include a special case > VIDIOC_QBUF with index = -1 in the zoran driver which means to dequeue > (as in 'cancel these queues', not as in 'sync on all buffers') all > buffers and thus effectively stop capturing directly? This is what the > zoran driver is able to do in v4l1 and it'd be nice to have a similar > feature in v4l2. Is this allowed? Just do STREAMOFF to stop capture. Gerd -- #include </dev/tty>