提交 1c656c87 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

[media] DocBook media: Cleanup some sections at common.xml

Updates sections "Querying Capabilities", "Application Priority",
"Video Inputs and Outputs" and "Audio Inputs and Outputs".
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
上级 1b962087
......@@ -240,15 +240,15 @@ methods</link> supported by the device.</para>
<para>Starting with kernel version 3.1, VIDIOC-QUERYCAP will return the
V4L2 API version used by the driver, with generally matches the Kernel version.
There's no need of using &VIDIOC-QUERYCAP; to check if an specific ioctl is
supported, the V4L2 core now returns ENOIOCTLCMD if a driver doesn't provide
There's no need of using &VIDIOC-QUERYCAP; to check if a specific ioctl is
supported, the V4L2 core now returns ENOTTY if a driver doesn't provide
support for an ioctl.</para>
<para>Other features can be queried
by calling the respective ioctl, for example &VIDIOC-ENUMINPUT;
to learn about the number, types and names of video connectors on the
device. Although abstraction is a major objective of this API, the
ioctl also allows driver specific applications to reliable identify
&VIDIOC-QUERYCAP; ioctl also allows driver specific applications to reliably identify
the driver.</para>
<para>All V4L2 drivers must support
......@@ -278,9 +278,7 @@ Applications requiring a different priority will usually call
the &VIDIOC-QUERYCAP; ioctl.</para>
<para>Ioctls changing driver properties, such as &VIDIOC-S-INPUT;,
return an &EBUSY; after another application obtained higher priority.
An event mechanism to notify applications about asynchronous property
changes has been proposed but not added yet.</para>
return an &EBUSY; after another application obtained higher priority.</para>
</section>
<section id="video">
......@@ -288,9 +286,9 @@ changes has been proposed but not added yet.</para>
<para>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.</para>
a.k.a. Composite Video, S-Video or RGB connectors. Video and VBI
capture devices have inputs. Video and VBI output devices have outputs,
at least one each. Radio devices have no video inputs or outputs.</para>
<para>To learn about the number and attributes of the
available inputs and outputs applications can enumerate them with the
......@@ -299,30 +297,13 @@ available inputs and outputs applications can enumerate them with the
ioctl also contains signal status information applicable when the
current video input is queried.</para>
<para>The &VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; ioctl return the
<para>The &VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; ioctls return the
index of the current video input or output. To select a different
input or output applications call the &VIDIOC-S-INPUT; and
&VIDIOC-S-OUTPUT; ioctl. Drivers must implement all the input ioctls
&VIDIOC-S-OUTPUT; ioctls. 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.</para>
<!--
<figure id=io-tree>
<title>Input and output enumeration is the root of most device properties.</title>
<mediaobject>
<imageobject>
<imagedata fileref="links.pdf" format="ps" />
</imageobject>
<imageobject>
<imagedata fileref="links.gif" format="gif" />
</imageobject>
<textobject>
<phrase>Links between various device property structures.</phrase>
</textobject>
</mediaobject>
</figure>
-->
<example>
<title>Information about the current video input</title>
......@@ -330,20 +311,20 @@ device has one or more outputs.</para>
&v4l2-input; input;
int index;
if (-1 == ioctl (fd, &VIDIOC-G-INPUT;, &amp;index)) {
perror ("VIDIOC_G_INPUT");
exit (EXIT_FAILURE);
if (-1 == ioctl(fd, &VIDIOC-G-INPUT;, &amp;index)) {
perror("VIDIOC_G_INPUT");
exit(EXIT_FAILURE);
}
memset (&amp;input, 0, sizeof (input));
memset(&amp;input, 0, sizeof(input));
input.index = index;
if (-1 == ioctl (fd, &VIDIOC-ENUMINPUT;, &amp;input)) {
perror ("VIDIOC_ENUMINPUT");
exit (EXIT_FAILURE);
if (-1 == ioctl(fd, &VIDIOC-ENUMINPUT;, &amp;input)) {
perror("VIDIOC_ENUMINPUT");
exit(EXIT_FAILURE);
}
printf ("Current input: %s\n", input.name);
printf("Current input: %s\n", input.name);
</programlisting>
</example>
......@@ -355,9 +336,9 @@ int index;
index = 0;
if (-1 == ioctl (fd, &VIDIOC-S-INPUT;, &amp;index)) {
perror ("VIDIOC_S_INPUT");
exit (EXIT_FAILURE);
if (-1 == ioctl(fd, &VIDIOC-S-INPUT;, &amp;index)) {
perror("VIDIOC_S_INPUT");
exit(EXIT_FAILURE);
}
</programlisting>
</example>
......@@ -397,7 +378,7 @@ available inputs and outputs applications can enumerate them with the
also contains signal status information applicable when the current
audio input is queried.</para>
<para>The &VIDIOC-G-AUDIO; and &VIDIOC-G-AUDOUT; ioctl report
<para>The &VIDIOC-G-AUDIO; and &VIDIOC-G-AUDOUT; ioctls report
the current audio input and output, respectively. Note that, unlike
&VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; these ioctls return a structure
as <constant>VIDIOC_ENUMAUDIO</constant> and
......@@ -408,11 +389,11 @@ applications call the &VIDIOC-S-AUDIO; ioctl. To select an audio
output (which presently has no changeable properties) applications
call the &VIDIOC-S-AUDOUT; ioctl.</para>
<para>Drivers must implement all input ioctls when the device
has one or more inputs, all output ioctls when the device has one
or more outputs. When the device has any audio inputs or outputs the
driver must set the <constant>V4L2_CAP_AUDIO</constant> flag in the
&v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl.</para>
<para>Drivers must implement all audio input ioctls when the device
has multiple selectable audio inputs, all audio output ioctls when the
device has multiple selectable audio outputs. When the device has any
audio inputs or outputs the driver must set the <constant>V4L2_CAP_AUDIO</constant>
flag in the &v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl.</para>
<example>
<title>Information about the current audio input</title>
......@@ -420,14 +401,14 @@ driver must set the <constant>V4L2_CAP_AUDIO</constant> flag in the
<programlisting>
&v4l2-audio; audio;
memset (&amp;audio, 0, sizeof (audio));
memset(&amp;audio, 0, sizeof(audio));
if (-1 == ioctl (fd, &VIDIOC-G-AUDIO;, &amp;audio)) {
perror ("VIDIOC_G_AUDIO");
exit (EXIT_FAILURE);
if (-1 == ioctl(fd, &VIDIOC-G-AUDIO;, &amp;audio)) {
perror("VIDIOC_G_AUDIO");
exit(EXIT_FAILURE);
}
printf ("Current input: %s\n", audio.name);
printf("Current input: %s\n", audio.name);
</programlisting>
</example>
......@@ -437,13 +418,13 @@ printf ("Current input: %s\n", audio.name);
<programlisting>
&v4l2-audio; audio;
memset (&amp;audio, 0, sizeof (audio)); /* clear audio.mode, audio.reserved */
memset(&amp;audio, 0, sizeof(audio)); /* clear audio.mode, audio.reserved */
audio.index = 0;
if (-1 == ioctl (fd, &VIDIOC-S-AUDIO;, &amp;audio)) {
perror ("VIDIOC_S_AUDIO");
exit (EXIT_FAILURE);
if (-1 == ioctl(fd, &VIDIOC-S-AUDIO;, &amp;audio)) {
perror("VIDIOC_S_AUDIO");
exit(EXIT_FAILURE);
}
</programlisting>
</example>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册