Merge commit 'v2.6.37-rc2' into sched/core
[pandora-kernel.git] / Documentation / DocBook / v4l / v4l2.xml
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>
13
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>
26
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>
39
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>
52
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@md.metrocast.net</email>
62           </address>
63         </affiliation>
64       </author>
65
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>
77
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>
89
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       <year>2010</year>
103       <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
104 Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder>
105     </copyright>
106     <legalnotice>
107     <para>Except when explicitly stated as GPL, programming examples within
108             this part can be used and distributed without restrictions.</para>
109     </legalnotice>
110     <revhistory>
111       <!-- Put document revisions here, newest first. -->
112       <!-- API revisions (changes and additions of defines, enums,
113 structs, ioctls) must be noted in more detail in the history chapter
114 (compat.xml), along with the possible impact on existing drivers and
115 applications. -->
116
117       <revision>
118         <revnumber>2.6.37</revnumber>
119         <date>2010-08-06</date>
120         <authorinitials>hv</authorinitials>
121         <revremark>Removed obsolete vtx (videotext) API.</revremark>
122       </revision>
123
124       <revision>
125         <revnumber>2.6.33</revnumber>
126         <date>2009-12-03</date>
127         <authorinitials>mk</authorinitials>
128         <revremark>Added documentation for the Digital Video timings API.</revremark>
129       </revision>
130
131       <revision>
132         <revnumber>2.6.32</revnumber>
133         <date>2009-08-31</date>
134         <authorinitials>mcc</authorinitials>
135         <revremark>Now, revisions will match the kernel version where
136 the V4L2 API changes will be used by the Linux Kernel.
137 Also added Remote Controller chapter.</revremark>
138       </revision>
139
140       <revision>
141         <revnumber>0.29</revnumber>
142         <date>2009-08-26</date>
143         <authorinitials>ev</authorinitials>
144         <revremark>Added documentation for string controls and for FM Transmitter controls.</revremark>
145       </revision>
146
147       <revision>
148         <revnumber>0.28</revnumber>
149         <date>2009-08-26</date>
150         <authorinitials>gl</authorinitials>
151         <revremark>Added V4L2_CID_BAND_STOP_FILTER documentation.</revremark>
152       </revision>
153
154       <revision>
155         <revnumber>0.27</revnumber>
156         <date>2009-08-15</date>
157         <authorinitials>mcc</authorinitials>
158         <revremark>Added libv4l and Remote Controller documentation;
159 added v4l2grab and keytable application examples.</revremark>
160       </revision>
161
162       <revision>
163         <revnumber>0.26</revnumber>
164         <date>2009-07-23</date>
165         <authorinitials>hv</authorinitials>
166         <revremark>Finalized the RDS capture API. Added modulator and RDS encoder
167 capabilities. Added support for string controls.</revremark>
168       </revision>
169
170       <revision>
171         <revnumber>0.25</revnumber>
172         <date>2009-01-18</date>
173         <authorinitials>hv</authorinitials>
174         <revremark>Added pixel formats VYUY, NV16 and NV61, and changed
175 the debug ioctls VIDIOC_DBG_G/S_REGISTER and VIDIOC_DBG_G_CHIP_IDENT.
176 Added camera controls V4L2_CID_ZOOM_ABSOLUTE, V4L2_CID_ZOOM_RELATIVE,
177 V4L2_CID_ZOOM_CONTINUOUS and V4L2_CID_PRIVACY.</revremark>
178       </revision>
179
180       <revision>
181         <revnumber>0.24</revnumber>
182         <date>2008-03-04</date>
183         <authorinitials>mhs</authorinitials>
184         <revremark>Added pixel formats Y16 and SBGGR16, new controls
185 and a camera controls class. Removed VIDIOC_G/S_MPEGCOMP.</revremark>
186       </revision>
187
188       <revision>
189         <revnumber>0.23</revnumber>
190         <date>2007-08-30</date>
191         <authorinitials>mhs</authorinitials>
192         <revremark>Fixed a typo in VIDIOC_DBG_G/S_REGISTER.
193 Clarified the byte order of packed pixel formats.</revremark>
194       </revision>
195
196       <revision>
197         <revnumber>0.22</revnumber>
198         <date>2007-08-29</date>
199         <authorinitials>mhs</authorinitials>
200         <revremark>Added the Video Output Overlay interface, new MPEG
201 controls, V4L2_FIELD_INTERLACED_TB and V4L2_FIELD_INTERLACED_BT,
202 VIDIOC_DBG_G/S_REGISTER, VIDIOC_(TRY_)ENCODER_CMD,
203 VIDIOC_G_CHIP_IDENT, VIDIOC_G_ENC_INDEX, new pixel formats.
204 Clarifications in the cropping chapter, about RGB pixel formats, the
205 mmap(), poll(), select(), read() and write() functions. Typographical
206 fixes.</revremark>
207       </revision>
208
209       <revision>
210         <revnumber>0.21</revnumber>
211         <date>2006-12-19</date>
212         <authorinitials>mhs</authorinitials>
213         <revremark>Fixed a link in the VIDIOC_G_EXT_CTRLS section.</revremark>
214       </revision>
215
216       <revision>
217         <revnumber>0.20</revnumber>
218         <date>2006-11-24</date>
219         <authorinitials>mhs</authorinitials>
220         <revremark>Clarified the purpose of the audioset field in
221 struct v4l2_input and v4l2_output.</revremark>
222       </revision>
223
224       <revision>
225         <revnumber>0.19</revnumber>
226         <date>2006-10-19</date>
227         <authorinitials>mhs</authorinitials>
228         <revremark>Documented V4L2_PIX_FMT_RGB444.</revremark>
229       </revision>
230
231       <revision>
232         <revnumber>0.18</revnumber>
233         <date>2006-10-18</date>
234         <authorinitials>mhs</authorinitials>
235         <revremark>Added the description of extended controls by Hans
236 Verkuil. Linked V4L2_PIX_FMT_MPEG to V4L2_CID_MPEG_STREAM_TYPE.</revremark>
237       </revision>
238
239       <revision>
240         <revnumber>0.17</revnumber>
241         <date>2006-10-12</date>
242         <authorinitials>mhs</authorinitials>
243         <revremark>Corrected V4L2_PIX_FMT_HM12 description.</revremark>
244       </revision>
245
246       <revision>
247         <revnumber>0.16</revnumber>
248         <date>2006-10-08</date>
249         <authorinitials>mhs</authorinitials>
250         <revremark>VIDIOC_ENUM_FRAMESIZES and
251 VIDIOC_ENUM_FRAMEINTERVALS are now part of the API.</revremark>
252       </revision>
253
254       <revision>
255         <revnumber>0.15</revnumber>
256         <date>2006-09-23</date>
257         <authorinitials>mhs</authorinitials>
258         <revremark>Cleaned up the bibliography, added BT.653 and
259 BT.1119. capture.c/start_capturing() for user pointer I/O did not
260 initialize the buffer index. Documented the V4L MPEG and MJPEG
261 VID_TYPEs and V4L2_PIX_FMT_SBGGR8. Updated the list of reserved pixel
262 formats. See the history chapter for API changes.</revremark>
263       </revision>
264
265       <revision>
266         <revnumber>0.14</revnumber>
267         <date>2006-09-14</date>
268         <authorinitials>mr</authorinitials>
269         <revremark>Added VIDIOC_ENUM_FRAMESIZES and
270 VIDIOC_ENUM_FRAMEINTERVALS proposal for frame format enumeration of
271 digital devices.</revremark>
272       </revision>
273
274       <revision>
275         <revnumber>0.13</revnumber>
276         <date>2006-04-07</date>
277         <authorinitials>mhs</authorinitials>
278         <revremark>Corrected the description of struct v4l2_window
279 clips. New V4L2_STD_ and V4L2_TUNER_MODE_LANG1_LANG2
280 defines.</revremark>
281       </revision>
282
283       <revision>
284         <revnumber>0.12</revnumber>
285         <date>2006-02-03</date>
286         <authorinitials>mhs</authorinitials>
287         <revremark>Corrected the description of struct
288 v4l2_captureparm and v4l2_outputparm.</revremark>
289       </revision>
290
291       <revision>
292         <revnumber>0.11</revnumber>
293         <date>2006-01-27</date>
294         <authorinitials>mhs</authorinitials>
295         <revremark>Improved the description of struct
296 v4l2_tuner.</revremark>
297       </revision>
298
299       <revision>
300         <revnumber>0.10</revnumber>
301         <date>2006-01-10</date>
302         <authorinitials>mhs</authorinitials>
303         <revremark>VIDIOC_G_INPUT and VIDIOC_S_PARM
304 clarifications.</revremark>
305       </revision>
306
307       <revision>
308         <revnumber>0.9</revnumber>
309         <date>2005-11-27</date>
310         <authorinitials>mhs</authorinitials>
311         <revremark>Improved the 525 line numbering diagram. Hans
312 Verkuil and I rewrote the sliced VBI section. He also contributed a
313 VIDIOC_LOG_STATUS page. Fixed VIDIOC_S_STD call in the video standard
314 selection example. Various updates.</revremark>
315       </revision>
316
317       <revision>
318         <revnumber>0.8</revnumber>
319         <date>2004-10-04</date>
320         <authorinitials>mhs</authorinitials>
321         <revremark>Somehow a piece of junk slipped into the capture
322 example, removed.</revremark>
323       </revision>
324
325       <revision>
326         <revnumber>0.7</revnumber>
327         <date>2004-09-19</date>
328         <authorinitials>mhs</authorinitials>
329         <revremark>Fixed video standard selection, control
330 enumeration, downscaling and aspect example. Added read and user
331 pointer i/o to video capture example.</revremark>
332       </revision>
333
334       <revision>
335         <revnumber>0.6</revnumber>
336         <date>2004-08-01</date>
337         <authorinitials>mhs</authorinitials>
338         <revremark>v4l2_buffer changes, added video capture example,
339 various corrections.</revremark>
340       </revision>
341
342       <revision>
343         <revnumber>0.5</revnumber>
344         <date>2003-11-05</date>
345         <authorinitials>mhs</authorinitials>
346         <revremark>Pixel format erratum.</revremark>
347       </revision>
348
349       <revision>
350         <revnumber>0.4</revnumber>
351         <date>2003-09-17</date>
352         <authorinitials>mhs</authorinitials>
353         <revremark>Corrected source and Makefile to generate a PDF.
354 SGML fixes. Added latest API changes. Closed gaps in the history
355 chapter.</revremark>
356       </revision>
357
358       <revision>
359         <revnumber>0.3</revnumber>
360         <date>2003-02-05</date>
361         <authorinitials>mhs</authorinitials>
362         <revremark>Another draft, more corrections.</revremark>
363       </revision>
364
365       <revision>
366         <revnumber>0.2</revnumber>
367         <date>2003-01-15</date>
368         <authorinitials>mhs</authorinitials>
369         <revremark>Second draft, with corrections pointed out by Gerd
370 Knorr.</revremark>
371       </revision>
372
373       <revision>
374         <revnumber>0.1</revnumber>
375         <date>2002-12-01</date>
376         <authorinitials>mhs</authorinitials>
377         <revremark>First draft, based on documentation by Bill Dirks
378 and discussions on the V4L mailing list.</revremark>
379       </revision>
380     </revhistory>
381 </partinfo>
382
383 <title>Video for Linux Two API Specification</title>
384  <subtitle>Revision 2.6.33</subtitle>
385
386   <chapter id="common">
387     &sub-common;
388   </chapter>
389
390   <chapter id="pixfmt">
391     &sub-pixfmt;
392   </chapter>
393
394   <chapter id="io">
395     &sub-io;
396   </chapter>
397
398   <chapter id="devices">
399     <title>Interfaces</title>
400
401     <section id="capture"> &sub-dev-capture; </section>
402     <section id="overlay"> &sub-dev-overlay; </section>
403     <section id="output"> &sub-dev-output; </section>
404     <section id="osd"> &sub-dev-osd; </section>
405     <section id="codec"> &sub-dev-codec; </section>
406     <section id="effect"> &sub-dev-effect; </section>
407     <section id="raw-vbi"> &sub-dev-raw-vbi; </section>
408     <section id="sliced"> &sub-dev-sliced-vbi; </section>
409     <section id="ttx"> &sub-dev-teletext; </section>
410     <section id="radio"> &sub-dev-radio; </section>
411     <section id="rds"> &sub-dev-rds; </section>
412     <section id="event"> &sub-dev-event; </section>
413   </chapter>
414
415   <chapter id="driver">
416           &sub-driver;
417   </chapter>
418
419   <chapter id="libv4l">
420           &sub-libv4l;
421   </chapter>
422
423   <chapter id="compat">
424           &sub-compat;
425   </chapter>
426
427   <appendix id="user-func">
428   <title>Function Reference</title>
429
430     <!-- Keep this alphabetically sorted. -->
431
432     &sub-close;
433     &sub-ioctl;
434     <!-- All ioctls go here. -->
435     &sub-cropcap;
436     &sub-dbg-g-chip-ident;
437     &sub-dbg-g-register;
438     &sub-dqevent;
439     &sub-encoder-cmd;
440     &sub-enumaudio;
441     &sub-enumaudioout;
442     &sub-enum-dv-presets;
443     &sub-enum-fmt;
444     &sub-enum-framesizes;
445     &sub-enum-frameintervals;
446     &sub-enuminput;
447     &sub-enumoutput;
448     &sub-enumstd;
449     &sub-g-audio;
450     &sub-g-audioout;
451     &sub-g-crop;
452     &sub-g-ctrl;
453     &sub-g-dv-preset;
454     &sub-g-dv-timings;
455     &sub-g-enc-index;
456     &sub-g-ext-ctrls;
457     &sub-g-fbuf;
458     &sub-g-fmt;
459     &sub-g-frequency;
460     &sub-g-input;
461     &sub-g-jpegcomp;
462     &sub-g-modulator;
463     &sub-g-output;
464     &sub-g-parm;
465     &sub-g-priority;
466     &sub-g-sliced-vbi-cap;
467     &sub-g-std;
468     &sub-g-tuner;
469     &sub-log-status;
470     &sub-overlay;
471     &sub-qbuf;
472     &sub-querybuf;
473     &sub-querycap;
474     &sub-queryctrl;
475     &sub-query-dv-preset;
476     &sub-querystd;
477     &sub-reqbufs;
478     &sub-s-hw-freq-seek;
479     &sub-streamon;
480     &sub-subscribe-event;
481     <!-- End of ioctls. -->
482     &sub-mmap;
483     &sub-munmap;
484     &sub-open;
485     &sub-poll;
486     &sub-read;
487     &sub-select;
488     &sub-write;
489   </appendix>
490
491   <appendix id="videodev">
492     <title>Video For Linux Two Header File</title>
493     &sub-videodev2-h;
494   </appendix>
495
496   <appendix id="capture-example">
497     <title>Video Capture Example</title>
498     &sub-capture-c;
499   </appendix>
500
501   <appendix id="v4l2grab-example">
502     <title>Video Grabber example using libv4l</title>
503     <para>This program demonstrates how to grab V4L2 images in ppm format by
504 using libv4l handlers. The advantage is that this grabber can potentially work
505 with any V4L2 driver.</para>
506     &sub-v4l2grab-c;
507   </appendix>
508
509   &sub-media-indices;
510
511   &sub-biblio;
512