Linux 2.6.33-rc8
[linux-2.6/lguest.git] / Documentation / DocBook / v4l / v4l2.xml
blob060105af49e5989b2f1dad9a9c38f00d532e1602
1  <partinfo>
2     <authorgroup>
3       <author>
4         <firstname>Michael</firstname>
5         <surname>Schimek</surname>
6         <othername role="mi">H</othername>
7         <affiliation>
8           <address>
9             <email>mschimek@gmx.at</email>
10           </address>
11         </affiliation>
12       </author>
14       <author>
15         <firstname>Bill</firstname>
16         <surname>Dirks</surname>
17         <!-- Commented until Bill opts in to be spammed.
18         <affiliation>
19           <address>
20             <email>bill@thedirks.org</email>
21           </address>
22         </affiliation> -->
23         <contrib>Original author of the V4L2 API and
24 documentation.</contrib>
25       </author>
27       <author>
28         <firstname>Hans</firstname>
29         <surname>Verkuil</surname>
30         <contrib>Designed and documented the VIDIOC_LOG_STATUS ioctl,
31 the extended control ioctls and major parts of the sliced VBI
32 API.</contrib>
33         <affiliation>
34           <address>
35             <email>hverkuil@xs4all.nl</email>
36           </address>
37         </affiliation>
38       </author>
40       <author>
41         <firstname>Martin</firstname>
42         <surname>Rubli</surname>
43         <!--
44         <affiliation>
45           <address>
46             <email>martin_rubli@logitech.com</email>
47           </address>
48         </affiliation> -->
49         <contrib>Designed and documented the VIDIOC_ENUM_FRAMESIZES
50 and VIDIOC_ENUM_FRAMEINTERVALS ioctls.</contrib>
51       </author>
53       <author>
54         <firstname>Andy</firstname>
55         <surname>Walls</surname>
56         <contrib>Documented the fielded V4L2_MPEG_STREAM_VBI_FMT_IVTV
57 MPEG stream embedded, sliced VBI data format in this specification.
58 </contrib>
59         <affiliation>
60           <address>
61             <email>awalls@radix.net</email>
62           </address>
63         </affiliation>
64       </author>
66       <author>
67         <firstname>Mauro</firstname>
68         <surname>Carvalho Chehab</surname>
69         <contrib>Documented libv4l, designed and added v4l2grab example,
70 Remote Controller chapter.</contrib>
71         <affiliation>
72           <address>
73             <email>mchehab@redhat.com</email>
74           </address>
75         </affiliation>
76       </author>
78       <author>
79         <firstname>Muralidharan</firstname>
80         <surname>Karicheri</surname>
81         <contrib>Documented the Digital Video timings API.</contrib>
82         <affiliation>
83           <address>
84             <email>m-karicheri2@ti.com</email>
85           </address>
86         </affiliation>
87       </author>
88     </authorgroup>
90     <copyright>
91       <year>1999</year>
92       <year>2000</year>
93       <year>2001</year>
94       <year>2002</year>
95       <year>2003</year>
96       <year>2004</year>
97       <year>2005</year>
98       <year>2006</year>
99       <year>2007</year>
100       <year>2008</year>
101       <year>2009</year>
102       <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
103 Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder>
104     </copyright>
105     <legalnotice>
106     <para>Except when explicitly stated as GPL, programming examples within
107             this part can be used and distributed without restrictions.</para>
108     </legalnotice>
109     <revhistory>
110       <!-- Put document revisions here, newest first. -->
111       <!-- API revisions (changes and additions of defines, enums,
112 structs, ioctls) must be noted in more detail in the history chapter
113 (compat.sgml), along with the possible impact on existing drivers and
114 applications. -->
116       <revision>
117         <revnumber>2.6.33</revnumber>
118         <date>2009-12-03</date>
119         <authorinitials>mk</authorinitials>
120         <revremark>Added documentation for the Digital Video timings API.</revremark>
121       </revision>
123       <revision>
124         <revnumber>2.6.32</revnumber>
125         <date>2009-08-31</date>
126         <authorinitials>mcc</authorinitials>
127         <revremark>Now, revisions will match the kernel version where
128 the V4L2 API changes will be used by the Linux Kernel.
129 Also added Remote Controller chapter.</revremark>
130       </revision>
132       <revision>
133         <revnumber>0.29</revnumber>
134         <date>2009-08-26</date>
135         <authorinitials>ev</authorinitials>
136         <revremark>Added documentation for string controls and for FM Transmitter controls.</revremark>
137       </revision>
139       <revision>
140         <revnumber>0.28</revnumber>
141         <date>2009-08-26</date>
142         <authorinitials>gl</authorinitials>
143         <revremark>Added V4L2_CID_BAND_STOP_FILTER documentation.</revremark>
144       </revision>
146       <revision>
147         <revnumber>0.27</revnumber>
148         <date>2009-08-15</date>
149         <authorinitials>mcc</authorinitials>
150         <revremark>Added libv4l and Remote Controller documentation;
151 added v4l2grab and keytable application examples.</revremark>
152       </revision>
154       <revision>
155         <revnumber>0.26</revnumber>
156         <date>2009-07-23</date>
157         <authorinitials>hv</authorinitials>
158         <revremark>Finalized the RDS capture API. Added modulator and RDS encoder
159 capabilities. Added support for string controls.</revremark>
160       </revision>
162       <revision>
163         <revnumber>0.25</revnumber>
164         <date>2009-01-18</date>
165         <authorinitials>hv</authorinitials>
166         <revremark>Added pixel formats VYUY, NV16 and NV61, and changed
167 the debug ioctls VIDIOC_DBG_G/S_REGISTER and VIDIOC_DBG_G_CHIP_IDENT.
168 Added camera controls V4L2_CID_ZOOM_ABSOLUTE, V4L2_CID_ZOOM_RELATIVE,
169 V4L2_CID_ZOOM_CONTINUOUS and V4L2_CID_PRIVACY.</revremark>
170       </revision>
172       <revision>
173         <revnumber>0.24</revnumber>
174         <date>2008-03-04</date>
175         <authorinitials>mhs</authorinitials>
176         <revremark>Added pixel formats Y16 and SBGGR16, new controls
177 and a camera controls class. Removed VIDIOC_G/S_MPEGCOMP.</revremark>
178       </revision>
180       <revision>
181         <revnumber>0.23</revnumber>
182         <date>2007-08-30</date>
183         <authorinitials>mhs</authorinitials>
184         <revremark>Fixed a typo in VIDIOC_DBG_G/S_REGISTER.
185 Clarified the byte order of packed pixel formats.</revremark>
186       </revision>
188       <revision>
189         <revnumber>0.22</revnumber>
190         <date>2007-08-29</date>
191         <authorinitials>mhs</authorinitials>
192         <revremark>Added the Video Output Overlay interface, new MPEG
193 controls, V4L2_FIELD_INTERLACED_TB and V4L2_FIELD_INTERLACED_BT,
194 VIDIOC_DBG_G/S_REGISTER, VIDIOC_(TRY_)ENCODER_CMD,
195 VIDIOC_G_CHIP_IDENT, VIDIOC_G_ENC_INDEX, new pixel formats.
196 Clarifications in the cropping chapter, about RGB pixel formats, the
197 mmap(), poll(), select(), read() and write() functions. Typographical
198 fixes.</revremark>
199       </revision>
201       <revision>
202         <revnumber>0.21</revnumber>
203         <date>2006-12-19</date>
204         <authorinitials>mhs</authorinitials>
205         <revremark>Fixed a link in the VIDIOC_G_EXT_CTRLS section.</revremark>
206       </revision>
208       <revision>
209         <revnumber>0.20</revnumber>
210         <date>2006-11-24</date>
211         <authorinitials>mhs</authorinitials>
212         <revremark>Clarified the purpose of the audioset field in
213 struct v4l2_input and v4l2_output.</revremark>
214       </revision>
216       <revision>
217         <revnumber>0.19</revnumber>
218         <date>2006-10-19</date>
219         <authorinitials>mhs</authorinitials>
220         <revremark>Documented V4L2_PIX_FMT_RGB444.</revremark>
221       </revision>
223       <revision>
224         <revnumber>0.18</revnumber>
225         <date>2006-10-18</date>
226         <authorinitials>mhs</authorinitials>
227         <revremark>Added the description of extended controls by Hans
228 Verkuil. Linked V4L2_PIX_FMT_MPEG to V4L2_CID_MPEG_STREAM_TYPE.</revremark>
229       </revision>
231       <revision>
232         <revnumber>0.17</revnumber>
233         <date>2006-10-12</date>
234         <authorinitials>mhs</authorinitials>
235         <revremark>Corrected V4L2_PIX_FMT_HM12 description.</revremark>
236       </revision>
238       <revision>
239         <revnumber>0.16</revnumber>
240         <date>2006-10-08</date>
241         <authorinitials>mhs</authorinitials>
242         <revremark>VIDIOC_ENUM_FRAMESIZES and
243 VIDIOC_ENUM_FRAMEINTERVALS are now part of the API.</revremark>
244       </revision>
246       <revision>
247         <revnumber>0.15</revnumber>
248         <date>2006-09-23</date>
249         <authorinitials>mhs</authorinitials>
250         <revremark>Cleaned up the bibliography, added BT.653 and
251 BT.1119. capture.c/start_capturing() for user pointer I/O did not
252 initialize the buffer index. Documented the V4L MPEG and MJPEG
253 VID_TYPEs and V4L2_PIX_FMT_SBGGR8. Updated the list of reserved pixel
254 formats. See the history chapter for API changes.</revremark>
255       </revision>
257       <revision>
258         <revnumber>0.14</revnumber>
259         <date>2006-09-14</date>
260         <authorinitials>mr</authorinitials>
261         <revremark>Added VIDIOC_ENUM_FRAMESIZES and
262 VIDIOC_ENUM_FRAMEINTERVALS proposal for frame format enumeration of
263 digital devices.</revremark>
264       </revision>
266       <revision>
267         <revnumber>0.13</revnumber>
268         <date>2006-04-07</date>
269         <authorinitials>mhs</authorinitials>
270         <revremark>Corrected the description of struct v4l2_window
271 clips. New V4L2_STD_ and V4L2_TUNER_MODE_LANG1_LANG2
272 defines.</revremark>
273       </revision>
275       <revision>
276         <revnumber>0.12</revnumber>
277         <date>2006-02-03</date>
278         <authorinitials>mhs</authorinitials>
279         <revremark>Corrected the description of struct
280 v4l2_captureparm and v4l2_outputparm.</revremark>
281       </revision>
283       <revision>
284         <revnumber>0.11</revnumber>
285         <date>2006-01-27</date>
286         <authorinitials>mhs</authorinitials>
287         <revremark>Improved the description of struct
288 v4l2_tuner.</revremark>
289       </revision>
291       <revision>
292         <revnumber>0.10</revnumber>
293         <date>2006-01-10</date>
294         <authorinitials>mhs</authorinitials>
295         <revremark>VIDIOC_G_INPUT and VIDIOC_S_PARM
296 clarifications.</revremark>
297       </revision>
299       <revision>
300         <revnumber>0.9</revnumber>
301         <date>2005-11-27</date>
302         <authorinitials>mhs</authorinitials>
303         <revremark>Improved the 525 line numbering diagram. Hans
304 Verkuil and I rewrote the sliced VBI section. He also contributed a
305 VIDIOC_LOG_STATUS page. Fixed VIDIOC_S_STD call in the video standard
306 selection example. Various updates.</revremark>
307       </revision>
309       <revision>
310         <revnumber>0.8</revnumber>
311         <date>2004-10-04</date>
312         <authorinitials>mhs</authorinitials>
313         <revremark>Somehow a piece of junk slipped into the capture
314 example, removed.</revremark>
315       </revision>
317       <revision>
318         <revnumber>0.7</revnumber>
319         <date>2004-09-19</date>
320         <authorinitials>mhs</authorinitials>
321         <revremark>Fixed video standard selection, control
322 enumeration, downscaling and aspect example. Added read and user
323 pointer i/o to video capture example.</revremark>
324       </revision>
326       <revision>
327         <revnumber>0.6</revnumber>
328         <date>2004-08-01</date>
329         <authorinitials>mhs</authorinitials>
330         <revremark>v4l2_buffer changes, added video capture example,
331 various corrections.</revremark>
332       </revision>
334       <revision>
335         <revnumber>0.5</revnumber>
336         <date>2003-11-05</date>
337         <authorinitials>mhs</authorinitials>
338         <revremark>Pixel format erratum.</revremark>
339       </revision>
341       <revision>
342         <revnumber>0.4</revnumber>
343         <date>2003-09-17</date>
344         <authorinitials>mhs</authorinitials>
345         <revremark>Corrected source and Makefile to generate a PDF.
346 SGML fixes. Added latest API changes. Closed gaps in the history
347 chapter.</revremark>
348       </revision>
350       <revision>
351         <revnumber>0.3</revnumber>
352         <date>2003-02-05</date>
353         <authorinitials>mhs</authorinitials>
354         <revremark>Another draft, more corrections.</revremark>
355       </revision>
357       <revision>
358         <revnumber>0.2</revnumber>
359         <date>2003-01-15</date>
360         <authorinitials>mhs</authorinitials>
361         <revremark>Second draft, with corrections pointed out by Gerd
362 Knorr.</revremark>
363       </revision>
365       <revision>
366         <revnumber>0.1</revnumber>
367         <date>2002-12-01</date>
368         <authorinitials>mhs</authorinitials>
369         <revremark>First draft, based on documentation by Bill Dirks
370 and discussions on the V4L mailing list.</revremark>
371       </revision>
372     </revhistory>
373 </partinfo>
375 <title>Video for Linux Two API Specification</title>
376  <subtitle>Revision 2.6.33</subtitle>
378   <chapter id="common">
379     &sub-common;
380   </chapter>
382   <chapter id="pixfmt">
383     &sub-pixfmt;
384   </chapter>
386   <chapter id="io">
387     &sub-io;
388   </chapter>
390   <chapter id="devices">
391     <title>Interfaces</title>
393     <section id="capture"> &sub-dev-capture; </section>
394     <section id="overlay"> &sub-dev-overlay; </section>
395     <section id="output"> &sub-dev-output; </section>
396     <section id="osd"> &sub-dev-osd; </section>
397     <section id="codec"> &sub-dev-codec; </section>
398     <section id="effect"> &sub-dev-effect; </section>
399     <section id="raw-vbi"> &sub-dev-raw-vbi; </section>
400     <section id="sliced"> &sub-dev-sliced-vbi; </section>
401     <section id="ttx"> &sub-dev-teletext; </section>
402     <section id="radio"> &sub-dev-radio; </section>
403     <section id="rds"> &sub-dev-rds; </section>
404   </chapter>
406   <chapter id="driver">
407           &sub-driver;
408   </chapter>
410   <chapter id="libv4l">
411           &sub-libv4l;
412   </chapter>
414   <chapter id="compat">
415           &sub-compat;
416   </chapter>
418   <appendix id="user-func">
419   <title>Function Reference</title>
421     <!-- Keep this alphabetically sorted. -->
423     &sub-close;
424     &sub-ioctl;
425     <!-- All ioctls go here. -->
426     &sub-cropcap;
427     &sub-dbg-g-chip-ident;
428     &sub-dbg-g-register;
429     &sub-encoder-cmd;
430     &sub-enumaudio;
431     &sub-enumaudioout;
432     &sub-enum-dv-presets;
433     &sub-enum-fmt;
434     &sub-enum-framesizes;
435     &sub-enum-frameintervals;
436     &sub-enuminput;
437     &sub-enumoutput;
438     &sub-enumstd;
439     &sub-g-audio;
440     &sub-g-audioout;
441     &sub-g-crop;
442     &sub-g-ctrl;
443     &sub-g-dv-preset;
444     &sub-g-dv-timings;
445     &sub-g-enc-index;
446     &sub-g-ext-ctrls;
447     &sub-g-fbuf;
448     &sub-g-fmt;
449     &sub-g-frequency;
450     &sub-g-input;
451     &sub-g-jpegcomp;
452     &sub-g-modulator;
453     &sub-g-output;
454     &sub-g-parm;
455     &sub-g-priority;
456     &sub-g-sliced-vbi-cap;
457     &sub-g-std;
458     &sub-g-tuner;
459     &sub-log-status;
460     &sub-overlay;
461     &sub-qbuf;
462     &sub-querybuf;
463     &sub-querycap;
464     &sub-queryctrl;
465     &sub-query-dv-preset;
466     &sub-querystd;
467     &sub-reqbufs;
468     &sub-s-hw-freq-seek;
469     &sub-streamon;
470     <!-- End of ioctls. -->
471     &sub-mmap;
472     &sub-munmap;
473     &sub-open;
474     &sub-poll;
475     &sub-read;
476     &sub-select;
477     &sub-write;
478   </appendix>
480   <appendix id="videodev">
481     <title>Video For Linux Two Header File</title>
482     &sub-videodev2-h;
483   </appendix>
485   <appendix id="capture-example">
486     <title>Video Capture Example</title>
487     &sub-capture-c;
488   </appendix>
490   <appendix id="v4l2grab-example">
491     <title>Video Grabber example using libv4l</title>
492     <para>This program demonstrates how to grab V4L2 images in ppm format by
493 using libv4l handlers. The advantage is that this grabber can potentially work
494 with any V4L2 driver.</para>
495     &sub-v4l2grab-c;
496   </appendix>
498   &sub-media-indices;
500   &sub-biblio;