blob: dcf9e33b695f8f5de02aa9ed9de9e7f7d9efc154 [file] [log] [blame]
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -03001 <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
24documentation.</contrib>
25 </author>
26
27 <author>
28 <firstname>Hans</firstname>
29 <surname>Verkuil</surname>
30 <contrib>Designed and documented the VIDIOC_LOG_STATUS ioctl,
31the extended control ioctls and major parts of the sliced VBI
32API.</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
50and 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
57MPEG stream embedded, sliced VBI data format in this specification.
58</contrib>
59 <affiliation>
60 <address>
Andy Walls6afdeaf2010-05-23 18:53:35 -030061 <email>awalls@md.metrocast.net</email>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -030062 </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,
70Remote Controller chapter.</contrib>
71 <affiliation>
72 <address>
73 <email>mchehab@redhat.com</email>
74 </address>
75 </affiliation>
76 </author>
Hans Verkuilb33f5f82009-12-03 01:32:12 -030077
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>
Pawel Osciak53b5d572011-01-07 01:41:33 -030088
89 <author>
Hans Verkuilaec67f02011-05-23 07:36:55 -030090 <firstname>Pawel</firstname>
Pawel Osciak53b5d572011-01-07 01:41:33 -030091 <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>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -030099 </authorgroup>
100
101 <copyright>
102 <year>1999</year>
103 <year>2000</year>
104 <year>2001</year>
105 <year>2002</year>
106 <year>2003</year>
107 <year>2004</year>
108 <year>2005</year>
109 <year>2006</year>
110 <year>2007</year>
111 <year>2008</year>
112 <year>2009</year>
Hans Verkuilf44026d2010-08-06 12:52:43 -0300113 <year>2010</year>
Hans Verkuilbda50bc2011-01-16 17:44:17 -0300114 <year>2011</year>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300115 <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
Pawel Osciak53b5d572011-01-07 01:41:33 -0300116Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab,
117 Pawel Osciak</holder>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300118 </copyright>
119 <legalnotice>
120 <para>Except when explicitly stated as GPL, programming examples within
121 this part can be used and distributed without restrictions.</para>
122 </legalnotice>
123 <revhistory>
124 <!-- Put document revisions here, newest first. -->
125 <!-- API revisions (changes and additions of defines, enums,
126structs, ioctls) must be noted in more detail in the history chapter
Hans Verkuilf44026d2010-08-06 12:52:43 -0300127(compat.xml), along with the possible impact on existing drivers and
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300128applications. -->
129
130 <revision>
Hans Verkuil583aa3a2012-01-11 06:45:05 -0300131 <revnumber>3.3</revnumber>
132 <date>2012-01-11</date>
133 <authorinitials>hv</authorinitials>
134 <revremark>Added device_caps field to struct v4l2_capabilities.</revremark>
135 </revision>
136
137 <revision>
Hans Verkuil74a45792011-08-26 07:31:13 -0300138 <revnumber>3.2</revnumber>
139 <date>2011-08-26</date>
140 <authorinitials>hv</authorinitials>
141 <revremark>Added V4L2_CTRL_FLAG_VOLATILE.</revremark>
142 </revision>
143
144 <revision>
Mauro Carvalho Chehabc20eb182011-06-25 14:11:52 -0300145 <revnumber>3.1</revnumber>
146 <date>2011-06-27</date>
Hans Verkuilaec67f02011-05-23 07:36:55 -0300147 <authorinitials>mcc, po, hv</authorinitials>
148 <revremark>Documented that VIDIOC_QUERYCAP now returns a per-subsystem version instead of a per-driver one.
149 Standardize an error code for invalid ioctl.
150 Added V4L2_CTRL_TYPE_BITMASK.</revremark>
Mauro Carvalho Chehabc20eb182011-06-25 14:11:52 -0300151 </revision>
Mauro Carvalho Chehab9190d192011-07-06 14:08:08 -0300152
Mauro Carvalho Chehabc20eb182011-06-25 14:11:52 -0300153 <revision>
Mauro Carvalho Chehab3822f182011-03-01 16:03:11 -0300154 <revnumber>2.6.39</revnumber>
155 <date>2011-03-01</date>
Pawel Osciakf0e3b642011-03-13 15:20:22 -0300156 <authorinitials>mcc, po</authorinitials>
157 <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>
Pawel Osciak53b5d572011-01-07 01:41:33 -0300158 </revision>
159
160 <revision>
Hans Verkuilf44026d2010-08-06 12:52:43 -0300161 <revnumber>2.6.37</revnumber>
162 <date>2010-08-06</date>
163 <authorinitials>hv</authorinitials>
164 <revremark>Removed obsolete vtx (videotext) API.</revremark>
165 </revision>
166
167 <revision>
Hans Verkuilb33f5f82009-12-03 01:32:12 -0300168 <revnumber>2.6.33</revnumber>
169 <date>2009-12-03</date>
170 <authorinitials>mk</authorinitials>
171 <revremark>Added documentation for the Digital Video timings API.</revremark>
172 </revision>
173
174 <revision>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300175 <revnumber>2.6.32</revnumber>
176 <date>2009-08-31</date>
177 <authorinitials>mcc</authorinitials>
178 <revremark>Now, revisions will match the kernel version where
179the V4L2 API changes will be used by the Linux Kernel.
180Also added Remote Controller chapter.</revremark>
181 </revision>
182
183 <revision>
184 <revnumber>0.29</revnumber>
185 <date>2009-08-26</date>
186 <authorinitials>ev</authorinitials>
187 <revremark>Added documentation for string controls and for FM Transmitter controls.</revremark>
188 </revision>
189
190 <revision>
191 <revnumber>0.28</revnumber>
192 <date>2009-08-26</date>
193 <authorinitials>gl</authorinitials>
194 <revremark>Added V4L2_CID_BAND_STOP_FILTER documentation.</revremark>
195 </revision>
196
197 <revision>
198 <revnumber>0.27</revnumber>
199 <date>2009-08-15</date>
200 <authorinitials>mcc</authorinitials>
201 <revremark>Added libv4l and Remote Controller documentation;
202added v4l2grab and keytable application examples.</revremark>
203 </revision>
204
205 <revision>
206 <revnumber>0.26</revnumber>
207 <date>2009-07-23</date>
208 <authorinitials>hv</authorinitials>
209 <revremark>Finalized the RDS capture API. Added modulator and RDS encoder
210capabilities. Added support for string controls.</revremark>
211 </revision>
212
213 <revision>
214 <revnumber>0.25</revnumber>
215 <date>2009-01-18</date>
216 <authorinitials>hv</authorinitials>
217 <revremark>Added pixel formats VYUY, NV16 and NV61, and changed
218the debug ioctls VIDIOC_DBG_G/S_REGISTER and VIDIOC_DBG_G_CHIP_IDENT.
219Added camera controls V4L2_CID_ZOOM_ABSOLUTE, V4L2_CID_ZOOM_RELATIVE,
220V4L2_CID_ZOOM_CONTINUOUS and V4L2_CID_PRIVACY.</revremark>
221 </revision>
222
223 <revision>
224 <revnumber>0.24</revnumber>
225 <date>2008-03-04</date>
226 <authorinitials>mhs</authorinitials>
227 <revremark>Added pixel formats Y16 and SBGGR16, new controls
228and a camera controls class. Removed VIDIOC_G/S_MPEGCOMP.</revremark>
229 </revision>
230
231 <revision>
232 <revnumber>0.23</revnumber>
233 <date>2007-08-30</date>
234 <authorinitials>mhs</authorinitials>
235 <revremark>Fixed a typo in VIDIOC_DBG_G/S_REGISTER.
236Clarified the byte order of packed pixel formats.</revremark>
237 </revision>
238
239 <revision>
240 <revnumber>0.22</revnumber>
241 <date>2007-08-29</date>
242 <authorinitials>mhs</authorinitials>
243 <revremark>Added the Video Output Overlay interface, new MPEG
244controls, V4L2_FIELD_INTERLACED_TB and V4L2_FIELD_INTERLACED_BT,
245VIDIOC_DBG_G/S_REGISTER, VIDIOC_(TRY_)ENCODER_CMD,
246VIDIOC_G_CHIP_IDENT, VIDIOC_G_ENC_INDEX, new pixel formats.
247Clarifications in the cropping chapter, about RGB pixel formats, the
248mmap(), poll(), select(), read() and write() functions. Typographical
249fixes.</revremark>
250 </revision>
251
252 <revision>
253 <revnumber>0.21</revnumber>
254 <date>2006-12-19</date>
255 <authorinitials>mhs</authorinitials>
256 <revremark>Fixed a link in the VIDIOC_G_EXT_CTRLS section.</revremark>
257 </revision>
258
259 <revision>
260 <revnumber>0.20</revnumber>
261 <date>2006-11-24</date>
262 <authorinitials>mhs</authorinitials>
263 <revremark>Clarified the purpose of the audioset field in
264struct v4l2_input and v4l2_output.</revremark>
265 </revision>
266
267 <revision>
268 <revnumber>0.19</revnumber>
269 <date>2006-10-19</date>
270 <authorinitials>mhs</authorinitials>
271 <revremark>Documented V4L2_PIX_FMT_RGB444.</revremark>
272 </revision>
273
274 <revision>
275 <revnumber>0.18</revnumber>
276 <date>2006-10-18</date>
277 <authorinitials>mhs</authorinitials>
278 <revremark>Added the description of extended controls by Hans
279Verkuil. Linked V4L2_PIX_FMT_MPEG to V4L2_CID_MPEG_STREAM_TYPE.</revremark>
280 </revision>
281
282 <revision>
283 <revnumber>0.17</revnumber>
284 <date>2006-10-12</date>
285 <authorinitials>mhs</authorinitials>
286 <revremark>Corrected V4L2_PIX_FMT_HM12 description.</revremark>
287 </revision>
288
289 <revision>
290 <revnumber>0.16</revnumber>
291 <date>2006-10-08</date>
292 <authorinitials>mhs</authorinitials>
293 <revremark>VIDIOC_ENUM_FRAMESIZES and
294VIDIOC_ENUM_FRAMEINTERVALS are now part of the API.</revremark>
295 </revision>
296
297 <revision>
298 <revnumber>0.15</revnumber>
299 <date>2006-09-23</date>
300 <authorinitials>mhs</authorinitials>
301 <revremark>Cleaned up the bibliography, added BT.653 and
302BT.1119. capture.c/start_capturing() for user pointer I/O did not
303initialize the buffer index. Documented the V4L MPEG and MJPEG
304VID_TYPEs and V4L2_PIX_FMT_SBGGR8. Updated the list of reserved pixel
305formats. See the history chapter for API changes.</revremark>
306 </revision>
307
308 <revision>
309 <revnumber>0.14</revnumber>
310 <date>2006-09-14</date>
311 <authorinitials>mr</authorinitials>
312 <revremark>Added VIDIOC_ENUM_FRAMESIZES and
313VIDIOC_ENUM_FRAMEINTERVALS proposal for frame format enumeration of
314digital devices.</revremark>
315 </revision>
316
317 <revision>
318 <revnumber>0.13</revnumber>
319 <date>2006-04-07</date>
320 <authorinitials>mhs</authorinitials>
321 <revremark>Corrected the description of struct v4l2_window
322clips. New V4L2_STD_ and V4L2_TUNER_MODE_LANG1_LANG2
323defines.</revremark>
324 </revision>
325
326 <revision>
327 <revnumber>0.12</revnumber>
328 <date>2006-02-03</date>
329 <authorinitials>mhs</authorinitials>
330 <revremark>Corrected the description of struct
331v4l2_captureparm and v4l2_outputparm.</revremark>
332 </revision>
333
334 <revision>
335 <revnumber>0.11</revnumber>
336 <date>2006-01-27</date>
337 <authorinitials>mhs</authorinitials>
338 <revremark>Improved the description of struct
339v4l2_tuner.</revremark>
340 </revision>
341
342 <revision>
343 <revnumber>0.10</revnumber>
344 <date>2006-01-10</date>
345 <authorinitials>mhs</authorinitials>
346 <revremark>VIDIOC_G_INPUT and VIDIOC_S_PARM
347clarifications.</revremark>
348 </revision>
349
350 <revision>
351 <revnumber>0.9</revnumber>
352 <date>2005-11-27</date>
353 <authorinitials>mhs</authorinitials>
354 <revremark>Improved the 525 line numbering diagram. Hans
355Verkuil and I rewrote the sliced VBI section. He also contributed a
356VIDIOC_LOG_STATUS page. Fixed VIDIOC_S_STD call in the video standard
357selection example. Various updates.</revremark>
358 </revision>
359
360 <revision>
361 <revnumber>0.8</revnumber>
362 <date>2004-10-04</date>
363 <authorinitials>mhs</authorinitials>
364 <revremark>Somehow a piece of junk slipped into the capture
365example, removed.</revremark>
366 </revision>
367
368 <revision>
369 <revnumber>0.7</revnumber>
370 <date>2004-09-19</date>
371 <authorinitials>mhs</authorinitials>
372 <revremark>Fixed video standard selection, control
373enumeration, downscaling and aspect example. Added read and user
374pointer i/o to video capture example.</revremark>
375 </revision>
376
377 <revision>
378 <revnumber>0.6</revnumber>
379 <date>2004-08-01</date>
380 <authorinitials>mhs</authorinitials>
381 <revremark>v4l2_buffer changes, added video capture example,
382various corrections.</revremark>
383 </revision>
384
385 <revision>
386 <revnumber>0.5</revnumber>
387 <date>2003-11-05</date>
388 <authorinitials>mhs</authorinitials>
389 <revremark>Pixel format erratum.</revremark>
390 </revision>
391
392 <revision>
393 <revnumber>0.4</revnumber>
394 <date>2003-09-17</date>
395 <authorinitials>mhs</authorinitials>
396 <revremark>Corrected source and Makefile to generate a PDF.
397SGML fixes. Added latest API changes. Closed gaps in the history
398chapter.</revremark>
399 </revision>
400
401 <revision>
402 <revnumber>0.3</revnumber>
403 <date>2003-02-05</date>
404 <authorinitials>mhs</authorinitials>
405 <revremark>Another draft, more corrections.</revremark>
406 </revision>
407
408 <revision>
409 <revnumber>0.2</revnumber>
410 <date>2003-01-15</date>
411 <authorinitials>mhs</authorinitials>
412 <revremark>Second draft, with corrections pointed out by Gerd
413Knorr.</revremark>
414 </revision>
415
416 <revision>
417 <revnumber>0.1</revnumber>
418 <date>2002-12-01</date>
419 <authorinitials>mhs</authorinitials>
420 <revremark>First draft, based on documentation by Bill Dirks
421and discussions on the V4L mailing list.</revremark>
422 </revision>
423 </revhistory>
424</partinfo>
425
426<title>Video for Linux Two API Specification</title>
Hans Verkuil583aa3a2012-01-11 06:45:05 -0300427 <subtitle>Revision 3.3</subtitle>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300428
429 <chapter id="common">
430 &sub-common;
431 </chapter>
432
433 <chapter id="pixfmt">
434 &sub-pixfmt;
435 </chapter>
436
437 <chapter id="io">
438 &sub-io;
439 </chapter>
440
441 <chapter id="devices">
442 <title>Interfaces</title>
443
444 <section id="capture"> &sub-dev-capture; </section>
445 <section id="overlay"> &sub-dev-overlay; </section>
446 <section id="output"> &sub-dev-output; </section>
447 <section id="osd"> &sub-dev-osd; </section>
448 <section id="codec"> &sub-dev-codec; </section>
449 <section id="effect"> &sub-dev-effect; </section>
450 <section id="raw-vbi"> &sub-dev-raw-vbi; </section>
451 <section id="sliced"> &sub-dev-sliced-vbi; </section>
452 <section id="ttx"> &sub-dev-teletext; </section>
453 <section id="radio"> &sub-dev-radio; </section>
454 <section id="rds"> &sub-dev-rds; </section>
Sakari Ailusdd966082010-03-27 10:58:24 -0300455 <section id="event"> &sub-dev-event; </section>
Laurent Pinchart333c8b92010-03-15 20:26:04 -0300456 <section id="subdev"> &sub-dev-subdev; </section>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300457 </chapter>
458
459 <chapter id="driver">
460 &sub-driver;
461 </chapter>
462
463 <chapter id="libv4l">
464 &sub-libv4l;
465 </chapter>
466
467 <chapter id="compat">
468 &sub-compat;
469 </chapter>
470
Mauro Carvalho Chehabdb17ab92009-09-17 01:44:22 -0300471 <appendix id="user-func">
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300472 <title>Function Reference</title>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300473
474 <!-- Keep this alphabetically sorted. -->
475
476 &sub-close;
477 &sub-ioctl;
478 <!-- All ioctls go here. -->
Guennadi Liakhovetski55093282011-09-28 08:10:58 -0300479 &sub-create-bufs;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300480 &sub-cropcap;
481 &sub-dbg-g-chip-ident;
482 &sub-dbg-g-register;
Hans Verkuil6b4f1252011-11-24 09:55:53 -0300483 &sub-decoder-cmd;
Sakari Ailusdd966082010-03-27 10:58:24 -0300484 &sub-dqevent;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300485 &sub-encoder-cmd;
486 &sub-enumaudio;
487 &sub-enumaudioout;
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300488 &sub-enum-dv-presets;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300489 &sub-enum-fmt;
490 &sub-enum-framesizes;
491 &sub-enum-frameintervals;
492 &sub-enuminput;
493 &sub-enumoutput;
494 &sub-enumstd;
495 &sub-g-audio;
496 &sub-g-audioout;
497 &sub-g-crop;
498 &sub-g-ctrl;
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300499 &sub-g-dv-preset;
500 &sub-g-dv-timings;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300501 &sub-g-enc-index;
502 &sub-g-ext-ctrls;
503 &sub-g-fbuf;
504 &sub-g-fmt;
505 &sub-g-frequency;
506 &sub-g-input;
507 &sub-g-jpegcomp;
508 &sub-g-modulator;
509 &sub-g-output;
510 &sub-g-parm;
511 &sub-g-priority;
Tomasz Stanislawski8af49222011-08-19 07:00:04 -0300512 &sub-g-selection;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300513 &sub-g-sliced-vbi-cap;
514 &sub-g-std;
515 &sub-g-tuner;
516 &sub-log-status;
517 &sub-overlay;
518 &sub-qbuf;
519 &sub-querybuf;
520 &sub-querycap;
521 &sub-queryctrl;
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300522 &sub-query-dv-preset;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300523 &sub-querystd;
Guennadi Liakhovetski55093282011-09-28 08:10:58 -0300524 &sub-prepare-buf;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300525 &sub-reqbufs;
526 &sub-s-hw-freq-seek;
527 &sub-streamon;
Laurent Pinchart35c30172010-05-05 11:38:35 -0300528 &sub-subdev-enum-frame-interval;
Laurent Pinchart333c8b92010-03-15 20:26:04 -0300529 &sub-subdev-enum-frame-size;
530 &sub-subdev-enum-mbus-code;
Antti Koskipaaf6a5cb12010-06-23 05:03:42 -0300531 &sub-subdev-g-crop;
Laurent Pinchart333c8b92010-03-15 20:26:04 -0300532 &sub-subdev-g-fmt;
Laurent Pinchart35c30172010-05-05 11:38:35 -0300533 &sub-subdev-g-frame-interval;
Sakari Ailusdd966082010-03-27 10:58:24 -0300534 &sub-subscribe-event;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300535 <!-- End of ioctls. -->
536 &sub-mmap;
537 &sub-munmap;
538 &sub-open;
539 &sub-poll;
540 &sub-read;
541 &sub-select;
542 &sub-write;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300543 </appendix>
544
545 <appendix id="videodev">
546 <title>Video For Linux Two Header File</title>
547 &sub-videodev2-h;
548 </appendix>
549
550 <appendix id="capture-example">
551 <title>Video Capture Example</title>
552 &sub-capture-c;
553 </appendix>
554
555 <appendix id="v4l2grab-example">
556 <title>Video Grabber example using libv4l</title>
557 <para>This program demonstrates how to grab V4L2 images in ppm format by
558using libv4l handlers. The advantage is that this grabber can potentially work
559with any V4L2 driver.</para>
560 &sub-v4l2grab-c;
561 </appendix>
562
563 &sub-media-indices;
564
565 &sub-biblio;
566