aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-01-07 06:17:35 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-02-04 07:24:16 -0500
commit1c656c87ac3f7a602cfa9b39b6cb955b27f2f0b0 (patch)
treee74d25a02e7f6c904d765faabed82e811e8828a7 /Documentation/DocBook
parent1b962087a792556f67191b88a2f80bf949175e54 (diff)
[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: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'Documentation/DocBook')
-rw-r--r--Documentation/DocBook/media/v4l/common.xml89
1 files changed, 35 insertions, 54 deletions
diff --git a/Documentation/DocBook/media/v4l/common.xml b/Documentation/DocBook/media/v4l/common.xml
index 1ddf354aa997..5a97935e75a1 100644
--- a/Documentation/DocBook/media/v4l/common.xml
+++ b/Documentation/DocBook/media/v4l/common.xml
@@ -240,15 +240,15 @@ methods</link> supported by the device.</para>
240 240
241 <para>Starting with kernel version 3.1, VIDIOC-QUERYCAP will return the 241 <para>Starting with kernel version 3.1, VIDIOC-QUERYCAP will return the
242V4L2 API version used by the driver, with generally matches the Kernel version. 242V4L2 API version used by the driver, with generally matches the Kernel version.
243There's no need of using &VIDIOC-QUERYCAP; to check if an specific ioctl is 243There's no need of using &VIDIOC-QUERYCAP; to check if a specific ioctl is
244supported, the V4L2 core now returns ENOIOCTLCMD if a driver doesn't provide 244supported, the V4L2 core now returns ENOTTY if a driver doesn't provide
245support for an ioctl.</para> 245support for an ioctl.</para>
246 246
247 <para>Other features can be queried 247 <para>Other features can be queried
248by calling the respective ioctl, for example &VIDIOC-ENUMINPUT; 248by calling the respective ioctl, for example &VIDIOC-ENUMINPUT;
249to learn about the number, types and names of video connectors on the 249to learn about the number, types and names of video connectors on the
250device. Although abstraction is a major objective of this API, the 250device. Although abstraction is a major objective of this API, the
251ioctl also allows driver specific applications to reliable identify 251&VIDIOC-QUERYCAP; ioctl also allows driver specific applications to reliably identify
252the driver.</para> 252the driver.</para>
253 253
254 <para>All V4L2 drivers must support 254 <para>All V4L2 drivers must support
@@ -278,9 +278,7 @@ Applications requiring a different priority will usually call
278the &VIDIOC-QUERYCAP; ioctl.</para> 278the &VIDIOC-QUERYCAP; ioctl.</para>
279 279
280 <para>Ioctls changing driver properties, such as &VIDIOC-S-INPUT;, 280 <para>Ioctls changing driver properties, such as &VIDIOC-S-INPUT;,
281return an &EBUSY; after another application obtained higher priority. 281return an &EBUSY; after another application obtained higher priority.</para>
282An event mechanism to notify applications about asynchronous property
283changes has been proposed but not added yet.</para>
284 </section> 282 </section>
285 283
286 <section id="video"> 284 <section id="video">
@@ -288,9 +286,9 @@ changes has been proposed but not added yet.</para>
288 286
289 <para>Video inputs and outputs are physical connectors of a 287 <para>Video inputs and outputs are physical connectors of a
290device. These can be for example RF connectors (antenna/cable), CVBS 288device. These can be for example RF connectors (antenna/cable), CVBS
291a.k.a. Composite Video, S-Video or RGB connectors. Only video and VBI 289a.k.a. Composite Video, S-Video or RGB connectors. Video and VBI
292capture devices have inputs, output devices have outputs, at least one 290capture devices have inputs. Video and VBI output devices have outputs,
293each. Radio devices have no video inputs or outputs.</para> 291at least one each. Radio devices have no video inputs or outputs.</para>
294 292
295 <para>To learn about the number and attributes of the 293 <para>To learn about the number and attributes of the
296available inputs and outputs applications can enumerate them with the 294available inputs and outputs applications can enumerate them with the
@@ -299,30 +297,13 @@ available inputs and outputs applications can enumerate them with the
299ioctl also contains signal status information applicable when the 297ioctl also contains signal status information applicable when the
300current video input is queried.</para> 298current video input is queried.</para>
301 299
302 <para>The &VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; ioctl return the 300 <para>The &VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; ioctls return the
303index of the current video input or output. To select a different 301index of the current video input or output. To select a different
304input or output applications call the &VIDIOC-S-INPUT; and 302input or output applications call the &VIDIOC-S-INPUT; and
305&VIDIOC-S-OUTPUT; ioctl. Drivers must implement all the input ioctls 303&VIDIOC-S-OUTPUT; ioctls. Drivers must implement all the input ioctls
306when the device has one or more inputs, all the output ioctls when the 304when the device has one or more inputs, all the output ioctls when the
307device has one or more outputs.</para> 305device has one or more outputs.</para>
308 306
309 <!--
310 <figure id=io-tree>
311 <title>Input and output enumeration is the root of most device properties.</title>
312 <mediaobject>
313 <imageobject>
314 <imagedata fileref="links.pdf" format="ps" />
315 </imageobject>
316 <imageobject>
317 <imagedata fileref="links.gif" format="gif" />
318 </imageobject>
319 <textobject>
320 <phrase>Links between various device property structures.</phrase>
321 </textobject>
322 </mediaobject>
323 </figure>
324 -->
325
326 <example> 307 <example>
327 <title>Information about the current video input</title> 308 <title>Information about the current video input</title>
328 309
@@ -330,20 +311,20 @@ device has one or more outputs.</para>
330&v4l2-input; input; 311&v4l2-input; input;
331int index; 312int index;
332 313
333if (-1 == ioctl (fd, &VIDIOC-G-INPUT;, &amp;index)) { 314if (-1 == ioctl(fd, &VIDIOC-G-INPUT;, &amp;index)) {
334 perror ("VIDIOC_G_INPUT"); 315 perror("VIDIOC_G_INPUT");
335 exit (EXIT_FAILURE); 316 exit(EXIT_FAILURE);
336} 317}
337 318
338memset (&amp;input, 0, sizeof (input)); 319memset(&amp;input, 0, sizeof(input));
339input.index = index; 320input.index = index;
340 321
341if (-1 == ioctl (fd, &VIDIOC-ENUMINPUT;, &amp;input)) { 322if (-1 == ioctl(fd, &VIDIOC-ENUMINPUT;, &amp;input)) {
342 perror ("VIDIOC_ENUMINPUT"); 323 perror("VIDIOC_ENUMINPUT");
343 exit (EXIT_FAILURE); 324 exit(EXIT_FAILURE);
344} 325}
345 326
346printf ("Current input: %s\n", input.name); 327printf("Current input: %s\n", input.name);
347 </programlisting> 328 </programlisting>
348 </example> 329 </example>
349 330
@@ -355,9 +336,9 @@ int index;
355 336
356index = 0; 337index = 0;
357 338
358if (-1 == ioctl (fd, &VIDIOC-S-INPUT;, &amp;index)) { 339if (-1 == ioctl(fd, &VIDIOC-S-INPUT;, &amp;index)) {
359 perror ("VIDIOC_S_INPUT"); 340 perror("VIDIOC_S_INPUT");
360 exit (EXIT_FAILURE); 341 exit(EXIT_FAILURE);
361} 342}
362 </programlisting> 343 </programlisting>
363 </example> 344 </example>
@@ -397,7 +378,7 @@ available inputs and outputs applications can enumerate them with the
397also contains signal status information applicable when the current 378also contains signal status information applicable when the current
398audio input is queried.</para> 379audio input is queried.</para>
399 380
400 <para>The &VIDIOC-G-AUDIO; and &VIDIOC-G-AUDOUT; ioctl report 381 <para>The &VIDIOC-G-AUDIO; and &VIDIOC-G-AUDOUT; ioctls report
401the current audio input and output, respectively. Note that, unlike 382the current audio input and output, respectively. Note that, unlike
402&VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; these ioctls return a structure 383&VIDIOC-G-INPUT; and &VIDIOC-G-OUTPUT; these ioctls return a structure
403as <constant>VIDIOC_ENUMAUDIO</constant> and 384as <constant>VIDIOC_ENUMAUDIO</constant> and
@@ -408,11 +389,11 @@ applications call the &VIDIOC-S-AUDIO; ioctl. To select an audio
408output (which presently has no changeable properties) applications 389output (which presently has no changeable properties) applications
409call the &VIDIOC-S-AUDOUT; ioctl.</para> 390call the &VIDIOC-S-AUDOUT; ioctl.</para>
410 391
411 <para>Drivers must implement all input ioctls when the device 392 <para>Drivers must implement all audio input ioctls when the device
412has one or more inputs, all output ioctls when the device has one 393has multiple selectable audio inputs, all audio output ioctls when the
413or more outputs. When the device has any audio inputs or outputs the 394device has multiple selectable audio outputs. When the device has any
414driver must set the <constant>V4L2_CAP_AUDIO</constant> flag in the 395audio inputs or outputs the driver must set the <constant>V4L2_CAP_AUDIO</constant>
415&v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl.</para> 396flag in the &v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl.</para>
416 397
417 <example> 398 <example>
418 <title>Information about the current audio input</title> 399 <title>Information about the current audio input</title>
@@ -420,14 +401,14 @@ driver must set the <constant>V4L2_CAP_AUDIO</constant> flag in the
420 <programlisting> 401 <programlisting>
421&v4l2-audio; audio; 402&v4l2-audio; audio;
422 403
423memset (&amp;audio, 0, sizeof (audio)); 404memset(&amp;audio, 0, sizeof(audio));
424 405
425if (-1 == ioctl (fd, &VIDIOC-G-AUDIO;, &amp;audio)) { 406if (-1 == ioctl(fd, &VIDIOC-G-AUDIO;, &amp;audio)) {
426 perror ("VIDIOC_G_AUDIO"); 407 perror("VIDIOC_G_AUDIO");
427 exit (EXIT_FAILURE); 408 exit(EXIT_FAILURE);
428} 409}
429 410
430printf ("Current input: %s\n", audio.name); 411printf("Current input: %s\n", audio.name);
431 </programlisting> 412 </programlisting>
432 </example> 413 </example>
433 414
@@ -437,13 +418,13 @@ printf ("Current input: %s\n", audio.name);
437 <programlisting> 418 <programlisting>
438&v4l2-audio; audio; 419&v4l2-audio; audio;
439 420
440memset (&amp;audio, 0, sizeof (audio)); /* clear audio.mode, audio.reserved */ 421memset(&amp;audio, 0, sizeof(audio)); /* clear audio.mode, audio.reserved */
441 422
442audio.index = 0; 423audio.index = 0;
443 424
444if (-1 == ioctl (fd, &VIDIOC-S-AUDIO;, &amp;audio)) { 425if (-1 == ioctl(fd, &VIDIOC-S-AUDIO;, &amp;audio)) {
445 perror ("VIDIOC_S_AUDIO"); 426 perror("VIDIOC_S_AUDIO");
446 exit (EXIT_FAILURE); 427 exit(EXIT_FAILURE);
447} 428}
448 </programlisting> 429 </programlisting>
449 </example> 430 </example>