ADLINK Technology RTV Series User Manual page 167

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

Advertisement

Close device
Close the device with close () if you no longer use this device.
Close ( fd);
IO control
IO control is a technology communication with driver. V4L sets up
many standard IO controls which control video parameters to or
get information from driver. Here we give you an example of sim-
ple settings.
void init_device (void)
{
struct v4l2_capability cap;
struct v4l2_cropcap cropcap;
struct v4l2_crop crop;
struct v4l2_format fmt
v4l2_std_id
if (-1 == ioctl (fd, VIDIOC_QUERYCAP, &cap))
{
}
if (!(cap.capabilities &
}
if (!(cap.capabilities &
}
/* Select video input, video standard and
tune here. */
if (-1 == ioctl (fd, VIDIOC_S_STD, &std)) {
Programming Guide
std
if (EINVAL == errno) {
fprintf (stderr, "%s is no V4L2
device\n", dev_name);
exit (EXIT_FAILURE);
} else {
exit (EXIT_FAILURE);
}
V4L2_CAP_VIDEO_CAPTURE)) {
fprintf (stderr, "%s is no video
capture device\n", dev_name);
exit (EXIT_FAILURE);
V4L2_CAP_STREAMING)) {
fprintf (stderr, "%s does not support
streaming i/o\n", dev_name);
exit (EXIT_FAILURE);
= V4L2_STD_NTSC_M;
157

Advertisement

Table of Contents
loading

Table of Contents