blob: 8ae38876172e6e4c83bcabcd351304bab41e5e3b [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>
Sylwester Nawrocki29fa0ee2012-01-20 15:38:50 -0300131 <revnumber>3.4</revnumber>
132 <date>2012-01-25</date>
133 <authorinitials>sn</authorinitials>
134 <revremark>Added <link linkend="jpeg-controls">JPEG compression
135 control class.</link>
136 </revremark>
137 </revision>
138
139 <revision>
Hans Verkuil583aa3a2012-01-11 06:45:05 -0300140 <revnumber>3.3</revnumber>
141 <date>2012-01-11</date>
142 <authorinitials>hv</authorinitials>
143 <revremark>Added device_caps field to struct v4l2_capabilities.</revremark>
144 </revision>
145
146 <revision>
Hans Verkuil74a45792011-08-26 07:31:13 -0300147 <revnumber>3.2</revnumber>
148 <date>2011-08-26</date>
149 <authorinitials>hv</authorinitials>
150 <revremark>Added V4L2_CTRL_FLAG_VOLATILE.</revremark>
151 </revision>
152
153 <revision>
Mauro Carvalho Chehabc20eb182011-06-25 14:11:52 -0300154 <revnumber>3.1</revnumber>
155 <date>2011-06-27</date>
Hans Verkuilaec67f02011-05-23 07:36:55 -0300156 <authorinitials>mcc, po, hv</authorinitials>
157 <revremark>Documented that VIDIOC_QUERYCAP now returns a per-subsystem version instead of a per-driver one.
158 Standardize an error code for invalid ioctl.
159 Added V4L2_CTRL_TYPE_BITMASK.</revremark>
Mauro Carvalho Chehabc20eb182011-06-25 14:11:52 -0300160 </revision>
Mauro Carvalho Chehab9190d192011-07-06 14:08:08 -0300161
Mauro Carvalho Chehabc20eb182011-06-25 14:11:52 -0300162 <revision>
Mauro Carvalho Chehab3822f182011-03-01 16:03:11 -0300163 <revnumber>2.6.39</revnumber>
164 <date>2011-03-01</date>
Pawel Osciakf0e3b642011-03-13 15:20:22 -0300165 <authorinitials>mcc, po</authorinitials>
166 <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 -0300167 </revision>
168
169 <revision>
Hans Verkuilf44026d2010-08-06 12:52:43 -0300170 <revnumber>2.6.37</revnumber>
171 <date>2010-08-06</date>
172 <authorinitials>hv</authorinitials>
173 <revremark>Removed obsolete vtx (videotext) API.</revremark>
174 </revision>
175
176 <revision>
Hans Verkuilb33f5f82009-12-03 01:32:12 -0300177 <revnumber>2.6.33</revnumber>
178 <date>2009-12-03</date>
179 <authorinitials>mk</authorinitials>
180 <revremark>Added documentation for the Digital Video timings API.</revremark>
181 </revision>
182
183 <revision>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300184 <revnumber>2.6.32</revnumber>
185 <date>2009-08-31</date>
186 <authorinitials>mcc</authorinitials>
187 <revremark>Now, revisions will match the kernel version where
188the V4L2 API changes will be used by the Linux Kernel.
189Also added Remote Controller chapter.</revremark>
190 </revision>
191
192 <revision>
193 <revnumber>0.29</revnumber>
194 <date>2009-08-26</date>
195 <authorinitials>ev</authorinitials>
196 <revremark>Added documentation for string controls and for FM Transmitter controls.</revremark>
197 </revision>
198
199 <revision>
200 <revnumber>0.28</revnumber>
201 <date>2009-08-26</date>
202 <authorinitials>gl</authorinitials>
203 <revremark>Added V4L2_CID_BAND_STOP_FILTER documentation.</revremark>
204 </revision>
205
206 <revision>
207 <revnumber>0.27</revnumber>
208 <date>2009-08-15</date>
209 <authorinitials>mcc</authorinitials>
210 <revremark>Added libv4l and Remote Controller documentation;
211added v4l2grab and keytable application examples.</revremark>
212 </revision>
213
214 <revision>
215 <revnumber>0.26</revnumber>
216 <date>2009-07-23</date>
217 <authorinitials>hv</authorinitials>
218 <revremark>Finalized the RDS capture API. Added modulator and RDS encoder
219capabilities. Added support for string controls.</revremark>
220 </revision>
221
222 <revision>
223 <revnumber>0.25</revnumber>
224 <date>2009-01-18</date>
225 <authorinitials>hv</authorinitials>
226 <revremark>Added pixel formats VYUY, NV16 and NV61, and changed
227the debug ioctls VIDIOC_DBG_G/S_REGISTER and VIDIOC_DBG_G_CHIP_IDENT.
228Added camera controls V4L2_CID_ZOOM_ABSOLUTE, V4L2_CID_ZOOM_RELATIVE,
229V4L2_CID_ZOOM_CONTINUOUS and V4L2_CID_PRIVACY.</revremark>
230 </revision>
231
232 <revision>
233 <revnumber>0.24</revnumber>
234 <date>2008-03-04</date>
235 <authorinitials>mhs</authorinitials>
236 <revremark>Added pixel formats Y16 and SBGGR16, new controls
237and a camera controls class. Removed VIDIOC_G/S_MPEGCOMP.</revremark>
238 </revision>
239
240 <revision>
241 <revnumber>0.23</revnumber>
242 <date>2007-08-30</date>
243 <authorinitials>mhs</authorinitials>
244 <revremark>Fixed a typo in VIDIOC_DBG_G/S_REGISTER.
245Clarified the byte order of packed pixel formats.</revremark>
246 </revision>
247
248 <revision>
249 <revnumber>0.22</revnumber>
250 <date>2007-08-29</date>
251 <authorinitials>mhs</authorinitials>
252 <revremark>Added the Video Output Overlay interface, new MPEG
253controls, V4L2_FIELD_INTERLACED_TB and V4L2_FIELD_INTERLACED_BT,
254VIDIOC_DBG_G/S_REGISTER, VIDIOC_(TRY_)ENCODER_CMD,
255VIDIOC_G_CHIP_IDENT, VIDIOC_G_ENC_INDEX, new pixel formats.
256Clarifications in the cropping chapter, about RGB pixel formats, the
257mmap(), poll(), select(), read() and write() functions. Typographical
258fixes.</revremark>
259 </revision>
260
261 <revision>
262 <revnumber>0.21</revnumber>
263 <date>2006-12-19</date>
264 <authorinitials>mhs</authorinitials>
265 <revremark>Fixed a link in the VIDIOC_G_EXT_CTRLS section.</revremark>
266 </revision>
267
268 <revision>
269 <revnumber>0.20</revnumber>
270 <date>2006-11-24</date>
271 <authorinitials>mhs</authorinitials>
272 <revremark>Clarified the purpose of the audioset field in
273struct v4l2_input and v4l2_output.</revremark>
274 </revision>
275
276 <revision>
277 <revnumber>0.19</revnumber>
278 <date>2006-10-19</date>
279 <authorinitials>mhs</authorinitials>
280 <revremark>Documented V4L2_PIX_FMT_RGB444.</revremark>
281 </revision>
282
283 <revision>
284 <revnumber>0.18</revnumber>
285 <date>2006-10-18</date>
286 <authorinitials>mhs</authorinitials>
287 <revremark>Added the description of extended controls by Hans
288Verkuil. Linked V4L2_PIX_FMT_MPEG to V4L2_CID_MPEG_STREAM_TYPE.</revremark>
289 </revision>
290
291 <revision>
292 <revnumber>0.17</revnumber>
293 <date>2006-10-12</date>
294 <authorinitials>mhs</authorinitials>
295 <revremark>Corrected V4L2_PIX_FMT_HM12 description.</revremark>
296 </revision>
297
298 <revision>
299 <revnumber>0.16</revnumber>
300 <date>2006-10-08</date>
301 <authorinitials>mhs</authorinitials>
302 <revremark>VIDIOC_ENUM_FRAMESIZES and
303VIDIOC_ENUM_FRAMEINTERVALS are now part of the API.</revremark>
304 </revision>
305
306 <revision>
307 <revnumber>0.15</revnumber>
308 <date>2006-09-23</date>
309 <authorinitials>mhs</authorinitials>
310 <revremark>Cleaned up the bibliography, added BT.653 and
311BT.1119. capture.c/start_capturing() for user pointer I/O did not
312initialize the buffer index. Documented the V4L MPEG and MJPEG
313VID_TYPEs and V4L2_PIX_FMT_SBGGR8. Updated the list of reserved pixel
314formats. See the history chapter for API changes.</revremark>
315 </revision>
316
317 <revision>
318 <revnumber>0.14</revnumber>
319 <date>2006-09-14</date>
320 <authorinitials>mr</authorinitials>
321 <revremark>Added VIDIOC_ENUM_FRAMESIZES and
322VIDIOC_ENUM_FRAMEINTERVALS proposal for frame format enumeration of
323digital devices.</revremark>
324 </revision>
325
326 <revision>
327 <revnumber>0.13</revnumber>
328 <date>2006-04-07</date>
329 <authorinitials>mhs</authorinitials>
330 <revremark>Corrected the description of struct v4l2_window
331clips. New V4L2_STD_ and V4L2_TUNER_MODE_LANG1_LANG2
332defines.</revremark>
333 </revision>
334
335 <revision>
336 <revnumber>0.12</revnumber>
337 <date>2006-02-03</date>
338 <authorinitials>mhs</authorinitials>
339 <revremark>Corrected the description of struct
340v4l2_captureparm and v4l2_outputparm.</revremark>
341 </revision>
342
343 <revision>
344 <revnumber>0.11</revnumber>
345 <date>2006-01-27</date>
346 <authorinitials>mhs</authorinitials>
347 <revremark>Improved the description of struct
348v4l2_tuner.</revremark>
349 </revision>
350
351 <revision>
352 <revnumber>0.10</revnumber>
353 <date>2006-01-10</date>
354 <authorinitials>mhs</authorinitials>
355 <revremark>VIDIOC_G_INPUT and VIDIOC_S_PARM
356clarifications.</revremark>
357 </revision>
358
359 <revision>
360 <revnumber>0.9</revnumber>
361 <date>2005-11-27</date>
362 <authorinitials>mhs</authorinitials>
363 <revremark>Improved the 525 line numbering diagram. Hans
364Verkuil and I rewrote the sliced VBI section. He also contributed a
365VIDIOC_LOG_STATUS page. Fixed VIDIOC_S_STD call in the video standard
366selection example. Various updates.</revremark>
367 </revision>
368
369 <revision>
370 <revnumber>0.8</revnumber>
371 <date>2004-10-04</date>
372 <authorinitials>mhs</authorinitials>
373 <revremark>Somehow a piece of junk slipped into the capture
374example, removed.</revremark>
375 </revision>
376
377 <revision>
378 <revnumber>0.7</revnumber>
379 <date>2004-09-19</date>
380 <authorinitials>mhs</authorinitials>
381 <revremark>Fixed video standard selection, control
382enumeration, downscaling and aspect example. Added read and user
383pointer i/o to video capture example.</revremark>
384 </revision>
385
386 <revision>
387 <revnumber>0.6</revnumber>
388 <date>2004-08-01</date>
389 <authorinitials>mhs</authorinitials>
390 <revremark>v4l2_buffer changes, added video capture example,
391various corrections.</revremark>
392 </revision>
393
394 <revision>
395 <revnumber>0.5</revnumber>
396 <date>2003-11-05</date>
397 <authorinitials>mhs</authorinitials>
398 <revremark>Pixel format erratum.</revremark>
399 </revision>
400
401 <revision>
402 <revnumber>0.4</revnumber>
403 <date>2003-09-17</date>
404 <authorinitials>mhs</authorinitials>
405 <revremark>Corrected source and Makefile to generate a PDF.
406SGML fixes. Added latest API changes. Closed gaps in the history
407chapter.</revremark>
408 </revision>
409
410 <revision>
411 <revnumber>0.3</revnumber>
412 <date>2003-02-05</date>
413 <authorinitials>mhs</authorinitials>
414 <revremark>Another draft, more corrections.</revremark>
415 </revision>
416
417 <revision>
418 <revnumber>0.2</revnumber>
419 <date>2003-01-15</date>
420 <authorinitials>mhs</authorinitials>
421 <revremark>Second draft, with corrections pointed out by Gerd
422Knorr.</revremark>
423 </revision>
424
425 <revision>
426 <revnumber>0.1</revnumber>
427 <date>2002-12-01</date>
428 <authorinitials>mhs</authorinitials>
429 <revremark>First draft, based on documentation by Bill Dirks
430and discussions on the V4L mailing list.</revremark>
431 </revision>
432 </revhistory>
433</partinfo>
434
435<title>Video for Linux Two API Specification</title>
Hans Verkuil583aa3a2012-01-11 06:45:05 -0300436 <subtitle>Revision 3.3</subtitle>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300437
438 <chapter id="common">
439 &sub-common;
440 </chapter>
441
442 <chapter id="pixfmt">
443 &sub-pixfmt;
444 </chapter>
445
446 <chapter id="io">
447 &sub-io;
448 </chapter>
449
450 <chapter id="devices">
451 <title>Interfaces</title>
452
453 <section id="capture"> &sub-dev-capture; </section>
454 <section id="overlay"> &sub-dev-overlay; </section>
455 <section id="output"> &sub-dev-output; </section>
456 <section id="osd"> &sub-dev-osd; </section>
457 <section id="codec"> &sub-dev-codec; </section>
458 <section id="effect"> &sub-dev-effect; </section>
459 <section id="raw-vbi"> &sub-dev-raw-vbi; </section>
460 <section id="sliced"> &sub-dev-sliced-vbi; </section>
461 <section id="ttx"> &sub-dev-teletext; </section>
462 <section id="radio"> &sub-dev-radio; </section>
463 <section id="rds"> &sub-dev-rds; </section>
Sakari Ailusdd966082010-03-27 10:58:24 -0300464 <section id="event"> &sub-dev-event; </section>
Laurent Pinchart333c8b92010-03-15 20:26:04 -0300465 <section id="subdev"> &sub-dev-subdev; </section>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300466 </chapter>
467
468 <chapter id="driver">
469 &sub-driver;
470 </chapter>
471
472 <chapter id="libv4l">
473 &sub-libv4l;
474 </chapter>
475
476 <chapter id="compat">
477 &sub-compat;
478 </chapter>
479
Mauro Carvalho Chehabdb17ab92009-09-17 01:44:22 -0300480 <appendix id="user-func">
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300481 <title>Function Reference</title>
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300482
483 <!-- Keep this alphabetically sorted. -->
484
485 &sub-close;
486 &sub-ioctl;
487 <!-- All ioctls go here. -->
Guennadi Liakhovetski55093282011-09-28 08:10:58 -0300488 &sub-create-bufs;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300489 &sub-cropcap;
490 &sub-dbg-g-chip-ident;
491 &sub-dbg-g-register;
Hans Verkuil6b4f1252011-11-24 09:55:53 -0300492 &sub-decoder-cmd;
Sakari Ailusdd966082010-03-27 10:58:24 -0300493 &sub-dqevent;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300494 &sub-encoder-cmd;
495 &sub-enumaudio;
496 &sub-enumaudioout;
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300497 &sub-enum-dv-presets;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300498 &sub-enum-fmt;
499 &sub-enum-framesizes;
500 &sub-enum-frameintervals;
501 &sub-enuminput;
502 &sub-enumoutput;
503 &sub-enumstd;
504 &sub-g-audio;
505 &sub-g-audioout;
506 &sub-g-crop;
507 &sub-g-ctrl;
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300508 &sub-g-dv-preset;
509 &sub-g-dv-timings;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300510 &sub-g-enc-index;
511 &sub-g-ext-ctrls;
512 &sub-g-fbuf;
513 &sub-g-fmt;
514 &sub-g-frequency;
515 &sub-g-input;
516 &sub-g-jpegcomp;
517 &sub-g-modulator;
518 &sub-g-output;
519 &sub-g-parm;
520 &sub-g-priority;
Tomasz Stanislawski8af49222011-08-19 07:00:04 -0300521 &sub-g-selection;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300522 &sub-g-sliced-vbi-cap;
523 &sub-g-std;
524 &sub-g-tuner;
525 &sub-log-status;
526 &sub-overlay;
527 &sub-qbuf;
528 &sub-querybuf;
529 &sub-querycap;
530 &sub-queryctrl;
Muralidharan Karicheri007701e2009-12-03 01:13:17 -0300531 &sub-query-dv-preset;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300532 &sub-querystd;
Guennadi Liakhovetski55093282011-09-28 08:10:58 -0300533 &sub-prepare-buf;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300534 &sub-reqbufs;
535 &sub-s-hw-freq-seek;
536 &sub-streamon;
Laurent Pinchart35c30172010-05-05 11:38:35 -0300537 &sub-subdev-enum-frame-interval;
Laurent Pinchart333c8b92010-03-15 20:26:04 -0300538 &sub-subdev-enum-frame-size;
539 &sub-subdev-enum-mbus-code;
Antti Koskipaaf6a5cb12010-06-23 05:03:42 -0300540 &sub-subdev-g-crop;
Laurent Pinchart333c8b92010-03-15 20:26:04 -0300541 &sub-subdev-g-fmt;
Laurent Pinchart35c30172010-05-05 11:38:35 -0300542 &sub-subdev-g-frame-interval;
Sakari Ailusdd966082010-03-27 10:58:24 -0300543 &sub-subscribe-event;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300544 <!-- End of ioctls. -->
545 &sub-mmap;
546 &sub-munmap;
547 &sub-open;
548 &sub-poll;
549 &sub-read;
550 &sub-select;
551 &sub-write;
Mauro Carvalho Chehab8e080c22009-09-13 22:16:04 -0300552 </appendix>
553
554 <appendix id="videodev">
555 <title>Video For Linux Two Header File</title>
556 &sub-videodev2-h;
557 </appendix>
558
559 <appendix id="capture-example">
560 <title>Video Capture Example</title>
561 &sub-capture-c;
562 </appendix>
563
564 <appendix id="v4l2grab-example">
565 <title>Video Grabber example using libv4l</title>
566 <para>This program demonstrates how to grab V4L2 images in ppm format by
567using libv4l handlers. The advantage is that this grabber can potentially work
568with any V4L2 driver.</para>
569 &sub-v4l2grab-c;
570 </appendix>
571
572 &sub-media-indices;
573
574 &sub-biblio;
575