Start capturing
void start_capturing (void)
{
unsigned int i;
enum v4l2_buf_type type;
for (i = 0; i < n_buffers; ++i) {
}
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (-1 == ioctl (fd, VIDIOC_STREAMON,
}
Stop capturing
Void stop_capturing (void)
{
enum v4l2_buf_type type;
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (-1 == ioctl (fd, VIDIOC_STREAMOFF,
}
Programming Guide
struct v4l2_buffer buf;
memset (&buf, 0, sizeof (buf));
buf.type
=
V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
buf.index = i;
if (-1 == ioctl (fd, VIDIOC_QBUF,
&buf))
exit (EXIT_FAILURE);
&type))
exit (EXIT_FAILURE);
&type));
161