ADLINK Technology RTV Series User Manual page 172

Multi-channel real-time video frame grabber series
Table of Contents

Advertisement

Read frame
Read frame image when an image was ready and prepare next
frame.
Int read_frame (void)
{
struct v4l2_buffer buf;
memset (&buf, 0, sizeof (buf));
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
/* read frame */
if (-1 == ioctl (fd, VIDIOC_DQBUF, &buf)) {
}
/* prepare next frame */
if (-1 == ioctl (fd, VIDIOC_QBUF, &buf))
return 0;
}
162
switch (errno) {
case EAGAIN:
return 0;
case EIO:
/* Could ignore EIO, see spec. */
/* fall through */
default:
exit (EXIT_FAILURE);
}
exit (EXIT_FAILURE);
Programming Guide

Advertisement

Table of Contents
loading

Table of Contents