156
Programming
Guide
6.3 Linux Programming Guide
Introduction
Video4 Linux or V4L is intended to provide a standard video cap-
ture application programming interface on Linux. V4L is in its sec-
ond version. V4L2 driver include a compatibility mode for V4L1
application that is V4L application can mix the two modes of V4L1
and V4L2.
A complete documentation on V4L application programming can
be found at:
http:// www.linuxtv.org/downloads/video4linux/API/V4L2_API/
The document gives a very detailed description of all APIs. Famil-
iar with it will great help you in writing your video capturing applica-
tion.
A simple sample
In this chapter, we provide a simple sample as how to program
RTV cards.
Open device
The first step is to open a RTV device with open (). The first
parameter in it is device name which can be listed under directory
/dev with a prefix name ‘video’ and a number appending to it.
There will be same number of such files as how many devices
your system has.
static char dev_name[] = “/dev/video0”;// Open
the first device
int open_device (void)
{
int fd;
fd = open (dev_name, O_RDWR | O_NONBLOCK,
0);
if (-1 == fd) {
fprintf (stderr, "Cannot open '%s':
%d, %s\n", dev_name, errno,
strerror (errno));
return -1;// Failed
}
return fd;// Success
}
Summary of Contents for cRTV-24
Page 4: ......
Page 8: ...List of Tables iv Table 5 2 C C Data Types 83 Table 5 3 Pixel Data 122 ...
Page 10: ......
Page 18: ...8 Introduction ...
Page 34: ...24 Hardware Reference Figure 2 8 STRG Address Jumpers ...
Page 55: ...Installation Guide 45 Figure 3 2 cRTV 24 3U cPCI ...
Page 61: ...Installation Guide 51 ...
Page 62: ...52 Installation Guide ...
Page 64: ...54 Installation Guide The Device Manager should be as follows ...
Page 67: ...Installation Guide 57 ...
Page 68: ...58 Installation Guide 3 When the following window appears please click Con tinue Anyway ...
Page 70: ...60 Installation Guide The Device Manager should be as follows ...
Page 72: ...62 Installation Guide 3 Click the Finish button to finish the installation ...
Page 76: ...66 Installation Guide ...
Page 144: ...134 Function Library ...
Page 174: ...164 Programming Guide ...