Sophie

Sophie

distrib > CentOS > 6 > i386 > by-pkgid > cf93d8a8acdcc6fe2225039da0502495 > files > 2627

kernel-doc-2.6.32-131.17.1.el6.centos.plus.noarch.rpm

<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>Video Inputs and Outputs</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API" /><link rel="up" href="ch01.html" title="Chapter&#160;1.&#160;Common API Elements" /><link rel="prev" href="ch01s03.html" title="Application Priority" /><link rel="next" href="ch01s05.html" title="Audio Inputs and Outputs" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Video Inputs and Outputs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s03.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;1.&#160;Common API Elements</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch01s05.html">Next</a></td></tr></table><hr /></div><div class="section" title="Video Inputs and Outputs"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="video"></a>Video Inputs and Outputs</h2></div></div></div><p>Video inputs and outputs are physical connectors of a
device. These can be for example RF connectors (antenna/cable), CVBS
a.k.a. Composite Video, S-Video or RGB connectors. Only video and VBI
capture devices have inputs, output devices have outputs, at least one
each. Radio devices have no video inputs or outputs.</p><p>To learn about the number and attributes of the
available inputs and outputs applications can enumerate them with the
<a class="link" href="re31.html" title="ioctl VIDIOC_ENUMINPUT"><code class="constant">VIDIOC_ENUMINPUT</code></a> and <a class="link" href="re32.html" title="ioctl VIDIOC_ENUMOUTPUT"><code class="constant">VIDIOC_ENUMOUTPUT</code></a> ioctl, respectively. The
struct&#160;<a class="link" href="re31.html#v4l2-input" title="Table&#160;A.22.&#160;struct v4l2_input">v4l2_input</a> returned by the <code class="constant">VIDIOC_ENUMINPUT</code>
ioctl also contains signal status information applicable when the
current video input is queried.</p><p>The <a class="link" href="re43.html" title="ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT"><code class="constant">VIDIOC_G_INPUT</code></a> and <a class="link" href="re46.html" title="ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT"><code class="constant">VIDIOC_G_OUTPUT</code></a> ioctl return the
index of the current video input or output. To select a different
input or output applications call the <a class="link" href="re43.html" title="ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT"><code class="constant">VIDIOC_S_INPUT</code></a> and
<a class="link" href="re46.html" title="ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT"><code class="constant">VIDIOC_S_OUTPUT</code></a> ioctl. Drivers must implement all the input ioctls
when the device has one or more inputs, all the output ioctls when the
device has one or more outputs.</p><div class="example"><a id="id2767399"></a><p class="title"><b>Example&#160;1.1.&#160;Information about the current video input</b></p><div class="example-contents"><pre class="programlisting">
struct&#160;<a class="link" href="re31.html#v4l2-input" title="Table&#160;A.22.&#160;struct v4l2_input">v4l2_input</a> input;
int index;

if (-1 == ioctl (fd, <a class="link" href="re43.html" title="ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT"><code class="constant">VIDIOC_G_INPUT</code></a>, &amp;index)) {
	perror ("VIDIOC_G_INPUT");
	exit (EXIT_FAILURE);
}

memset (&amp;input, 0, sizeof (input));
input.index = index;

if (-1 == ioctl (fd, <a class="link" href="re31.html" title="ioctl VIDIOC_ENUMINPUT"><code class="constant">VIDIOC_ENUMINPUT</code></a>, &amp;input)) {
	perror ("VIDIOC_ENUMINPUT");
	exit (EXIT_FAILURE);
}

printf ("Current input: %s\n", input.name);
      </pre></div></div><br class="example-break" /><div class="example"><a id="id2767466"></a><p class="title"><b>Example&#160;1.2.&#160;Switching to the first video input</b></p><div class="example-contents"><pre class="programlisting">
int index;

index = 0;

if (-1 == ioctl (fd, <a class="link" href="re43.html" title="ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT"><code class="constant">VIDIOC_S_INPUT</code></a>, &amp;index)) {
	perror ("VIDIOC_S_INPUT");
	exit (EXIT_FAILURE);
}
      </pre></div></div><br class="example-break" /></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01s03.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch01.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch01s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Application Priority&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Audio Inputs and Outputs</td></tr></table></div></body></html>