v4l2-select — Synchronous I/O multiplexing
#include <sys/time.h> #include <sys/types.h> #include <unistd.h>
With the
select() function applications
can suspend execution until the driver has captured data or is ready
to accept data for output.
When streaming I/O has been negotiated this function waits
until a buffer has been filled or displayed and can be dequeued with
the
VIDIOC_DQBUF ioctl. When buffers are already in the outgoing
queue of the driver the function returns immediately.
On success
select() returns the total
number of bits set]
When use of the
read() function has
been negotiated and the driver does not capture yet, the
select() function starts capturing. When that
fails,
select() returns successful and a
subsequent
read() call, which also attempts to
start capturing, will return an appropriate error code. When the
driver captures continuously (as opposed to, for example, still
images) and data is already available the
select() function returns immediately.
When use of the
write() function has
been negotiated the
select() function just waits
until the driver is ready for a non-blocking
write() call.
All drivers implementing the
read() or
write() function or streaming I/O must also
support the
select() function.
For more details see the.