Merge remote-tracking branch 'regulator/topic/apply' into regulator-next
[cascardo/linux.git] / Documentation / DocBook / media / 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, major parts of the sliced VBI API, the
32 MPEG encoder and decoder APIs and the DV Timings 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
89       <author>
90         <firstname>Pawel</firstname>
91         <surname>Osciak</surname>
92         <contrib>Designed and documented the multi-planar API.</contrib>
93         <affiliation>
94           <address>
95             <email>pawel AT osciak.com</email>
96           </address>
97         </affiliation>
98       </author>
99
100       <author>
101         <firstname>Sakari</firstname>
102         <surname>Ailus</surname>
103         <contrib>Subdev selections API.</contrib>
104         <affiliation>
105           <address>
106             <email>sakari.ailus@iki.fi</email>
107           </address>
108         </affiliation>
109       </author>
110     </authorgroup>
111
112     <copyright>
113       <year>1999</year>
114       <year>2000</year>
115       <year>2001</year>
116       <year>2002</year>
117       <year>2003</year>
118       <year>2004</year>
119       <year>2005</year>
120       <year>2006</year>
121       <year>2007</year>
122       <year>2008</year>
123       <year>2009</year>
124       <year>2010</year>
125       <year>2011</year>
126       <year>2012</year>
127       <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
128 Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab,
129         Pawel Osciak</holder>
130     </copyright>
131     <legalnotice>
132     <para>Except when explicitly stated as GPL, programming examples within
133             this part can be used and distributed without restrictions.</para>
134     </legalnotice>
135     <revhistory>
136       <!-- Put document revisions here, newest first. -->
137       <!-- API revisions (changes and additions of defines, enums,
138 structs, ioctls) must be noted in more detail in the history chapter
139 (compat.xml), along with the possible impact on existing drivers and
140 applications. -->
141
142       <revision>
143         <revnumber>3.6</revnumber>
144         <date>2012-07-02</date>
145         <authorinitials>hv</authorinitials>
146         <revremark>Added VIDIOC_ENUM_FREQ_BANDS.
147         </revremark>
148       </revision>
149
150       <revision>
151         <revnumber>3.5</revnumber>
152         <date>2012-05-07</date>
153         <authorinitials>sa, sn, hv</authorinitials>
154         <revremark>Added V4L2_CTRL_TYPE_INTEGER_MENU and V4L2 subdev
155             selections API. Improved the description of V4L2_CID_COLORFX
156             control, added V4L2_CID_COLORFX_CBCR control.
157             Added camera controls V4L2_CID_AUTO_EXPOSURE_BIAS,
158             V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE, V4L2_CID_IMAGE_STABILIZATION,
159             V4L2_CID_ISO_SENSITIVITY, V4L2_CID_ISO_SENSITIVITY_AUTO,
160             V4L2_CID_EXPOSURE_METERING, V4L2_CID_SCENE_MODE,
161             V4L2_CID_3A_LOCK, V4L2_CID_AUTO_FOCUS_START,
162             V4L2_CID_AUTO_FOCUS_STOP, V4L2_CID_AUTO_FOCUS_STATUS
163             and V4L2_CID_AUTO_FOCUS_RANGE.
164             Added VIDIOC_ENUM_DV_TIMINGS, VIDIOC_QUERY_DV_TIMINGS and
165             VIDIOC_DV_TIMINGS_CAP.
166         </revremark>
167       </revision>
168
169       <revision>
170         <revnumber>3.4</revnumber>
171         <date>2012-01-25</date>
172         <authorinitials>sn</authorinitials>
173         <revremark>Added <link linkend="jpeg-controls">JPEG compression
174             control class.</link>
175         </revremark>
176       </revision>
177
178       <revision>
179         <revnumber>3.3</revnumber>
180         <date>2012-01-11</date>
181         <authorinitials>hv</authorinitials>
182         <revremark>Added device_caps field to struct v4l2_capabilities.</revremark>
183       </revision>
184
185       <revision>
186         <revnumber>3.2</revnumber>
187         <date>2011-08-26</date>
188         <authorinitials>hv</authorinitials>
189         <revremark>Added V4L2_CTRL_FLAG_VOLATILE.</revremark>
190       </revision>
191
192       <revision>
193         <revnumber>3.1</revnumber>
194         <date>2011-06-27</date>
195         <authorinitials>mcc, po, hv</authorinitials>
196         <revremark>Documented that VIDIOC_QUERYCAP now returns a per-subsystem version instead of a per-driver one.
197                    Standardize an error code for invalid ioctl.
198                    Added V4L2_CTRL_TYPE_BITMASK.</revremark>
199       </revision>
200
201       <revision>
202         <revnumber>2.6.39</revnumber>
203         <date>2011-03-01</date>
204         <authorinitials>mcc, po</authorinitials>
205         <revremark>Removed VIDIOC_*_OLD from videodev2.h header and update it to reflect latest changes. Added the <link linkend="planar-apis">multi-planar API</link>.</revremark>
206       </revision>
207
208       <revision>
209         <revnumber>2.6.37</revnumber>
210         <date>2010-08-06</date>
211         <authorinitials>hv</authorinitials>
212         <revremark>Removed obsolete vtx (videotext) API.</revremark>
213       </revision>
214
215       <revision>
216         <revnumber>2.6.33</revnumber>
217         <date>2009-12-03</date>
218         <authorinitials>mk</authorinitials>
219         <revremark>Added documentation for the Digital Video timings API.</revremark>
220       </revision>
221
222       <revision>
223         <revnumber>2.6.32</revnumber>
224         <date>2009-08-31</date>
225         <authorinitials>mcc</authorinitials>
226         <revremark>Now, revisions will match the kernel version where
227 the V4L2 API changes will be used by the Linux Kernel.
228 Also added Remote Controller chapter.</revremark>
229       </revision>
230
231       <revision>
232         <revnumber>0.29</revnumber>
233         <date>2009-08-26</date>
234         <authorinitials>ev</authorinitials>
235         <revremark>Added documentation for string controls and for FM Transmitter controls.</revremark>
236       </revision>
237
238       <revision>
239         <revnumber>0.28</revnumber>
240         <date>2009-08-26</date>
241         <authorinitials>gl</authorinitials>
242         <revremark>Added V4L2_CID_BAND_STOP_FILTER documentation.</revremark>
243       </revision>
244
245       <revision>
246         <revnumber>0.27</revnumber>
247         <date>2009-08-15</date>
248         <authorinitials>mcc</authorinitials>
249         <revremark>Added libv4l and Remote Controller documentation;
250 added v4l2grab and keytable application examples.</revremark>
251       </revision>
252
253       <revision>
254         <revnumber>0.26</revnumber>
255         <date>2009-07-23</date>
256         <authorinitials>hv</authorinitials>
257         <revremark>Finalized the RDS capture API. Added modulator and RDS encoder
258 capabilities. Added support for string controls.</revremark>
259       </revision>
260
261       <revision>
262         <revnumber>0.25</revnumber>
263         <date>2009-01-18</date>
264         <authorinitials>hv</authorinitials>
265         <revremark>Added pixel formats VYUY, NV16 and NV61, and changed
266 the debug ioctls VIDIOC_DBG_G/S_REGISTER and VIDIOC_DBG_G_CHIP_IDENT.
267 Added camera controls V4L2_CID_ZOOM_ABSOLUTE, V4L2_CID_ZOOM_RELATIVE,
268 V4L2_CID_ZOOM_CONTINUOUS and V4L2_CID_PRIVACY.</revremark>
269       </revision>
270
271       <revision>
272         <revnumber>0.24</revnumber>
273         <date>2008-03-04</date>
274         <authorinitials>mhs</authorinitials>
275         <revremark>Added pixel formats Y16 and SBGGR16, new controls
276 and a camera controls class. Removed VIDIOC_G/S_MPEGCOMP.</revremark>
277       </revision>
278
279       <revision>
280         <revnumber>0.23</revnumber>
281         <date>2007-08-30</date>
282         <authorinitials>mhs</authorinitials>
283         <revremark>Fixed a typo in VIDIOC_DBG_G/S_REGISTER.
284 Clarified the byte order of packed pixel formats.</revremark>
285       </revision>
286
287       <revision>
288         <revnumber>0.22</revnumber>
289         <date>2007-08-29</date>
290         <authorinitials>mhs</authorinitials>
291         <revremark>Added the Video Output Overlay interface, new MPEG
292 controls, V4L2_FIELD_INTERLACED_TB and V4L2_FIELD_INTERLACED_BT,
293 VIDIOC_DBG_G/S_REGISTER, VIDIOC_(TRY_)ENCODER_CMD,
294 VIDIOC_G_CHIP_IDENT, VIDIOC_G_ENC_INDEX, new pixel formats.
295 Clarifications in the cropping chapter, about RGB pixel formats, the
296 mmap(), poll(), select(), read() and write() functions. Typographical
297 fixes.</revremark>
298       </revision>
299
300       <revision>
301         <revnumber>0.21</revnumber>
302         <date>2006-12-19</date>
303         <authorinitials>mhs</authorinitials>
304         <revremark>Fixed a link in the VIDIOC_G_EXT_CTRLS section.</revremark>
305       </revision>
306
307       <revision>
308         <revnumber>0.20</revnumber>
309         <date>2006-11-24</date>
310         <authorinitials>mhs</authorinitials>
311         <revremark>Clarified the purpose of the audioset field in
312 struct v4l2_input and v4l2_output.</revremark>
313       </revision>
314
315       <revision>
316         <revnumber>0.19</revnumber>
317         <date>2006-10-19</date>
318         <authorinitials>mhs</authorinitials>
319         <revremark>Documented V4L2_PIX_FMT_RGB444.</revremark>
320       </revision>
321
322       <revision>
323         <revnumber>0.18</revnumber>
324         <date>2006-10-18</date>
325         <authorinitials>mhs</authorinitials>
326         <revremark>Added the description of extended controls by Hans
327 Verkuil. Linked V4L2_PIX_FMT_MPEG to V4L2_CID_MPEG_STREAM_TYPE.</revremark>
328       </revision>
329
330       <revision>
331         <revnumber>0.17</revnumber>
332         <date>2006-10-12</date>
333         <authorinitials>mhs</authorinitials>
334         <revremark>Corrected V4L2_PIX_FMT_HM12 description.</revremark>
335       </revision>
336
337       <revision>
338         <revnumber>0.16</revnumber>
339         <date>2006-10-08</date>
340         <authorinitials>mhs</authorinitials>
341         <revremark>VIDIOC_ENUM_FRAMESIZES and
342 VIDIOC_ENUM_FRAMEINTERVALS are now part of the API.</revremark>
343       </revision>
344
345       <revision>
346         <revnumber>0.15</revnumber>
347         <date>2006-09-23</date>
348         <authorinitials>mhs</authorinitials>
349         <revremark>Cleaned up the bibliography, added BT.653 and
350 BT.1119. capture.c/start_capturing() for user pointer I/O did not
351 initialize the buffer index. Documented the V4L MPEG and MJPEG
352 VID_TYPEs and V4L2_PIX_FMT_SBGGR8. Updated the list of reserved pixel
353 formats. See the history chapter for API changes.</revremark>
354       </revision>
355
356       <revision>
357         <revnumber>0.14</revnumber>
358         <date>2006-09-14</date>
359         <authorinitials>mr</authorinitials>
360         <revremark>Added VIDIOC_ENUM_FRAMESIZES and
361 VIDIOC_ENUM_FRAMEINTERVALS proposal for frame format enumeration of
362 digital devices.</revremark>
363       </revision>
364
365       <revision>
366         <revnumber>0.13</revnumber>
367         <date>2006-04-07</date>
368         <authorinitials>mhs</authorinitials>
369         <revremark>Corrected the description of struct v4l2_window
370 clips. New V4L2_STD_ and V4L2_TUNER_MODE_LANG1_LANG2
371 defines.</revremark>
372       </revision>
373
374       <revision>
375         <revnumber>0.12</revnumber>
376         <date>2006-02-03</date>
377         <authorinitials>mhs</authorinitials>
378         <revremark>Corrected the description of struct
379 v4l2_captureparm and v4l2_outputparm.</revremark>
380       </revision>
381
382       <revision>
383         <revnumber>0.11</revnumber>
384         <date>2006-01-27</date>
385         <authorinitials>mhs</authorinitials>
386         <revremark>Improved the description of struct
387 v4l2_tuner.</revremark>
388       </revision>
389
390       <revision>
391         <revnumber>0.10</revnumber>
392         <date>2006-01-10</date>
393         <authorinitials>mhs</authorinitials>
394         <revremark>VIDIOC_G_INPUT and VIDIOC_S_PARM
395 clarifications.</revremark>
396       </revision>
397
398       <revision>
399         <revnumber>0.9</revnumber>
400         <date>2005-11-27</date>
401         <authorinitials>mhs</authorinitials>
402         <revremark>Improved the 525 line numbering diagram. Hans
403 Verkuil and I rewrote the sliced VBI section. He also contributed a
404 VIDIOC_LOG_STATUS page. Fixed VIDIOC_S_STD call in the video standard
405 selection example. Various updates.</revremark>
406       </revision>
407
408       <revision>
409         <revnumber>0.8</revnumber>
410         <date>2004-10-04</date>
411         <authorinitials>mhs</authorinitials>
412         <revremark>Somehow a piece of junk slipped into the capture
413 example, removed.</revremark>
414       </revision>
415
416       <revision>
417         <revnumber>0.7</revnumber>
418         <date>2004-09-19</date>
419         <authorinitials>mhs</authorinitials>
420         <revremark>Fixed video standard selection, control
421 enumeration, downscaling and aspect example. Added read and user
422 pointer i/o to video capture example.</revremark>
423       </revision>
424
425       <revision>
426         <revnumber>0.6</revnumber>
427         <date>2004-08-01</date>
428         <authorinitials>mhs</authorinitials>
429         <revremark>v4l2_buffer changes, added video capture example,
430 various corrections.</revremark>
431       </revision>
432
433       <revision>
434         <revnumber>0.5</revnumber>
435         <date>2003-11-05</date>
436         <authorinitials>mhs</authorinitials>
437         <revremark>Pixel format erratum.</revremark>
438       </revision>
439
440       <revision>
441         <revnumber>0.4</revnumber>
442         <date>2003-09-17</date>
443         <authorinitials>mhs</authorinitials>
444         <revremark>Corrected source and Makefile to generate a PDF.
445 SGML fixes. Added latest API changes. Closed gaps in the history
446 chapter.</revremark>
447       </revision>
448
449       <revision>
450         <revnumber>0.3</revnumber>
451         <date>2003-02-05</date>
452         <authorinitials>mhs</authorinitials>
453         <revremark>Another draft, more corrections.</revremark>
454       </revision>
455
456       <revision>
457         <revnumber>0.2</revnumber>
458         <date>2003-01-15</date>
459         <authorinitials>mhs</authorinitials>
460         <revremark>Second draft, with corrections pointed out by Gerd
461 Knorr.</revremark>
462       </revision>
463
464       <revision>
465         <revnumber>0.1</revnumber>
466         <date>2002-12-01</date>
467         <authorinitials>mhs</authorinitials>
468         <revremark>First draft, based on documentation by Bill Dirks
469 and discussions on the V4L mailing list.</revremark>
470       </revision>
471     </revhistory>
472 </partinfo>
473
474 <title>Video for Linux Two API Specification</title>
475  <subtitle>Revision 3.6</subtitle>
476
477   <chapter id="common">
478     &sub-common;
479   </chapter>
480
481   <chapter id="pixfmt">
482     &sub-pixfmt;
483   </chapter>
484
485   <chapter id="io">
486     &sub-io;
487   </chapter>
488
489   <chapter id="devices">
490     <title>Interfaces</title>
491
492     <section id="capture"> &sub-dev-capture; </section>
493     <section id="overlay"> &sub-dev-overlay; </section>
494     <section id="output"> &sub-dev-output; </section>
495     <section id="osd"> &sub-dev-osd; </section>
496     <section id="codec"> &sub-dev-codec; </section>
497     <section id="effect"> &sub-dev-effect; </section>
498     <section id="raw-vbi"> &sub-dev-raw-vbi; </section>
499     <section id="sliced"> &sub-dev-sliced-vbi; </section>
500     <section id="ttx"> &sub-dev-teletext; </section>
501     <section id="radio"> &sub-dev-radio; </section>
502     <section id="rds"> &sub-dev-rds; </section>
503     <section id="event"> &sub-dev-event; </section>
504     <section id="subdev"> &sub-dev-subdev; </section>
505   </chapter>
506
507   <chapter id="driver">
508           &sub-driver;
509   </chapter>
510
511   <chapter id="libv4l">
512           &sub-libv4l;
513   </chapter>
514
515   <chapter id="compat">
516           &sub-compat;
517   </chapter>
518
519   <appendix id="user-func">
520   <title>Function Reference</title>
521
522     <!-- Keep this alphabetically sorted. -->
523
524     &sub-close;
525     &sub-ioctl;
526     <!-- All ioctls go here. -->
527     &sub-create-bufs;
528     &sub-cropcap;
529     &sub-dbg-g-chip-ident;
530     &sub-dbg-g-register;
531     &sub-decoder-cmd;
532     &sub-dqevent;
533     &sub-dv-timings-cap;
534     &sub-encoder-cmd;
535     &sub-enumaudio;
536     &sub-enumaudioout;
537     &sub-enum-dv-presets;
538     &sub-enum-dv-timings;
539     &sub-enum-fmt;
540     &sub-enum-framesizes;
541     &sub-enum-frameintervals;
542     &sub-enum-freq-bands;
543     &sub-enuminput;
544     &sub-enumoutput;
545     &sub-enumstd;
546     &sub-expbuf;
547     &sub-g-audio;
548     &sub-g-audioout;
549     &sub-g-crop;
550     &sub-g-ctrl;
551     &sub-g-dv-preset;
552     &sub-g-dv-timings;
553     &sub-g-enc-index;
554     &sub-g-ext-ctrls;
555     &sub-g-fbuf;
556     &sub-g-fmt;
557     &sub-g-frequency;
558     &sub-g-input;
559     &sub-g-jpegcomp;
560     &sub-g-modulator;
561     &sub-g-output;
562     &sub-g-parm;
563     &sub-g-priority;
564     &sub-g-selection;
565     &sub-g-sliced-vbi-cap;
566     &sub-g-std;
567     &sub-g-tuner;
568     &sub-log-status;
569     &sub-overlay;
570     &sub-prepare-buf;
571     &sub-qbuf;
572     &sub-querybuf;
573     &sub-querycap;
574     &sub-queryctrl;
575     &sub-query-dv-preset;
576     &sub-query-dv-timings;
577     &sub-querystd;
578     &sub-reqbufs;
579     &sub-s-hw-freq-seek;
580     &sub-streamon;
581     &sub-subdev-enum-frame-interval;
582     &sub-subdev-enum-frame-size;
583     &sub-subdev-enum-mbus-code;
584     &sub-subdev-g-crop;
585     &sub-subdev-g-edid;
586     &sub-subdev-g-fmt;
587     &sub-subdev-g-frame-interval;
588     &sub-subdev-g-selection;
589     &sub-subscribe-event;
590     <!-- End of ioctls. -->
591     &sub-mmap;
592     &sub-munmap;
593     &sub-open;
594     &sub-poll;
595     &sub-read;
596     &sub-select;
597     &sub-write;
598   </appendix>
599
600   <appendix>
601     <title>Common definitions for V4L2 and V4L2 subdev interfaces</title>
602       &sub-selections-common;
603   </appendix>
604
605   <appendix id="videodev">
606     <title>Video For Linux Two Header File</title>
607     &sub-videodev2-h;
608   </appendix>
609
610   <appendix id="capture-example">
611     <title>Video Capture Example</title>
612     &sub-capture-c;
613   </appendix>
614
615   <appendix id="v4l2grab-example">
616     <title>Video Grabber example using libv4l</title>
617     <para>This program demonstrates how to grab V4L2 images in ppm format by
618 using libv4l handlers. The advantage is that this grabber can potentially work
619 with any V4L2 driver.</para>
620     &sub-v4l2grab-c;
621   </appendix>
622
623   &sub-media-indices;
624
625   &sub-biblio;
626