diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-21 12:03:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-21 12:03:10 -0400 |
commit | c720f5655df159a630fa0290a0bd67c93e92b0bf (patch) | |
tree | 940d139d0ec1ff5201efddef6cc663166a8a2df3 /Documentation/DocBook/v4l/dev-output.xml | |
parent | 33e6c1a0de818d3698cdab27c42915661011319d (diff) | |
parent | 84d6ae431f315e8973aac3c3fe1d550fc9240ef3 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (222 commits)
V4L/DVB (13033): pt1: Don't use a deprecated DMA_BIT_MASK macro
V4L/DVB (13029): radio-si4713: remove #include <linux/version.h>
V4L/DVB (13027): go7007: convert printks to v4l2_info
V4L/DVB (13026): s2250-board: Implement brightness and contrast controls
V4L/DVB (13025): s2250-board: Fix memory leaks
V4L/DVB (13024): go7007: Implement vidioc_g_std and vidioc_querystd
V4L/DVB (13023): go7007: Merge struct gofh and go declarations
V4L/DVB (13022): go7007: Fix mpeg controls
V4L/DVB (13021): go7007: Fix whitespace and line lengths
V4L/DVB (13020): go7007: Updates to Kconfig and Makefile
V4L/DVB (13019): video: initial support for ADV7180
V4L/DVB (13018): kzalloc failure ignored in au8522_probe()
V4L/DVB (13017): gspca: kmalloc failure ignored in sd_start()
V4L/DVB (13016): kmalloc failure ignored in lgdt3304_attach() and s921_attach()
V4L/DVB (13015): kmalloc failure ignored in m920x_firmware_download()
V4L/DVB (13014): Add support for Compro VideoMate E800 (DVB-T part only)
V4L/DVB (13013): FM TX: si4713: Kconfig: Fixed two typos.
V4L/DVB (13012): uvc: introduce missing kfree
V4L/DVB (13011): Change tuner type of BeholdTV cards
V4L/DVB (13009): gspca - stv06xx-hdcs: Reduce exposure range
...
Diffstat (limited to 'Documentation/DocBook/v4l/dev-output.xml')
-rw-r--r-- | Documentation/DocBook/v4l/dev-output.xml | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/Documentation/DocBook/v4l/dev-output.xml b/Documentation/DocBook/v4l/dev-output.xml new file mode 100644 index 000000000000..63c3c20e5a72 --- /dev/null +++ b/Documentation/DocBook/v4l/dev-output.xml | |||
@@ -0,0 +1,111 @@ | |||
1 | <title>Video Output Interface</title> | ||
2 | |||
3 | <para>Video output devices encode stills or image sequences as | ||
4 | analog video signal. With this interface applications can | ||
5 | control the encoding process and move images from user space to | ||
6 | the driver.</para> | ||
7 | |||
8 | <para>Conventionally V4L2 video output devices are accessed through | ||
9 | character device special files named <filename>/dev/video</filename> | ||
10 | and <filename>/dev/video0</filename> to | ||
11 | <filename>/dev/video63</filename> with major number 81 and minor | ||
12 | numbers 0 to 63. <filename>/dev/video</filename> is typically a | ||
13 | symbolic link to the preferred video device. Note the same device | ||
14 | files are used for video capture devices.</para> | ||
15 | |||
16 | <section> | ||
17 | <title>Querying Capabilities</title> | ||
18 | |||
19 | <para>Devices supporting the video output interface set the | ||
20 | <constant>V4L2_CAP_VIDEO_OUTPUT</constant> flag in the | ||
21 | <structfield>capabilities</structfield> field of &v4l2-capability; | ||
22 | returned by the &VIDIOC-QUERYCAP; ioctl. As secondary device functions | ||
23 | they may also support the <link linkend="raw-vbi">raw VBI | ||
24 | output</link> (<constant>V4L2_CAP_VBI_OUTPUT</constant>) interface. At | ||
25 | least one of the read/write or streaming I/O methods must be | ||
26 | supported. Modulators and audio outputs are optional.</para> | ||
27 | </section> | ||
28 | |||
29 | <section> | ||
30 | <title>Supplemental Functions</title> | ||
31 | |||
32 | <para>Video output devices shall support <link | ||
33 | linkend="audio">audio output</link>, <link | ||
34 | linkend="tuner">modulator</link>, <link linkend="control">controls</link>, | ||
35 | <link linkend="crop">cropping and scaling</link> and <link | ||
36 | linkend="streaming-par">streaming parameter</link> ioctls as needed. | ||
37 | The <link linkend="video">video output</link> and <link | ||
38 | linkend="standard">video standard</link> ioctls must be supported by | ||
39 | all video output devices.</para> | ||
40 | </section> | ||
41 | |||
42 | <section> | ||
43 | <title>Image Format Negotiation</title> | ||
44 | |||
45 | <para>The output is determined by cropping and image format | ||
46 | parameters. The former select an area of the video picture where the | ||
47 | image will appear, the latter how images are stored in memory, &ie; in | ||
48 | RGB or YUV format, the number of bits per pixel or width and height. | ||
49 | Together they also define how images are scaled in the process.</para> | ||
50 | |||
51 | <para>As usual these parameters are <emphasis>not</emphasis> reset | ||
52 | at &func-open; time to permit Unix tool chains, programming a device | ||
53 | and then writing to it as if it was a plain file. Well written V4L2 | ||
54 | applications ensure they really get what they want, including cropping | ||
55 | and scaling.</para> | ||
56 | |||
57 | <para>Cropping initialization at minimum requires to reset the | ||
58 | parameters to defaults. An example is given in <xref | ||
59 | linkend="crop" />.</para> | ||
60 | |||
61 | <para>To query the current image format applications set the | ||
62 | <structfield>type</structfield> field of a &v4l2-format; to | ||
63 | <constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant> and call the | ||
64 | &VIDIOC-G-FMT; ioctl with a pointer to this structure. Drivers fill | ||
65 | the &v4l2-pix-format; <structfield>pix</structfield> member of the | ||
66 | <structfield>fmt</structfield> union.</para> | ||
67 | |||
68 | <para>To request different parameters applications set the | ||
69 | <structfield>type</structfield> field of a &v4l2-format; as above and | ||
70 | initialize all fields of the &v4l2-pix-format; | ||
71 | <structfield>vbi</structfield> member of the | ||
72 | <structfield>fmt</structfield> union, or better just modify the | ||
73 | results of <constant>VIDIOC_G_FMT</constant>, and call the | ||
74 | &VIDIOC-S-FMT; ioctl with a pointer to this structure. Drivers may | ||
75 | adjust the parameters and finally return the actual parameters as | ||
76 | <constant>VIDIOC_G_FMT</constant> does.</para> | ||
77 | |||
78 | <para>Like <constant>VIDIOC_S_FMT</constant> the | ||
79 | &VIDIOC-TRY-FMT; ioctl can be used to learn about hardware limitations | ||
80 | without disabling I/O or possibly time consuming hardware | ||
81 | preparations.</para> | ||
82 | |||
83 | <para>The contents of &v4l2-pix-format; are discussed in <xref | ||
84 | linkend="pixfmt" />. See also the specification of the | ||
85 | <constant>VIDIOC_G_FMT</constant>, <constant>VIDIOC_S_FMT</constant> | ||
86 | and <constant>VIDIOC_TRY_FMT</constant> ioctls for details. Video | ||
87 | output devices must implement both the | ||
88 | <constant>VIDIOC_G_FMT</constant> and | ||
89 | <constant>VIDIOC_S_FMT</constant> ioctl, even if | ||
90 | <constant>VIDIOC_S_FMT</constant> ignores all requests and always | ||
91 | returns default parameters as <constant>VIDIOC_G_FMT</constant> does. | ||
92 | <constant>VIDIOC_TRY_FMT</constant> is optional.</para> | ||
93 | </section> | ||
94 | |||
95 | <section> | ||
96 | <title>Writing Images</title> | ||
97 | |||
98 | <para>A video output device may support the <link | ||
99 | linkend="rw">write() function</link> and/or streaming (<link | ||
100 | linkend="mmap">memory mapping</link> or <link | ||
101 | linkend="userp">user pointer</link>) I/O. See <xref | ||
102 | linkend="io" /> for details.</para> | ||
103 | </section> | ||
104 | |||
105 | <!-- | ||
106 | Local Variables: | ||
107 | mode: sgml | ||
108 | sgml-parent-document: "v4l2.sgml" | ||
109 | indent-tabs-mode: nil | ||
110 | End: | ||
111 | --> | ||