Specifications

๎‚„ Set the channel of video device
The VIDIOCGCHAN ioctl allows a user to ask about video channels.
The M318B has a single camera input. The corresponding VIDIOCSCHAN
ioctl allows a user to change channel and to request the norm is changed -
for example to switch between a PAL or an NTSC format camera.
The following C code shows the usage of VIDIOCGCHAN and
IDIOCSCHAN. the VIDIOCGCHAN ioctl was call fist to get the videochan
structure then using the IDIOCSCHAN ioctl to set the video channel.
if (ioctl (fd, VIDIOCGCHAN, &videochan) == -1) {
printf ("Hmm did not support Video_channel\n");
isVideoChannel = 0;
}
videochan.norm = VIDEO_MODE_NTSC;
if (ioctl (fd, VIDIOCSCHAN, &videochan) == -1) {
printf ("ERROR setting norme \n");
exit (1);
}
The fields of video channel structure are:
channel The channel number we are selecting
name The name for this channel. This is intended to describe the port to the user
Appropriate names are therefore things like "Camera" "SCART input"
flags Channel properties
type Input type
norm The current television encoding being used if relevant for this channel.
Table 2. video_channel Structure Fields
๎‚„ Reading images loop
The reading images has two methods as using โ€˜readโ€™ system call and the
mmap interface, however the mmap interface is faster and it supports the
M318B camera, so the mmap was used for reading images in this thesis.
To use the mmap interface a user must sets the VIDIOCGMBUF ioctl
which reports the size of buffer to mmap and the offset within the buffer for
each frame. The number of frames supported is device dependent and may
only be one, but the M318B has four frames.
The following C code shows the usages of VIDIOCGMBUF ioctl and
mmap.
37