v4l2.xml 15 KB

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