v4l2.xml 15 KB

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