compat.xml 103 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761
  1. <title>Changes</title>
  2. <para>The following chapters document the evolution of the V4L2 API,
  3. errata or extensions. They are also intended to help application and
  4. driver writers to port or update their code.</para>
  5. <section id="diff-v4l">
  6. <title>Differences between V4L and V4L2</title>
  7. <para>The Video For Linux API was first introduced in Linux 2.1 to
  8. unify and replace various TV and radio device related interfaces,
  9. developed independently by driver writers in prior years. Starting
  10. with Linux 2.5 the much improved V4L2 API replaces the V4L API.
  11. The support for the old V4L calls were removed from Kernel, but the
  12. library <xref linkend="libv4l" /> supports the conversion of a V4L
  13. API system call into a V4L2 one.</para>
  14. <section>
  15. <title>Opening and Closing Devices</title>
  16. <para>For compatibility reasons the character device file names
  17. recommended for V4L2 video capture, overlay, radio and raw
  18. vbi capture devices did not change from those used by V4L. They are
  19. listed in <xref linkend="devices" /> and below in <xref
  20. linkend="v4l-dev" />.</para>
  21. <para>The teletext devices (minor range 192-223) have been removed in
  22. V4L2 and no longer exist. There is no hardware available anymore for handling
  23. pure teletext. Instead raw or sliced VBI is used.</para>
  24. <para>The V4L <filename>videodev</filename> module automatically
  25. assigns minor numbers to drivers in load order, depending on the
  26. registered device type. We recommend that V4L2 drivers by default
  27. register devices with the same numbers, but the system administrator
  28. can assign arbitrary minor numbers using driver module options. The
  29. major device number remains 81.</para>
  30. <table id="v4l-dev">
  31. <title>V4L Device Types, Names and Numbers</title>
  32. <tgroup cols="3">
  33. <thead>
  34. <row>
  35. <entry>Device Type</entry>
  36. <entry>File Name</entry>
  37. <entry>Minor Numbers</entry>
  38. </row>
  39. </thead>
  40. <tbody valign="top">
  41. <row>
  42. <entry>Video capture and overlay</entry>
  43. <entry><para><filename>/dev/video</filename> and
  44. <filename>/dev/bttv0</filename><footnote> <para>According to
  45. Documentation/devices.txt these should be symbolic links to
  46. <filename>/dev/video0</filename>. Note the original bttv interface is
  47. not compatible with V4L or V4L2.</para> </footnote>,
  48. <filename>/dev/video0</filename> to
  49. <filename>/dev/video63</filename></para></entry>
  50. <entry>0-63</entry>
  51. </row>
  52. <row>
  53. <entry>Radio receiver</entry>
  54. <entry><para><filename>/dev/radio</filename><footnote>
  55. <para>According to
  56. <filename>Documentation/devices.txt</filename> a symbolic link to
  57. <filename>/dev/radio0</filename>.</para>
  58. </footnote>, <filename>/dev/radio0</filename> to
  59. <filename>/dev/radio63</filename></para></entry>
  60. <entry>64-127</entry>
  61. </row>
  62. <row>
  63. <entry>Raw VBI capture</entry>
  64. <entry><para><filename>/dev/vbi</filename>,
  65. <filename>/dev/vbi0</filename> to
  66. <filename>/dev/vbi31</filename></para></entry>
  67. <entry>224-255</entry>
  68. </row>
  69. </tbody>
  70. </tgroup>
  71. </table>
  72. <para>V4L prohibits (or used to prohibit) multiple opens of a
  73. device file. V4L2 drivers <emphasis>may</emphasis> support multiple
  74. opens, see <xref linkend="open" /> for details and consequences.</para>
  75. <para>V4L drivers respond to V4L2 ioctls with an &EINVAL;.</para>
  76. </section>
  77. <section>
  78. <title>Querying Capabilities</title>
  79. <para>The V4L <constant>VIDIOCGCAP</constant> ioctl is
  80. equivalent to V4L2's &VIDIOC-QUERYCAP;.</para>
  81. <para>The <structfield>name</structfield> field in struct
  82. <structname>video_capability</structname> became
  83. <structfield>card</structfield> in &v4l2-capability;,
  84. <structfield>type</structfield> was replaced by
  85. <structfield>capabilities</structfield>. Note V4L2 does not
  86. distinguish between device types like this, better think of basic
  87. video input, video output and radio devices supporting a set of
  88. related functions like video capturing, video overlay and VBI
  89. capturing. See <xref linkend="open" /> for an
  90. introduction.<informaltable>
  91. <tgroup cols="3">
  92. <thead>
  93. <row>
  94. <entry>struct
  95. <structname>video_capability</structname>
  96. <structfield>type</structfield></entry>
  97. <entry>&v4l2-capability;
  98. <structfield>capabilities</structfield> flags</entry>
  99. <entry>Purpose</entry>
  100. </row>
  101. </thead>
  102. <tbody valign="top">
  103. <row>
  104. <entry><constant>VID_TYPE_CAPTURE</constant></entry>
  105. <entry><constant>V4L2_CAP_VIDEO_CAPTURE</constant></entry>
  106. <entry>The <link linkend="capture">video
  107. capture</link> interface is supported.</entry>
  108. </row>
  109. <row>
  110. <entry><constant>VID_TYPE_TUNER</constant></entry>
  111. <entry><constant>V4L2_CAP_TUNER</constant></entry>
  112. <entry>The device has a <link linkend="tuner">tuner or
  113. modulator</link>.</entry>
  114. </row>
  115. <row>
  116. <entry><constant>VID_TYPE_TELETEXT</constant></entry>
  117. <entry><constant>V4L2_CAP_VBI_CAPTURE</constant></entry>
  118. <entry>The <link linkend="raw-vbi">raw VBI
  119. capture</link> interface is supported.</entry>
  120. </row>
  121. <row>
  122. <entry><constant>VID_TYPE_OVERLAY</constant></entry>
  123. <entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry>
  124. <entry>The <link linkend="overlay">video
  125. overlay</link> interface is supported.</entry>
  126. </row>
  127. <row>
  128. <entry><constant>VID_TYPE_CHROMAKEY</constant></entry>
  129. <entry><constant>V4L2_FBUF_CAP_CHROMAKEY</constant> in
  130. field <structfield>capability</structfield> of
  131. &v4l2-framebuffer;</entry>
  132. <entry>Whether chromakey overlay is supported. For
  133. more information on overlay see
  134. <xref linkend="overlay" />.</entry>
  135. </row>
  136. <row>
  137. <entry><constant>VID_TYPE_CLIPPING</constant></entry>
  138. <entry><constant>V4L2_FBUF_CAP_LIST_CLIPPING</constant>
  139. and <constant>V4L2_FBUF_CAP_BITMAP_CLIPPING</constant> in field
  140. <structfield>capability</structfield> of &v4l2-framebuffer;</entry>
  141. <entry>Whether clipping the overlaid image is
  142. supported, see <xref linkend="overlay" />.</entry>
  143. </row>
  144. <row>
  145. <entry><constant>VID_TYPE_FRAMERAM</constant></entry>
  146. <entry><constant>V4L2_FBUF_CAP_EXTERNOVERLAY</constant>
  147. <emphasis>not set</emphasis> in field
  148. <structfield>capability</structfield> of &v4l2-framebuffer;</entry>
  149. <entry>Whether overlay overwrites frame buffer memory,
  150. see <xref linkend="overlay" />.</entry>
  151. </row>
  152. <row>
  153. <entry><constant>VID_TYPE_SCALES</constant></entry>
  154. <entry><constant>-</constant></entry>
  155. <entry>This flag indicates if the hardware can scale
  156. images. The V4L2 API implies the scale factor by setting the cropping
  157. dimensions and image size with the &VIDIOC-S-CROP; and &VIDIOC-S-FMT;
  158. ioctl, respectively. The driver returns the closest sizes possible.
  159. For more information on cropping and scaling see <xref
  160. linkend="crop" />.</entry>
  161. </row>
  162. <row>
  163. <entry><constant>VID_TYPE_MONOCHROME</constant></entry>
  164. <entry><constant>-</constant></entry>
  165. <entry>Applications can enumerate the supported image
  166. formats with the &VIDIOC-ENUM-FMT; ioctl to determine if the device
  167. supports grey scale capturing only. For more information on image
  168. formats see <xref linkend="pixfmt" />.</entry>
  169. </row>
  170. <row>
  171. <entry><constant>VID_TYPE_SUBCAPTURE</constant></entry>
  172. <entry><constant>-</constant></entry>
  173. <entry>Applications can call the &VIDIOC-G-CROP; ioctl
  174. to determine if the device supports capturing a subsection of the full
  175. picture ("cropping" in V4L2). If not, the ioctl returns the &EINVAL;.
  176. For more information on cropping and scaling see <xref
  177. linkend="crop" />.</entry>
  178. </row>
  179. <row>
  180. <entry><constant>VID_TYPE_MPEG_DECODER</constant></entry>
  181. <entry><constant>-</constant></entry>
  182. <entry>Applications can enumerate the supported image
  183. formats with the &VIDIOC-ENUM-FMT; ioctl to determine if the device
  184. supports MPEG streams.</entry>
  185. </row>
  186. <row>
  187. <entry><constant>VID_TYPE_MPEG_ENCODER</constant></entry>
  188. <entry><constant>-</constant></entry>
  189. <entry>See above.</entry>
  190. </row>
  191. <row>
  192. <entry><constant>VID_TYPE_MJPEG_DECODER</constant></entry>
  193. <entry><constant>-</constant></entry>
  194. <entry>See above.</entry>
  195. </row>
  196. <row>
  197. <entry><constant>VID_TYPE_MJPEG_ENCODER</constant></entry>
  198. <entry><constant>-</constant></entry>
  199. <entry>See above.</entry>
  200. </row>
  201. </tbody>
  202. </tgroup>
  203. </informaltable></para>
  204. <para>The <structfield>audios</structfield> field was replaced
  205. by <structfield>capabilities</structfield> flag
  206. <constant>V4L2_CAP_AUDIO</constant>, indicating
  207. <emphasis>if</emphasis> the device has any audio inputs or outputs. To
  208. determine their number applications can enumerate audio inputs with
  209. the &VIDIOC-G-AUDIO; ioctl. The audio ioctls are described in <xref
  210. linkend="audio" />.</para>
  211. <para>The <structfield>maxwidth</structfield>,
  212. <structfield>maxheight</structfield>,
  213. <structfield>minwidth</structfield> and
  214. <structfield>minheight</structfield> fields were removed. Calling the
  215. &VIDIOC-S-FMT; or &VIDIOC-TRY-FMT; ioctl with the desired dimensions
  216. returns the closest size possible, taking into account the current
  217. video standard, cropping and scaling limitations.</para>
  218. </section>
  219. <section>
  220. <title>Video Sources</title>
  221. <para>V4L provides the <constant>VIDIOCGCHAN</constant> and
  222. <constant>VIDIOCSCHAN</constant> ioctl using struct
  223. <structname>video_channel</structname> to enumerate
  224. the video inputs of a V4L device. The equivalent V4L2 ioctls
  225. are &VIDIOC-ENUMINPUT;, &VIDIOC-G-INPUT; and &VIDIOC-S-INPUT;
  226. using &v4l2-input; as discussed in <xref linkend="video" />.</para>
  227. <para>The <structfield>channel</structfield> field counting
  228. inputs was renamed to <structfield>index</structfield>, the video
  229. input types were renamed as follows: <informaltable>
  230. <tgroup cols="2">
  231. <thead>
  232. <row>
  233. <entry>struct <structname>video_channel</structname>
  234. <structfield>type</structfield></entry>
  235. <entry>&v4l2-input;
  236. <structfield>type</structfield></entry>
  237. </row>
  238. </thead>
  239. <tbody valign="top">
  240. <row>
  241. <entry><constant>VIDEO_TYPE_TV</constant></entry>
  242. <entry><constant>V4L2_INPUT_TYPE_TUNER</constant></entry>
  243. </row>
  244. <row>
  245. <entry><constant>VIDEO_TYPE_CAMERA</constant></entry>
  246. <entry><constant>V4L2_INPUT_TYPE_CAMERA</constant></entry>
  247. </row>
  248. </tbody>
  249. </tgroup>
  250. </informaltable></para>
  251. <para>Unlike the <structfield>tuners</structfield> field
  252. expressing the number of tuners of this input, V4L2 assumes each video
  253. input is connected to at most one tuner. However a tuner can have more
  254. than one input, &ie; RF connectors, and a device can have multiple
  255. tuners. The index number of the tuner associated with the input, if
  256. any, is stored in field <structfield>tuner</structfield> of
  257. &v4l2-input;. Enumeration of tuners is discussed in <xref
  258. linkend="tuner" />.</para>
  259. <para>The redundant <constant>VIDEO_VC_TUNER</constant> flag was
  260. dropped. Video inputs associated with a tuner are of type
  261. <constant>V4L2_INPUT_TYPE_TUNER</constant>. The
  262. <constant>VIDEO_VC_AUDIO</constant> flag was replaced by the
  263. <structfield>audioset</structfield> field. V4L2 considers devices with
  264. up to 32 audio inputs. Each set bit in the
  265. <structfield>audioset</structfield> field represents one audio input
  266. this video input combines with. For information about audio inputs and
  267. how to switch between them see <xref linkend="audio" />.</para>
  268. <para>The <structfield>norm</structfield> field describing the
  269. supported video standards was replaced by
  270. <structfield>std</structfield>. The V4L specification mentions a flag
  271. <constant>VIDEO_VC_NORM</constant> indicating whether the standard can
  272. be changed. This flag was a later addition together with the
  273. <structfield>norm</structfield> field and has been removed in the
  274. meantime. V4L2 has a similar, albeit more comprehensive approach
  275. to video standards, see <xref linkend="standard" /> for more
  276. information.</para>
  277. </section>
  278. <section>
  279. <title>Tuning</title>
  280. <para>The V4L <constant>VIDIOCGTUNER</constant> and
  281. <constant>VIDIOCSTUNER</constant> ioctl and struct
  282. <structname>video_tuner</structname> can be used to enumerate the
  283. tuners of a V4L TV or radio device. The equivalent V4L2 ioctls are
  284. &VIDIOC-G-TUNER; and &VIDIOC-S-TUNER; using &v4l2-tuner;. Tuners are
  285. covered in <xref linkend="tuner" />.</para>
  286. <para>The <structfield>tuner</structfield> field counting tuners
  287. was renamed to <structfield>index</structfield>. The fields
  288. <structfield>name</structfield>, <structfield>rangelow</structfield>
  289. and <structfield>rangehigh</structfield> remained unchanged.</para>
  290. <para>The <constant>VIDEO_TUNER_PAL</constant>,
  291. <constant>VIDEO_TUNER_NTSC</constant> and
  292. <constant>VIDEO_TUNER_SECAM</constant> flags indicating the supported
  293. video standards were dropped. This information is now contained in the
  294. associated &v4l2-input;. No replacement exists for the
  295. <constant>VIDEO_TUNER_NORM</constant> flag indicating whether the
  296. video standard can be switched. The <structfield>mode</structfield>
  297. field to select a different video standard was replaced by a whole new
  298. set of ioctls and structures described in <xref linkend="standard" />.
  299. Due to its ubiquity it should be mentioned the BTTV driver supports
  300. several standards in addition to the regular
  301. <constant>VIDEO_MODE_PAL</constant> (0),
  302. <constant>VIDEO_MODE_NTSC</constant>,
  303. <constant>VIDEO_MODE_SECAM</constant> and
  304. <constant>VIDEO_MODE_AUTO</constant> (3). Namely N/PAL Argentina,
  305. M/PAL, N/PAL, and NTSC Japan with numbers 3-6 (sic).</para>
  306. <para>The <constant>VIDEO_TUNER_STEREO_ON</constant> flag
  307. indicating stereo reception became
  308. <constant>V4L2_TUNER_SUB_STEREO</constant> in field
  309. <structfield>rxsubchans</structfield>. This field also permits the
  310. detection of monaural and bilingual audio, see the definition of
  311. &v4l2-tuner; for details. Presently no replacement exists for the
  312. <constant>VIDEO_TUNER_RDS_ON</constant> and
  313. <constant>VIDEO_TUNER_MBS_ON</constant> flags.</para>
  314. <para> The <constant>VIDEO_TUNER_LOW</constant> flag was renamed
  315. to <constant>V4L2_TUNER_CAP_LOW</constant> in the &v4l2-tuner;
  316. <structfield>capability</structfield> field.</para>
  317. <para>The <constant>VIDIOCGFREQ</constant> and
  318. <constant>VIDIOCSFREQ</constant> ioctl to change the tuner frequency
  319. where renamed to &VIDIOC-G-FREQUENCY; and &VIDIOC-S-FREQUENCY;. They
  320. take a pointer to a &v4l2-frequency; instead of an unsigned long
  321. integer.</para>
  322. </section>
  323. <section id="v4l-image-properties">
  324. <title>Image Properties</title>
  325. <para>V4L2 has no equivalent of the
  326. <constant>VIDIOCGPICT</constant> and <constant>VIDIOCSPICT</constant>
  327. ioctl and struct <structname>video_picture</structname>. The following
  328. fields where replaced by V4L2 controls accessible with the
  329. &VIDIOC-QUERYCTRL;, &VIDIOC-G-CTRL; and &VIDIOC-S-CTRL; ioctls:<informaltable>
  330. <tgroup cols="2">
  331. <thead>
  332. <row>
  333. <entry>struct <structname>video_picture</structname></entry>
  334. <entry>V4L2 Control ID</entry>
  335. </row>
  336. </thead>
  337. <tbody valign="top">
  338. <row>
  339. <entry><structfield>brightness</structfield></entry>
  340. <entry><constant>V4L2_CID_BRIGHTNESS</constant></entry>
  341. </row>
  342. <row>
  343. <entry><structfield>hue</structfield></entry>
  344. <entry><constant>V4L2_CID_HUE</constant></entry>
  345. </row>
  346. <row>
  347. <entry><structfield>colour</structfield></entry>
  348. <entry><constant>V4L2_CID_SATURATION</constant></entry>
  349. </row>
  350. <row>
  351. <entry><structfield>contrast</structfield></entry>
  352. <entry><constant>V4L2_CID_CONTRAST</constant></entry>
  353. </row>
  354. <row>
  355. <entry><structfield>whiteness</structfield></entry>
  356. <entry><constant>V4L2_CID_WHITENESS</constant></entry>
  357. </row>
  358. </tbody>
  359. </tgroup>
  360. </informaltable></para>
  361. <para>The V4L picture controls are assumed to range from 0 to
  362. 65535 with no particular reset value. The V4L2 API permits arbitrary
  363. limits and defaults which can be queried with the &VIDIOC-QUERYCTRL;
  364. ioctl. For general information about controls see <xref
  365. linkend="control" />.</para>
  366. <para>The <structfield>depth</structfield> (average number of
  367. bits per pixel) of a video image is implied by the selected image
  368. format. V4L2 does not explicitly provide such information assuming
  369. applications recognizing the format are aware of the image depth and
  370. others need not know. The <structfield>palette</structfield> field
  371. moved into the &v4l2-pix-format;:<informaltable>
  372. <tgroup cols="2">
  373. <thead>
  374. <row>
  375. <entry>struct <structname>video_picture</structname>
  376. <structfield>palette</structfield></entry>
  377. <entry>&v4l2-pix-format;
  378. <structfield>pixfmt</structfield></entry>
  379. </row>
  380. </thead>
  381. <tbody valign="top">
  382. <row>
  383. <entry><constant>VIDEO_PALETTE_GREY</constant></entry>
  384. <entry><para><link
  385. linkend="V4L2-PIX-FMT-GREY"><constant>V4L2_PIX_FMT_GREY</constant></link></para></entry>
  386. </row>
  387. <row>
  388. <entry><constant>VIDEO_PALETTE_HI240</constant></entry>
  389. <entry><para><link
  390. linkend="pixfmt-reserved"><constant>V4L2_PIX_FMT_HI240</constant></link><footnote>
  391. <para>This is a custom format used by the BTTV
  392. driver, not one of the V4L2 standard formats.</para>
  393. </footnote></para></entry>
  394. </row>
  395. <row>
  396. <entry><constant>VIDEO_PALETTE_RGB565</constant></entry>
  397. <entry><para><link
  398. linkend="pixfmt-rgb"><constant>V4L2_PIX_FMT_RGB565</constant></link></para></entry>
  399. </row>
  400. <row>
  401. <entry><constant>VIDEO_PALETTE_RGB555</constant></entry>
  402. <entry><para><link
  403. linkend="pixfmt-rgb"><constant>V4L2_PIX_FMT_RGB555</constant></link></para></entry>
  404. </row>
  405. <row>
  406. <entry><constant>VIDEO_PALETTE_RGB24</constant></entry>
  407. <entry><para><link
  408. linkend="pixfmt-rgb"><constant>V4L2_PIX_FMT_BGR24</constant></link></para></entry>
  409. </row>
  410. <row>
  411. <entry><constant>VIDEO_PALETTE_RGB32</constant></entry>
  412. <entry><para><link
  413. linkend="pixfmt-rgb"><constant>V4L2_PIX_FMT_BGR32</constant></link><footnote>
  414. <para>Presumably all V4L RGB formats are
  415. little-endian, although some drivers might interpret them according to machine endianness. V4L2 defines little-endian, big-endian and red/blue
  416. swapped variants. For details see <xref linkend="pixfmt-rgb" />.</para>
  417. </footnote></para></entry>
  418. </row>
  419. <row>
  420. <entry><constant>VIDEO_PALETTE_YUV422</constant></entry>
  421. <entry><para><link
  422. linkend="V4L2-PIX-FMT-YUYV"><constant>V4L2_PIX_FMT_YUYV</constant></link></para></entry>
  423. </row>
  424. <row>
  425. <entry><para><constant>VIDEO_PALETTE_YUYV</constant><footnote>
  426. <para><constant>VIDEO_PALETTE_YUV422</constant>
  427. and <constant>VIDEO_PALETTE_YUYV</constant> are the same formats. Some
  428. V4L drivers respond to one, some to the other.</para>
  429. </footnote></para></entry>
  430. <entry><para><link
  431. linkend="V4L2-PIX-FMT-YUYV"><constant>V4L2_PIX_FMT_YUYV</constant></link></para></entry>
  432. </row>
  433. <row>
  434. <entry><constant>VIDEO_PALETTE_UYVY</constant></entry>
  435. <entry><para><link
  436. linkend="V4L2-PIX-FMT-UYVY"><constant>V4L2_PIX_FMT_UYVY</constant></link></para></entry>
  437. </row>
  438. <row>
  439. <entry><constant>VIDEO_PALETTE_YUV420</constant></entry>
  440. <entry>None</entry>
  441. </row>
  442. <row>
  443. <entry><constant>VIDEO_PALETTE_YUV411</constant></entry>
  444. <entry><para><link
  445. linkend="V4L2-PIX-FMT-Y41P"><constant>V4L2_PIX_FMT_Y41P</constant></link><footnote>
  446. <para>Not to be confused with
  447. <constant>V4L2_PIX_FMT_YUV411P</constant>, which is a planar
  448. format.</para> </footnote></para></entry>
  449. </row>
  450. <row>
  451. <entry><constant>VIDEO_PALETTE_RAW</constant></entry>
  452. <entry><para>None<footnote> <para>V4L explains this
  453. as: "RAW capture (BT848)"</para> </footnote></para></entry>
  454. </row>
  455. <row>
  456. <entry><constant>VIDEO_PALETTE_YUV422P</constant></entry>
  457. <entry><para><link
  458. linkend="V4L2-PIX-FMT-YUV422P"><constant>V4L2_PIX_FMT_YUV422P</constant></link></para></entry>
  459. </row>
  460. <row>
  461. <entry><constant>VIDEO_PALETTE_YUV411P</constant></entry>
  462. <entry><para><link
  463. linkend="V4L2-PIX-FMT-YUV411P"><constant>V4L2_PIX_FMT_YUV411P</constant></link><footnote>
  464. <para>Not to be confused with
  465. <constant>V4L2_PIX_FMT_Y41P</constant>, which is a packed
  466. format.</para> </footnote></para></entry>
  467. </row>
  468. <row>
  469. <entry><constant>VIDEO_PALETTE_YUV420P</constant></entry>
  470. <entry><para><link
  471. linkend="V4L2-PIX-FMT-YVU420"><constant>V4L2_PIX_FMT_YVU420</constant></link></para></entry>
  472. </row>
  473. <row>
  474. <entry><constant>VIDEO_PALETTE_YUV410P</constant></entry>
  475. <entry><para><link
  476. linkend="V4L2-PIX-FMT-YVU410"><constant>V4L2_PIX_FMT_YVU410</constant></link></para></entry>
  477. </row>
  478. </tbody>
  479. </tgroup>
  480. </informaltable></para>
  481. <para>V4L2 image formats are defined in <xref
  482. linkend="pixfmt" />. The image format can be selected with the
  483. &VIDIOC-S-FMT; ioctl.</para>
  484. </section>
  485. <section>
  486. <title>Audio</title>
  487. <para>The <constant>VIDIOCGAUDIO</constant> and
  488. <constant>VIDIOCSAUDIO</constant> ioctl and struct
  489. <structname>video_audio</structname> are used to enumerate the
  490. audio inputs of a V4L device. The equivalent V4L2 ioctls are
  491. &VIDIOC-G-AUDIO; and &VIDIOC-S-AUDIO; using &v4l2-audio; as
  492. discussed in <xref linkend="audio" />.</para>
  493. <para>The <structfield>audio</structfield> "channel number"
  494. field counting audio inputs was renamed to
  495. <structfield>index</structfield>.</para>
  496. <para>On <constant>VIDIOCSAUDIO</constant> the
  497. <structfield>mode</structfield> field selects <emphasis>one</emphasis>
  498. of the <constant>VIDEO_SOUND_MONO</constant>,
  499. <constant>VIDEO_SOUND_STEREO</constant>,
  500. <constant>VIDEO_SOUND_LANG1</constant> or
  501. <constant>VIDEO_SOUND_LANG2</constant> audio demodulation modes. When
  502. the current audio standard is BTSC
  503. <constant>VIDEO_SOUND_LANG2</constant> refers to SAP and
  504. <constant>VIDEO_SOUND_LANG1</constant> is meaningless. Also
  505. undocumented in the V4L specification, there is no way to query the
  506. selected mode. On <constant>VIDIOCGAUDIO</constant> the driver returns
  507. the <emphasis>actually received</emphasis> audio programmes in this
  508. field. In the V4L2 API this information is stored in the &v4l2-tuner;
  509. <structfield>rxsubchans</structfield> and
  510. <structfield>audmode</structfield> fields, respectively. See <xref
  511. linkend="tuner" /> for more information on tuners. Related to audio
  512. modes &v4l2-audio; also reports if this is a mono or stereo
  513. input, regardless if the source is a tuner.</para>
  514. <para>The following fields where replaced by V4L2 controls
  515. accessible with the &VIDIOC-QUERYCTRL;, &VIDIOC-G-CTRL; and
  516. &VIDIOC-S-CTRL; ioctls:<informaltable>
  517. <tgroup cols="2">
  518. <thead>
  519. <row>
  520. <entry>struct
  521. <structname>video_audio</structname></entry>
  522. <entry>V4L2 Control ID</entry>
  523. </row>
  524. </thead>
  525. <tbody valign="top">
  526. <row>
  527. <entry><structfield>volume</structfield></entry>
  528. <entry><constant>V4L2_CID_AUDIO_VOLUME</constant></entry>
  529. </row>
  530. <row>
  531. <entry><structfield>bass</structfield></entry>
  532. <entry><constant>V4L2_CID_AUDIO_BASS</constant></entry>
  533. </row>
  534. <row>
  535. <entry><structfield>treble</structfield></entry>
  536. <entry><constant>V4L2_CID_AUDIO_TREBLE</constant></entry>
  537. </row>
  538. <row>
  539. <entry><structfield>balance</structfield></entry>
  540. <entry><constant>V4L2_CID_AUDIO_BALANCE</constant></entry>
  541. </row>
  542. </tbody>
  543. </tgroup>
  544. </informaltable></para>
  545. <para>To determine which of these controls are supported by a
  546. driver V4L provides the <structfield>flags</structfield>
  547. <constant>VIDEO_AUDIO_VOLUME</constant>,
  548. <constant>VIDEO_AUDIO_BASS</constant>,
  549. <constant>VIDEO_AUDIO_TREBLE</constant> and
  550. <constant>VIDEO_AUDIO_BALANCE</constant>. In the V4L2 API the
  551. &VIDIOC-QUERYCTRL; ioctl reports if the respective control is
  552. supported. Accordingly the <constant>VIDEO_AUDIO_MUTABLE</constant>
  553. and <constant>VIDEO_AUDIO_MUTE</constant> flags where replaced by the
  554. boolean <constant>V4L2_CID_AUDIO_MUTE</constant> control.</para>
  555. <para>All V4L2 controls have a <structfield>step</structfield>
  556. attribute replacing the struct <structname>video_audio</structname>
  557. <structfield>step</structfield> field. The V4L audio controls are
  558. assumed to range from 0 to 65535 with no particular reset value. The
  559. V4L2 API permits arbitrary limits and defaults which can be queried
  560. with the &VIDIOC-QUERYCTRL; ioctl. For general information about
  561. controls see <xref linkend="control" />.</para>
  562. </section>
  563. <section>
  564. <title>Frame Buffer Overlay</title>
  565. <para>The V4L2 ioctls equivalent to
  566. <constant>VIDIOCGFBUF</constant> and <constant>VIDIOCSFBUF</constant>
  567. are &VIDIOC-G-FBUF; and &VIDIOC-S-FBUF;. The
  568. <structfield>base</structfield> field of struct
  569. <structname>video_buffer</structname> remained unchanged, except V4L2
  570. defines a flag to indicate non-destructive overlays instead of a
  571. <constant>NULL</constant> pointer. All other fields moved into the
  572. &v4l2-pix-format; <structfield>fmt</structfield> substructure of
  573. &v4l2-framebuffer;. The <structfield>depth</structfield> field was
  574. replaced by <structfield>pixelformat</structfield>. See <xref
  575. linkend="pixfmt-rgb" /> for a list of RGB formats and their
  576. respective color depths.</para>
  577. <para>Instead of the special ioctls
  578. <constant>VIDIOCGWIN</constant> and <constant>VIDIOCSWIN</constant>
  579. V4L2 uses the general-purpose data format negotiation ioctls
  580. &VIDIOC-G-FMT; and &VIDIOC-S-FMT;. They take a pointer to a
  581. &v4l2-format; as argument. Here the <structfield>win</structfield>
  582. member of the <structfield>fmt</structfield> union is used, a
  583. &v4l2-window;.</para>
  584. <para>The <structfield>x</structfield>,
  585. <structfield>y</structfield>, <structfield>width</structfield> and
  586. <structfield>height</structfield> fields of struct
  587. <structname>video_window</structname> moved into &v4l2-rect;
  588. substructure <structfield>w</structfield> of struct
  589. <structname>v4l2_window</structname>. The
  590. <structfield>chromakey</structfield>,
  591. <structfield>clips</structfield>, and
  592. <structfield>clipcount</structfield> fields remained unchanged. Struct
  593. <structname>video_clip</structname> was renamed to &v4l2-clip;, also
  594. containing a struct <structname>v4l2_rect</structname>, but the
  595. semantics are still the same.</para>
  596. <para>The <constant>VIDEO_WINDOW_INTERLACE</constant> flag was
  597. dropped. Instead applications must set the
  598. <structfield>field</structfield> field to
  599. <constant>V4L2_FIELD_ANY</constant> or
  600. <constant>V4L2_FIELD_INTERLACED</constant>. The
  601. <constant>VIDEO_WINDOW_CHROMAKEY</constant> flag moved into
  602. &v4l2-framebuffer;, under the new name
  603. <constant>V4L2_FBUF_FLAG_CHROMAKEY</constant>.</para>
  604. <para>In V4L, storing a bitmap pointer in
  605. <structfield>clips</structfield> and setting
  606. <structfield>clipcount</structfield> to
  607. <constant>VIDEO_CLIP_BITMAP</constant> (-1) requests bitmap
  608. clipping, using a fixed size bitmap of 1024 &times; 625 bits. Struct
  609. <structname>v4l2_window</structname> has a separate
  610. <structfield>bitmap</structfield> pointer field for this purpose and
  611. the bitmap size is determined by <structfield>w.width</structfield> and
  612. <structfield>w.height</structfield>.</para>
  613. <para>The <constant>VIDIOCCAPTURE</constant> ioctl to enable or
  614. disable overlay was renamed to &VIDIOC-OVERLAY;.</para>
  615. </section>
  616. <section>
  617. <title>Cropping</title>
  618. <para>To capture only a subsection of the full picture V4L
  619. defines the <constant>VIDIOCGCAPTURE</constant> and
  620. <constant>VIDIOCSCAPTURE</constant> ioctls using struct
  621. <structname>video_capture</structname>. The equivalent V4L2 ioctls are
  622. &VIDIOC-G-CROP; and &VIDIOC-S-CROP; using &v4l2-crop;, and the related
  623. &VIDIOC-CROPCAP; ioctl. This is a rather complex matter, see
  624. <xref linkend="crop" /> for details.</para>
  625. <para>The <structfield>x</structfield>,
  626. <structfield>y</structfield>, <structfield>width</structfield> and
  627. <structfield>height</structfield> fields moved into &v4l2-rect;
  628. substructure <structfield>c</structfield> of struct
  629. <structname>v4l2_crop</structname>. The
  630. <structfield>decimation</structfield> field was dropped. In the V4L2
  631. API the scaling factor is implied by the size of the cropping
  632. rectangle and the size of the captured or overlaid image.</para>
  633. <para>The <constant>VIDEO_CAPTURE_ODD</constant>
  634. and <constant>VIDEO_CAPTURE_EVEN</constant> flags to capture only the
  635. odd or even field, respectively, were replaced by
  636. <constant>V4L2_FIELD_TOP</constant> and
  637. <constant>V4L2_FIELD_BOTTOM</constant> in the field named
  638. <structfield>field</structfield> of &v4l2-pix-format; and
  639. &v4l2-window;. These structures are used to select a capture or
  640. overlay format with the &VIDIOC-S-FMT; ioctl.</para>
  641. </section>
  642. <section>
  643. <title>Reading Images, Memory Mapping</title>
  644. <section>
  645. <title>Capturing using the read method</title>
  646. <para>There is no essential difference between reading images
  647. from a V4L or V4L2 device using the &func-read; function, however V4L2
  648. drivers are not required to support this I/O method. Applications can
  649. determine if the function is available with the &VIDIOC-QUERYCAP;
  650. ioctl. All V4L2 devices exchanging data with applications must support
  651. the &func-select; and &func-poll; functions.</para>
  652. <para>To select an image format and size, V4L provides the
  653. <constant>VIDIOCSPICT</constant> and <constant>VIDIOCSWIN</constant>
  654. ioctls. V4L2 uses the general-purpose data format negotiation ioctls
  655. &VIDIOC-G-FMT; and &VIDIOC-S-FMT;. They take a pointer to a
  656. &v4l2-format; as argument, here the &v4l2-pix-format; named
  657. <structfield>pix</structfield> of its <structfield>fmt</structfield>
  658. union is used.</para>
  659. <para>For more information about the V4L2 read interface see
  660. <xref linkend="rw" />.</para>
  661. </section>
  662. <section>
  663. <title>Capturing using memory mapping</title>
  664. <para>Applications can read from V4L devices by mapping
  665. buffers in device memory, or more often just buffers allocated in
  666. DMA-able system memory, into their address space. This avoids the data
  667. copying overhead of the read method. V4L2 supports memory mapping as
  668. well, with a few differences.</para>
  669. <informaltable>
  670. <tgroup cols="2">
  671. <thead>
  672. <row>
  673. <entry>V4L</entry>
  674. <entry>V4L2</entry>
  675. </row>
  676. </thead>
  677. <tbody valign="top">
  678. <row>
  679. <entry></entry>
  680. <entry>The image format must be selected before
  681. buffers are allocated, with the &VIDIOC-S-FMT; ioctl. When no format
  682. is selected the driver may use the last, possibly by another
  683. application requested format.</entry>
  684. </row>
  685. <row>
  686. <entry><para>Applications cannot change the number of
  687. buffers. The it is built into the driver, unless it has a module
  688. option to change the number when the driver module is
  689. loaded.</para></entry>
  690. <entry><para>The &VIDIOC-REQBUFS; ioctl allocates the
  691. desired number of buffers, this is a required step in the initialization
  692. sequence.</para></entry>
  693. </row>
  694. <row>
  695. <entry><para>Drivers map all buffers as one contiguous
  696. range of memory. The <constant>VIDIOCGMBUF</constant> ioctl is
  697. available to query the number of buffers, the offset of each buffer
  698. from the start of the virtual file, and the overall amount of memory
  699. used, which can be used as arguments for the &func-mmap;
  700. function.</para></entry>
  701. <entry><para>Buffers are individually mapped. The
  702. offset and size of each buffer can be determined with the
  703. &VIDIOC-QUERYBUF; ioctl.</para></entry>
  704. </row>
  705. <row>
  706. <entry><para>The <constant>VIDIOCMCAPTURE</constant>
  707. ioctl prepares a buffer for capturing. It also determines the image
  708. format for this buffer. The ioctl returns immediately, eventually with
  709. an &EAGAIN; if no video signal had been detected. When the driver
  710. supports more than one buffer applications can call the ioctl multiple
  711. times and thus have multiple outstanding capture
  712. requests.</para><para>The <constant>VIDIOCSYNC</constant> ioctl
  713. suspends execution until a particular buffer has been
  714. filled.</para></entry>
  715. <entry><para>Drivers maintain an incoming and outgoing
  716. queue. &VIDIOC-QBUF; enqueues any empty buffer into the incoming
  717. queue. Filled buffers are dequeued from the outgoing queue with the
  718. &VIDIOC-DQBUF; ioctl. To wait until filled buffers become available this
  719. function, &func-select; or &func-poll; can be used. The
  720. &VIDIOC-STREAMON; ioctl must be called once after enqueuing one or
  721. more buffers to start capturing. Its counterpart
  722. &VIDIOC-STREAMOFF; stops capturing and dequeues all buffers from both
  723. queues. Applications can query the signal status, if known, with the
  724. &VIDIOC-ENUMINPUT; ioctl.</para></entry>
  725. </row>
  726. </tbody>
  727. </tgroup>
  728. </informaltable>
  729. <para>For a more in-depth discussion of memory mapping and
  730. examples, see <xref linkend="mmap" />.</para>
  731. </section>
  732. </section>
  733. <section>
  734. <title>Reading Raw VBI Data</title>
  735. <para>Originally the V4L API did not specify a raw VBI capture
  736. interface, only the device file <filename>/dev/vbi</filename> was
  737. reserved for this purpose. The only driver supporting this interface
  738. was the BTTV driver, de-facto defining the V4L VBI interface. Reading
  739. from the device yields a raw VBI image with the following
  740. parameters:<informaltable>
  741. <tgroup cols="2">
  742. <thead>
  743. <row>
  744. <entry>&v4l2-vbi-format;</entry>
  745. <entry>V4L, BTTV driver</entry>
  746. </row>
  747. </thead>
  748. <tbody valign="top">
  749. <row>
  750. <entry>sampling_rate</entry>
  751. <entry>28636363&nbsp;Hz NTSC (or any other 525-line
  752. standard); 35468950&nbsp;Hz PAL and SECAM (625-line standards)</entry>
  753. </row>
  754. <row>
  755. <entry>offset</entry>
  756. <entry>?</entry>
  757. </row>
  758. <row>
  759. <entry>samples_per_line</entry>
  760. <entry>2048</entry>
  761. </row>
  762. <row>
  763. <entry>sample_format</entry>
  764. <entry>V4L2_PIX_FMT_GREY. The last four bytes (a
  765. machine endianness integer) contain a frame counter.</entry>
  766. </row>
  767. <row>
  768. <entry>start[]</entry>
  769. <entry>10, 273 NTSC; 22, 335 PAL and SECAM</entry>
  770. </row>
  771. <row>
  772. <entry>count[]</entry>
  773. <entry><para>16, 16<footnote><para>Old driver
  774. versions used different values, eventually the custom
  775. <constant>BTTV_VBISIZE</constant> ioctl was added to query the
  776. correct values.</para></footnote></para></entry>
  777. </row>
  778. <row>
  779. <entry>flags</entry>
  780. <entry>0</entry>
  781. </row>
  782. </tbody>
  783. </tgroup>
  784. </informaltable></para>
  785. <para>Undocumented in the V4L specification, in Linux 2.3 the
  786. <constant>VIDIOCGVBIFMT</constant> and
  787. <constant>VIDIOCSVBIFMT</constant> ioctls using struct
  788. <structname>vbi_format</structname> were added to determine the VBI
  789. image parameters. These ioctls are only partially compatible with the
  790. V4L2 VBI interface specified in <xref linkend="raw-vbi" />.</para>
  791. <para>An <structfield>offset</structfield> field does not
  792. exist, <structfield>sample_format</structfield> is supposed to be
  793. <constant>VIDEO_PALETTE_RAW</constant>, equivalent to
  794. <constant>V4L2_PIX_FMT_GREY</constant>. The remaining fields are
  795. probably equivalent to &v4l2-vbi-format;.</para>
  796. <para>Apparently only the Zoran (ZR 36120) driver implements
  797. these ioctls. The semantics differ from those specified for V4L2 in two
  798. ways. The parameters are reset on &func-open; and
  799. <constant>VIDIOCSVBIFMT</constant> always returns an &EINVAL; if the
  800. parameters are invalid.</para>
  801. </section>
  802. <section>
  803. <title>Miscellaneous</title>
  804. <para>V4L2 has no equivalent of the
  805. <constant>VIDIOCGUNIT</constant> ioctl. Applications can find the VBI
  806. device associated with a video capture device (or vice versa) by
  807. reopening the device and requesting VBI data. For details see
  808. <xref linkend="open" />.</para>
  809. <para>No replacement exists for <constant>VIDIOCKEY</constant>,
  810. and the V4L functions for microcode programming. A new interface for
  811. MPEG compression and playback devices is documented in <xref
  812. linkend="extended-controls" />.</para>
  813. </section>
  814. </section>
  815. <section id="hist-v4l2">
  816. <title>Changes of the V4L2 API</title>
  817. <para>Soon after the V4L API was added to the kernel it was
  818. criticised as too inflexible. In August 1998 Bill Dirks proposed a
  819. number of improvements and began to work on documentation, example
  820. drivers and applications. With the help of other volunteers this
  821. eventually became the V4L2 API, not just an extension but a
  822. replacement for the V4L API. However it took another four years and
  823. two stable kernel releases until the new API was finally accepted for
  824. inclusion into the kernel in its present form.</para>
  825. <section>
  826. <title>Early Versions</title>
  827. <para>1998-08-20: First version.</para>
  828. <para>1998-08-27: The &func-select; function was introduced.</para>
  829. <para>1998-09-10: New video standard interface.</para>
  830. <para>1998-09-18: The <constant>VIDIOC_NONCAP</constant> ioctl
  831. was replaced by the otherwise meaningless <constant>O_TRUNC</constant>
  832. &func-open; flag, and the aliases <constant>O_NONCAP</constant> and
  833. <constant>O_NOIO</constant> were defined. Applications can set this
  834. flag if they intend to access controls only, as opposed to capture
  835. applications which need exclusive access. The
  836. <constant>VIDEO_STD_XXX</constant> identifiers are now ordinals
  837. instead of flags, and the <function>video_std_construct()</function>
  838. helper function takes id and transmission arguments.</para>
  839. <para>1998-09-28: Revamped video standard. Made video controls
  840. individually enumerable.</para>
  841. <para>1998-10-02: The <structfield>id</structfield> field was
  842. removed from struct <structname>video_standard</structname> and the
  843. color subcarrier fields were renamed. The &VIDIOC-QUERYSTD; ioctl was
  844. renamed to &VIDIOC-ENUMSTD;, &VIDIOC-G-INPUT; to &VIDIOC-ENUMINPUT;. A
  845. first draft of the Codec API was released.</para>
  846. <para>1998-11-08: Many minor changes. Most symbols have been
  847. renamed. Some material changes to &v4l2-capability;.</para>
  848. <para>1998-11-12: The read/write directon of some ioctls was misdefined.</para>
  849. <para>1998-11-14: <constant>V4L2_PIX_FMT_RGB24</constant>
  850. changed to <constant>V4L2_PIX_FMT_BGR24</constant>, and
  851. <constant>V4L2_PIX_FMT_RGB32</constant> changed to
  852. <constant>V4L2_PIX_FMT_BGR32</constant>. Audio controls are now
  853. accessible with the &VIDIOC-G-CTRL; and &VIDIOC-S-CTRL; ioctls under
  854. names starting with <constant>V4L2_CID_AUDIO</constant>. The
  855. <constant>V4L2_MAJOR</constant> define was removed from
  856. <filename>videodev.h</filename> since it was only used once in the
  857. <filename>videodev</filename> kernel module. The
  858. <constant>YUV422</constant> and <constant>YUV411</constant> planar
  859. image formats were added.</para>
  860. <para>1998-11-28: A few ioctl symbols changed. Interfaces for codecs and
  861. video output devices were added.</para>
  862. <para>1999-01-14: A raw VBI capture interface was added.</para>
  863. <para>1999-01-19: The <constant>VIDIOC_NEXTBUF</constant> ioctl
  864. was removed.</para>
  865. </section>
  866. <section>
  867. <title>V4L2 Version 0.16 1999-01-31</title>
  868. <para>1999-01-27: There is now one QBUF ioctl, VIDIOC_QWBUF and VIDIOC_QRBUF
  869. are gone. VIDIOC_QBUF takes a v4l2_buffer as a parameter. Added
  870. digital zoom (cropping) controls.</para>
  871. </section>
  872. <!-- Where's 0.17? mhs couldn't find that videodev.h, perhaps Bill
  873. forgot to bump the version number or never released it. -->
  874. <section>
  875. <title>V4L2 Version 0.18 1999-03-16</title>
  876. <para>Added a v4l to V4L2 ioctl compatibility layer to
  877. videodev.c. Driver writers, this changes how you implement your ioctl
  878. handler. See the Driver Writer's Guide. Added some more control id
  879. codes.</para>
  880. </section>
  881. <section>
  882. <title>V4L2 Version 0.19 1999-06-05</title>
  883. <para>1999-03-18: Fill in the category and catname fields of
  884. v4l2_queryctrl objects before passing them to the driver. Required a
  885. minor change to the VIDIOC_QUERYCTRL handlers in the sample
  886. drivers.</para>
  887. <para>1999-03-31: Better compatibility for v4l memory capture
  888. ioctls. Requires changes to drivers to fully support new compatibility
  889. features, see Driver Writer's Guide and v4l2cap.c. Added new control
  890. IDs: V4L2_CID_HFLIP, _VFLIP. Changed V4L2_PIX_FMT_YUV422P to _YUV422P,
  891. and _YUV411P to _YUV411P.</para>
  892. <para>1999-04-04: Added a few more control IDs.</para>
  893. <para>1999-04-07: Added the button control type.</para>
  894. <para>1999-05-02: Fixed a typo in videodev.h, and added the
  895. V4L2_CTRL_FLAG_GRAYED (later V4L2_CTRL_FLAG_GRABBED) flag.</para>
  896. <para>1999-05-20: Definition of VIDIOC_G_CTRL was wrong causing
  897. a malfunction of this ioctl.</para>
  898. <para>1999-06-05: Changed the value of
  899. V4L2_CID_WHITENESS.</para>
  900. </section>
  901. <section>
  902. <title>V4L2 Version 0.20 (1999-09-10)</title>
  903. <para>Version 0.20 introduced a number of changes which were
  904. <emphasis>not backward compatible</emphasis> with 0.19 and earlier
  905. versions. Purpose of these changes was to simplify the API, while
  906. making it more extensible and following common Linux driver API
  907. conventions.</para>
  908. <orderedlist>
  909. <listitem>
  910. <para>Some typos in <constant>V4L2_FMT_FLAG</constant>
  911. symbols were fixed. &v4l2-clip; was changed for compatibility with
  912. v4l. (1999-08-30)</para>
  913. </listitem>
  914. <listitem>
  915. <para><constant>V4L2_TUNER_SUB_LANG1</constant> was added.
  916. (1999-09-05)</para>
  917. </listitem>
  918. <listitem>
  919. <para>All ioctl() commands that used an integer argument now
  920. take a pointer to an integer. Where it makes sense, ioctls will return
  921. the actual new value in the integer pointed to by the argument, a
  922. common convention in the V4L2 API. The affected ioctls are:
  923. VIDIOC_PREVIEW, VIDIOC_STREAMON, VIDIOC_STREAMOFF, VIDIOC_S_FREQ,
  924. VIDIOC_S_INPUT, VIDIOC_S_OUTPUT, VIDIOC_S_EFFECT. For example
  925. <programlisting>
  926. err = ioctl (fd, VIDIOC_XXX, V4L2_XXX);
  927. </programlisting> becomes <programlisting>
  928. int a = V4L2_XXX; err = ioctl(fd, VIDIOC_XXX, &amp;a);
  929. </programlisting>
  930. </para>
  931. </listitem>
  932. <listitem>
  933. <para>All the different get- and set-format commands were
  934. swept into one &VIDIOC-G-FMT; and &VIDIOC-S-FMT; ioctl taking a union
  935. and a type field selecting the union member as parameter. Purpose is to
  936. simplify the API by eliminating several ioctls and to allow new and
  937. driver private data streams without adding new ioctls.</para>
  938. <para>This change obsoletes the following ioctls:
  939. <constant>VIDIOC_S_INFMT</constant>,
  940. <constant>VIDIOC_G_INFMT</constant>,
  941. <constant>VIDIOC_S_OUTFMT</constant>,
  942. <constant>VIDIOC_G_OUTFMT</constant>,
  943. <constant>VIDIOC_S_VBIFMT</constant> and
  944. <constant>VIDIOC_G_VBIFMT</constant>. The image format structure
  945. <structname>v4l2_format</structname> was renamed to &v4l2-pix-format;,
  946. while &v4l2-format; is now the envelopping structure for all format
  947. negotiations.</para>
  948. </listitem>
  949. <listitem>
  950. <para>Similar to the changes above, the
  951. <constant>VIDIOC_G_PARM</constant> and
  952. <constant>VIDIOC_S_PARM</constant> ioctls were merged with
  953. <constant>VIDIOC_G_OUTPARM</constant> and
  954. <constant>VIDIOC_S_OUTPARM</constant>. A
  955. <structfield>type</structfield> field in the new &v4l2-streamparm;
  956. selects the respective union member.</para>
  957. <para>This change obsoletes the
  958. <constant>VIDIOC_G_OUTPARM</constant> and
  959. <constant>VIDIOC_S_OUTPARM</constant> ioctls.</para>
  960. </listitem>
  961. <listitem>
  962. <para>Control enumeration was simplified, and two new
  963. control flags were introduced and one dropped. The
  964. <structfield>catname</structfield> field was replaced by a
  965. <structfield>group</structfield> field.</para>
  966. <para>Drivers can now flag unsupported and temporarily
  967. unavailable controls with <constant>V4L2_CTRL_FLAG_DISABLED</constant>
  968. and <constant>V4L2_CTRL_FLAG_GRABBED</constant> respectively. The
  969. <structfield>group</structfield> name indicates a possibly narrower
  970. classification than the <structfield>category</structfield>. In other
  971. words, there may be multiple groups within a category. Controls within
  972. a group would typically be drawn within a group box. Controls in
  973. different categories might have a greater separation, or may even
  974. appear in separate windows.</para>
  975. </listitem>
  976. <listitem>
  977. <para>The &v4l2-buffer; <structfield>timestamp</structfield>
  978. was changed to a 64 bit integer, containing the sampling or output
  979. time of the frame in nanoseconds. Additionally timestamps will be in
  980. absolute system time, not starting from zero at the beginning of a
  981. stream. The data type name for timestamps is stamp_t, defined as a
  982. signed 64-bit integer. Output devices should not send a buffer out
  983. until the time in the timestamp field has arrived. I would like to
  984. follow SGI's lead, and adopt a multimedia timestamping system like
  985. their UST (Unadjusted System Time). See
  986. http://web.archive.org/web/*/http://reality.sgi.com
  987. /cpirazzi_engr/lg/time/intro.html.
  988. UST uses timestamps that are 64-bit signed integers
  989. (not struct timeval's) and given in nanosecond units. The UST clock
  990. starts at zero when the system is booted and runs continuously and
  991. uniformly. It takes a little over 292 years for UST to overflow. There
  992. is no way to set the UST clock. The regular Linux time-of-day clock
  993. can be changed periodically, which would cause errors if it were being
  994. used for timestamping a multimedia stream. A real UST style clock will
  995. require some support in the kernel that is not there yet. But in
  996. anticipation, I will change the timestamp field to a 64-bit integer,
  997. and I will change the v4l2_masterclock_gettime() function (used only
  998. by drivers) to return a 64-bit integer.</para>
  999. </listitem>
  1000. <listitem>
  1001. <para>A <structfield>sequence</structfield> field was added
  1002. to &v4l2-buffer;. The <structfield>sequence</structfield> field counts
  1003. captured frames, it is ignored by output devices. When a capture
  1004. driver drops a frame, the sequence number of that frame is
  1005. skipped.</para>
  1006. </listitem>
  1007. </orderedlist>
  1008. </section>
  1009. <section>
  1010. <title>V4L2 Version 0.20 incremental changes</title>
  1011. <!-- Version number didn't change anymore, reason unknown. -->
  1012. <para>1999-12-23: In &v4l2-vbi-format; the
  1013. <structfield>reserved1</structfield> field became
  1014. <structfield>offset</structfield>. Previously drivers were required to
  1015. clear the <structfield>reserved1</structfield> field.</para>
  1016. <para>2000-01-13: The
  1017. <constant>V4L2_FMT_FLAG_NOT_INTERLACED</constant> flag was added.</para>
  1018. <para>2000-07-31: The <filename>linux/poll.h</filename> header
  1019. is now included by <filename>videodev.h</filename> for compatibility
  1020. with the original <filename>videodev.h</filename> file.</para>
  1021. <para>2000-11-20: <constant>V4L2_TYPE_VBI_OUTPUT</constant> and
  1022. <constant>V4L2_PIX_FMT_Y41P</constant> were added.</para>
  1023. <para>2000-11-25: <constant>V4L2_TYPE_VBI_INPUT</constant> was
  1024. added.</para>
  1025. <para>2000-12-04: A couple typos in symbol names were fixed.</para>
  1026. <para>2001-01-18: To avoid namespace conflicts the
  1027. <constant>fourcc</constant> macro defined in the
  1028. <filename>videodev.h</filename> header file was renamed to
  1029. <constant>v4l2_fourcc</constant>.</para>
  1030. <para>2001-01-25: A possible driver-level compatibility problem
  1031. between the <filename>videodev.h</filename> file in Linux 2.4.0 and
  1032. the <filename>videodev.h</filename> file included in the
  1033. <filename>videodevX</filename> patch was fixed. Users of an earlier
  1034. version of <filename>videodevX</filename> on Linux 2.4.0 should
  1035. recompile their V4L and V4L2 drivers.</para>
  1036. <para>2001-01-26: A possible kernel-level incompatibility
  1037. between the <filename>videodev.h</filename> file in the
  1038. <filename>videodevX</filename> patch and the
  1039. <filename>videodev.h</filename> file in Linux 2.2.x with devfs patches
  1040. applied was fixed.</para>
  1041. <para>2001-03-02: Certain V4L ioctls which pass data in both
  1042. direction although they are defined with read-only parameter, did not
  1043. work correctly through the backward compatibility layer.
  1044. [Solution?]</para>
  1045. <para>2001-04-13: Big endian 16-bit RGB formats were added.</para>
  1046. <para>2001-09-17: New YUV formats and the &VIDIOC-G-FREQUENCY; and
  1047. &VIDIOC-S-FREQUENCY; ioctls were added. (The old
  1048. <constant>VIDIOC_G_FREQ</constant> and
  1049. <constant>VIDIOC_S_FREQ</constant> ioctls did not take multiple tuners
  1050. into account.)</para>
  1051. <para>2000-09-18: <constant>V4L2_BUF_TYPE_VBI</constant> was
  1052. added. This may <emphasis>break compatibility</emphasis> as the
  1053. &VIDIOC-G-FMT; and &VIDIOC-S-FMT; ioctls may fail now if the struct
  1054. <structname>v4l2_fmt</structname> <structfield>type</structfield>
  1055. field does not contain <constant>V4L2_BUF_TYPE_VBI</constant>. In the
  1056. documentation of the &v4l2-vbi-format;
  1057. <structfield>offset</structfield> field the ambiguous phrase "rising
  1058. edge" was changed to "leading edge".</para>
  1059. </section>
  1060. <section>
  1061. <title>V4L2 Version 0.20 2000-11-23</title>
  1062. <para>A number of changes were made to the raw VBI
  1063. interface.</para>
  1064. <orderedlist>
  1065. <listitem>
  1066. <para>Figures clarifying the line numbering scheme were
  1067. added to the V4L2 API specification. The
  1068. <structfield>start</structfield>[0] and
  1069. <structfield>start</structfield>[1] fields no longer count line
  1070. numbers beginning at zero. Rationale: a) The previous definition was
  1071. unclear. b) The <structfield>start</structfield>[] values are ordinal
  1072. numbers. c) There is no point in inventing a new line numbering
  1073. scheme. We now use line number as defined by ITU-R, period.
  1074. Compatibility: Add one to the start values. Applications depending on
  1075. the previous semantics may not function correctly.</para>
  1076. </listitem>
  1077. <listitem>
  1078. <para>The restriction "count[0] &gt; 0 and count[1] &gt; 0"
  1079. has been relaxed to "(count[0] + count[1]) &gt; 0". Rationale:
  1080. Drivers may allocate resources at scan line granularity and some data
  1081. services are transmitted only on the first field. The comment that
  1082. both <structfield>count</structfield> values will usually be equal is
  1083. misleading and pointless and has been removed. This change
  1084. <emphasis>breaks compatibility</emphasis> with earlier versions:
  1085. Drivers may return EINVAL, applications may not function
  1086. correctly.</para>
  1087. </listitem>
  1088. <listitem>
  1089. <para>Drivers are again permitted to return negative
  1090. (unknown) start values as proposed earlier. Why this feature was
  1091. dropped is unclear. This change may <emphasis>break
  1092. compatibility</emphasis> with applications depending on the start
  1093. values being positive. The use of <constant>EBUSY</constant> and
  1094. <constant>EINVAL</constant> error codes with the &VIDIOC-S-FMT; ioctl
  1095. was clarified. The &EBUSY; was finally documented, and the
  1096. <structfield>reserved2</structfield> field which was previously
  1097. mentioned only in the <filename>videodev.h</filename> header
  1098. file.</para>
  1099. </listitem>
  1100. <listitem>
  1101. <para>New buffer types
  1102. <constant>V4L2_TYPE_VBI_INPUT</constant> and
  1103. <constant>V4L2_TYPE_VBI_OUTPUT</constant> were added. The former is an
  1104. alias for the old <constant>V4L2_TYPE_VBI</constant>, the latter was
  1105. missing in the <filename>videodev.h</filename> file.</para>
  1106. </listitem>
  1107. </orderedlist>
  1108. </section>
  1109. <section>
  1110. <title>V4L2 Version 0.20 2002-07-25</title>
  1111. <para>Added sliced VBI interface proposal.</para>
  1112. </section>
  1113. <section>
  1114. <title>V4L2 in Linux 2.5.46, 2002-10</title>
  1115. <para>Around October-November 2002, prior to an announced
  1116. feature freeze of Linux 2.5, the API was revised, drawing from
  1117. experience with V4L2 0.20. This unnamed version was finally merged
  1118. into Linux 2.5.46.</para>
  1119. <orderedlist>
  1120. <listitem>
  1121. <para>As specified in <xref linkend="related" />, drivers
  1122. must make related device functions available under all minor device
  1123. numbers.</para>
  1124. </listitem>
  1125. <listitem>
  1126. <para>The &func-open; function requires access mode
  1127. <constant>O_RDWR</constant> regardless of the device type. All V4L2
  1128. drivers exchanging data with applications must support the
  1129. <constant>O_NONBLOCK</constant> flag. The <constant>O_NOIO</constant>
  1130. flag, a V4L2 symbol which aliased the meaningless
  1131. <constant>O_TRUNC</constant> to indicate accesses without data
  1132. exchange (panel applications) was dropped. Drivers must stay in "panel
  1133. mode" until the application attempts to initiate a data exchange, see
  1134. <xref linkend="open" />.</para>
  1135. </listitem>
  1136. <listitem>
  1137. <para>The &v4l2-capability; changed dramatically. Note that
  1138. also the size of the structure changed, which is encoded in the ioctl
  1139. request code, thus older V4L2 devices will respond with an &EINVAL; to
  1140. the new &VIDIOC-QUERYCAP; ioctl.</para>
  1141. <para>There are new fields to identify the driver, a new RDS
  1142. device function <constant>V4L2_CAP_RDS_CAPTURE</constant>, the
  1143. <constant>V4L2_CAP_AUDIO</constant> flag indicates if the device has
  1144. any audio connectors, another I/O capability
  1145. <constant>V4L2_CAP_ASYNCIO</constant> can be flagged. In response to
  1146. these changes the <structfield>type</structfield> field became a bit
  1147. set and was merged into the <structfield>flags</structfield> field.
  1148. <constant>V4L2_FLAG_TUNER</constant> was renamed to
  1149. <constant>V4L2_CAP_TUNER</constant>,
  1150. <constant>V4L2_CAP_VIDEO_OVERLAY</constant> replaced
  1151. <constant>V4L2_FLAG_PREVIEW</constant> and
  1152. <constant>V4L2_CAP_VBI_CAPTURE</constant> and
  1153. <constant>V4L2_CAP_VBI_OUTPUT</constant> replaced
  1154. <constant>V4L2_FLAG_DATA_SERVICE</constant>.
  1155. <constant>V4L2_FLAG_READ</constant> and
  1156. <constant>V4L2_FLAG_WRITE</constant> were merged into
  1157. <constant>V4L2_CAP_READWRITE</constant>.</para>
  1158. <para>The redundant fields
  1159. <structfield>inputs</structfield>, <structfield>outputs</structfield>
  1160. and <structfield>audios</structfield> were removed. These properties
  1161. can be determined as described in <xref linkend="video" /> and <xref
  1162. linkend="audio" />.</para>
  1163. <para>The somewhat volatile and therefore barely useful
  1164. fields <structfield>maxwidth</structfield>,
  1165. <structfield>maxheight</structfield>,
  1166. <structfield>minwidth</structfield>,
  1167. <structfield>minheight</structfield>,
  1168. <structfield>maxframerate</structfield> were removed. This information
  1169. is available as described in <xref linkend="format" /> and
  1170. <xref linkend="standard" />.</para>
  1171. <para><constant>V4L2_FLAG_SELECT</constant> was removed. We
  1172. believe the select() function is important enough to require support
  1173. of it in all V4L2 drivers exchanging data with applications. The
  1174. redundant <constant>V4L2_FLAG_MONOCHROME</constant> flag was removed,
  1175. this information is available as described in <xref
  1176. linkend="format" />.</para>
  1177. </listitem>
  1178. <listitem>
  1179. <para>In &v4l2-input; the
  1180. <structfield>assoc_audio</structfield> field and the
  1181. <structfield>capability</structfield> field and its only flag
  1182. <constant>V4L2_INPUT_CAP_AUDIO</constant> was replaced by the new
  1183. <structfield>audioset</structfield> field. Instead of linking one
  1184. video input to one audio input this field reports all audio inputs
  1185. this video input combines with.</para>
  1186. <para>New fields are <structfield>tuner</structfield>
  1187. (reversing the former link from tuners to video inputs),
  1188. <structfield>std</structfield> and
  1189. <structfield>status</structfield>.</para>
  1190. <para>Accordingly &v4l2-output; lost its
  1191. <structfield>capability</structfield> and
  1192. <structfield>assoc_audio</structfield> fields.
  1193. <structfield>audioset</structfield>,
  1194. <structfield>modulator</structfield> and
  1195. <structfield>std</structfield> where added instead.</para>
  1196. </listitem>
  1197. <listitem>
  1198. <para>The &v4l2-audio; field
  1199. <structfield>audio</structfield> was renamed to
  1200. <structfield>index</structfield>, for consistency with other
  1201. structures. A new capability flag
  1202. <constant>V4L2_AUDCAP_STEREO</constant> was added to indicated if the
  1203. audio input in question supports stereo sound.
  1204. <constant>V4L2_AUDCAP_EFFECTS</constant> and the corresponding
  1205. <constant>V4L2_AUDMODE</constant> flags where removed. This can be
  1206. easily implemented using controls. (However the same applies to AVL
  1207. which is still there.)</para>
  1208. <para>Again for consistency the &v4l2-audioout; field
  1209. <structfield>audio</structfield> was renamed to
  1210. <structfield>index</structfield>.</para>
  1211. </listitem>
  1212. <listitem>
  1213. <para>The &v4l2-tuner;
  1214. <structfield>input</structfield> field was replaced by an
  1215. <structfield>index</structfield> field, permitting devices with
  1216. multiple tuners. The link between video inputs and tuners is now
  1217. reversed, inputs point to their tuner. The
  1218. <structfield>std</structfield> substructure became a
  1219. simple set (more about this below) and moved into &v4l2-input;. A
  1220. <structfield>type</structfield> field was added.</para>
  1221. <para>Accordingly in &v4l2-modulator; the
  1222. <structfield>output</structfield> was replaced by an
  1223. <structfield>index</structfield> field.</para>
  1224. <para>In &v4l2-frequency; the
  1225. <structfield>port</structfield> field was replaced by a
  1226. <structfield>tuner</structfield> field containing the respective tuner
  1227. or modulator index number. A tuner <structfield>type</structfield>
  1228. field was added and the <structfield>reserved</structfield> field
  1229. became larger for future extensions (satellite tuners in
  1230. particular).</para>
  1231. </listitem>
  1232. <listitem>
  1233. <para>The idea of completely transparent video standards was
  1234. dropped. Experience showed that applications must be able to work with
  1235. video standards beyond presenting the user a menu. Instead of
  1236. enumerating supported standards with an ioctl applications can now
  1237. refer to standards by &v4l2-std-id; and symbols defined in the
  1238. <filename>videodev2.h</filename> header file. For details see <xref
  1239. linkend="standard" />. The &VIDIOC-G-STD; and
  1240. &VIDIOC-S-STD; now take a pointer to this type as argument.
  1241. &VIDIOC-QUERYSTD; was added to autodetect the received standard, if
  1242. the hardware has this capability. In &v4l2-standard; an
  1243. <structfield>index</structfield> field was added for &VIDIOC-ENUMSTD;.
  1244. A &v4l2-std-id; field named <structfield>id</structfield> was added as
  1245. machine readable identifier, also replacing the
  1246. <structfield>transmission</structfield> field. The misleading
  1247. <structfield>framerate</structfield> field was renamed
  1248. to <structfield>frameperiod</structfield>. The now obsolete
  1249. <structfield>colorstandard</structfield> information, originally
  1250. needed to distguish between variations of standards, were
  1251. removed.</para>
  1252. <para>Struct <structname>v4l2_enumstd</structname> ceased to
  1253. be. &VIDIOC-ENUMSTD; now takes a pointer to a &v4l2-standard;
  1254. directly. The information which standards are supported by a
  1255. particular video input or output moved into &v4l2-input; and
  1256. &v4l2-output; fields named <structfield>std</structfield>,
  1257. respectively.</para>
  1258. </listitem>
  1259. <listitem>
  1260. <para>The &v4l2-queryctrl; fields
  1261. <structfield>category</structfield> and
  1262. <structfield>group</structfield> did not catch on and/or were not
  1263. implemented as expected and therefore removed.</para>
  1264. </listitem>
  1265. <listitem>
  1266. <para>The &VIDIOC-TRY-FMT; ioctl was added to negotiate data
  1267. formats as with &VIDIOC-S-FMT;, but without the overhead of
  1268. programming the hardware and regardless of I/O in progress.</para>
  1269. <para>In &v4l2-format; the <structfield>fmt</structfield>
  1270. union was extended to contain &v4l2-window;. All image format
  1271. negotiations are now possible with <constant>VIDIOC_G_FMT</constant>,
  1272. <constant>VIDIOC_S_FMT</constant> and
  1273. <constant>VIDIOC_TRY_FMT</constant>; ioctl. The
  1274. <constant>VIDIOC_G_WIN</constant> and
  1275. <constant>VIDIOC_S_WIN</constant> ioctls to prepare for a video
  1276. overlay were removed. The <structfield>type</structfield> field
  1277. changed to type &v4l2-buf-type; and the buffer type names changed as
  1278. follows.<informaltable>
  1279. <tgroup cols="2">
  1280. <thead>
  1281. <row>
  1282. <entry>Old defines</entry>
  1283. <entry>&v4l2-buf-type;</entry>
  1284. </row>
  1285. </thead>
  1286. <tbody valign="top">
  1287. <row>
  1288. <entry><constant>V4L2_BUF_TYPE_CAPTURE</constant></entry>
  1289. <entry><constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant></entry>
  1290. </row>
  1291. <row>
  1292. <entry><constant>V4L2_BUF_TYPE_CODECIN</constant></entry>
  1293. <entry>Omitted for now</entry>
  1294. </row>
  1295. <row>
  1296. <entry><constant>V4L2_BUF_TYPE_CODECOUT</constant></entry>
  1297. <entry>Omitted for now</entry>
  1298. </row>
  1299. <row>
  1300. <entry><constant>V4L2_BUF_TYPE_EFFECTSIN</constant></entry>
  1301. <entry>Omitted for now</entry>
  1302. </row>
  1303. <row>
  1304. <entry><constant>V4L2_BUF_TYPE_EFFECTSIN2</constant></entry>
  1305. <entry>Omitted for now</entry>
  1306. </row>
  1307. <row>
  1308. <entry><constant>V4L2_BUF_TYPE_EFFECTSOUT</constant></entry>
  1309. <entry>Omitted for now</entry>
  1310. </row>
  1311. <row>
  1312. <entry><constant>V4L2_BUF_TYPE_VIDEOOUT</constant></entry>
  1313. <entry><constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant></entry>
  1314. </row>
  1315. <row>
  1316. <entry><constant>-</constant></entry>
  1317. <entry><constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant></entry>
  1318. </row>
  1319. <row>
  1320. <entry><constant>-</constant></entry>
  1321. <entry><constant>V4L2_BUF_TYPE_VBI_CAPTURE</constant></entry>
  1322. </row>
  1323. <row>
  1324. <entry><constant>-</constant></entry>
  1325. <entry><constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant></entry>
  1326. </row>
  1327. <row>
  1328. <entry><constant>-</constant></entry>
  1329. <entry><constant>V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</constant></entry>
  1330. </row>
  1331. <row>
  1332. <entry><constant>-</constant></entry>
  1333. <entry><constant>V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</constant></entry>
  1334. </row>
  1335. <row>
  1336. <entry><constant>V4L2_BUF_TYPE_PRIVATE_BASE</constant></entry>
  1337. <entry><constant>V4L2_BUF_TYPE_PRIVATE</constant> (but this is deprecated)</entry>
  1338. </row>
  1339. </tbody>
  1340. </tgroup>
  1341. </informaltable></para>
  1342. </listitem>
  1343. <listitem>
  1344. <para>In &v4l2-fmtdesc; a &v4l2-buf-type; field named
  1345. <structfield>type</structfield> was added as in &v4l2-format;. The
  1346. <constant>VIDIOC_ENUM_FBUFFMT</constant> ioctl is no longer needed and
  1347. was removed. These calls can be replaced by &VIDIOC-ENUM-FMT; with
  1348. type <constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>.</para>
  1349. </listitem>
  1350. <listitem>
  1351. <para>In &v4l2-pix-format; the
  1352. <structfield>depth</structfield> field was removed, assuming
  1353. applications which recognize the format by its four-character-code
  1354. already know the color depth, and others do not care about it. The
  1355. same rationale lead to the removal of the
  1356. <constant>V4L2_FMT_FLAG_COMPRESSED</constant> flag. The
  1357. <constant>V4L2_FMT_FLAG_SWCONVECOMPRESSED</constant> flag was removed
  1358. because drivers are not supposed to convert images in kernel space. A
  1359. user library of conversion functions should be provided instead. The
  1360. <constant>V4L2_FMT_FLAG_BYTESPERLINE</constant> flag was redundant.
  1361. Applications can set the <structfield>bytesperline</structfield> field
  1362. to zero to get a reasonable default. Since the remaining flags were
  1363. replaced as well, the <structfield>flags</structfield> field itself
  1364. was removed.</para>
  1365. <para>The interlace flags were replaced by a &v4l2-field;
  1366. value in a newly added <structfield>field</structfield>
  1367. field.<informaltable>
  1368. <tgroup cols="2">
  1369. <thead>
  1370. <row>
  1371. <entry>Old flag</entry>
  1372. <entry>&v4l2-field;</entry>
  1373. </row>
  1374. </thead>
  1375. <tbody valign="top">
  1376. <row>
  1377. <entry><constant>V4L2_FMT_FLAG_NOT_INTERLACED</constant></entry>
  1378. <entry>?</entry>
  1379. </row>
  1380. <row>
  1381. <entry><constant>V4L2_FMT_FLAG_INTERLACED</constant>
  1382. = <constant>V4L2_FMT_FLAG_COMBINED</constant></entry>
  1383. <entry><constant>V4L2_FIELD_INTERLACED</constant></entry>
  1384. </row>
  1385. <row>
  1386. <entry><constant>V4L2_FMT_FLAG_TOPFIELD</constant>
  1387. = <constant>V4L2_FMT_FLAG_ODDFIELD</constant></entry>
  1388. <entry><constant>V4L2_FIELD_TOP</constant></entry>
  1389. </row>
  1390. <row>
  1391. <entry><constant>V4L2_FMT_FLAG_BOTFIELD</constant>
  1392. = <constant>V4L2_FMT_FLAG_EVENFIELD</constant></entry>
  1393. <entry><constant>V4L2_FIELD_BOTTOM</constant></entry>
  1394. </row>
  1395. <row>
  1396. <entry><constant>-</constant></entry>
  1397. <entry><constant>V4L2_FIELD_SEQ_TB</constant></entry>
  1398. </row>
  1399. <row>
  1400. <entry><constant>-</constant></entry>
  1401. <entry><constant>V4L2_FIELD_SEQ_BT</constant></entry>
  1402. </row>
  1403. <row>
  1404. <entry><constant>-</constant></entry>
  1405. <entry><constant>V4L2_FIELD_ALTERNATE</constant></entry>
  1406. </row>
  1407. </tbody>
  1408. </tgroup>
  1409. </informaltable></para>
  1410. <para>The color space flags were replaced by a
  1411. &v4l2-colorspace; value in a newly added
  1412. <structfield>colorspace</structfield> field, where one of
  1413. <constant>V4L2_COLORSPACE_SMPTE170M</constant>,
  1414. <constant>V4L2_COLORSPACE_BT878</constant>,
  1415. <constant>V4L2_COLORSPACE_470_SYSTEM_M</constant> or
  1416. <constant>V4L2_COLORSPACE_470_SYSTEM_BG</constant> replaces
  1417. <constant>V4L2_FMT_CS_601YUV</constant>.</para>
  1418. </listitem>
  1419. <listitem>
  1420. <para>In &v4l2-requestbuffers; the
  1421. <structfield>type</structfield> field was properly defined as
  1422. &v4l2-buf-type;. Buffer types changed as mentioned above. A new
  1423. <structfield>memory</structfield> field of type &v4l2-memory; was
  1424. added to distinguish between I/O methods using buffers allocated
  1425. by the driver or the application. See <xref linkend="io" /> for
  1426. details.</para>
  1427. </listitem>
  1428. <listitem>
  1429. <para>In &v4l2-buffer; the <structfield>type</structfield>
  1430. field was properly defined as &v4l2-buf-type;. Buffer types changed as
  1431. mentioned above. A <structfield>field</structfield> field of type
  1432. &v4l2-field; was added to indicate if a buffer contains a top or
  1433. bottom field. The old field flags were removed. Since no unadjusted
  1434. system time clock was added to the kernel as planned, the
  1435. <structfield>timestamp</structfield> field changed back from type
  1436. stamp_t, an unsigned 64 bit integer expressing the sample time in
  1437. nanoseconds, to struct <structname>timeval</structname>. With the
  1438. addition of a second memory mapping method the
  1439. <structfield>offset</structfield> field moved into union
  1440. <structfield>m</structfield>, and a new
  1441. <structfield>memory</structfield> field of type &v4l2-memory; was
  1442. added to distinguish between I/O methods. See <xref linkend="io" />
  1443. for details.</para>
  1444. <para>The <constant>V4L2_BUF_REQ_CONTIG</constant>
  1445. flag was used by the V4L compatibility layer, after changes to this
  1446. code it was no longer needed. The
  1447. <constant>V4L2_BUF_ATTR_DEVICEMEM</constant> flag would indicate if
  1448. the buffer was indeed allocated in device memory rather than DMA-able
  1449. system memory. It was barely useful and so was removed.</para>
  1450. </listitem>
  1451. <listitem>
  1452. <para>In &v4l2-framebuffer; the
  1453. <structfield>base[3]</structfield> array anticipating double- and
  1454. triple-buffering in off-screen video memory, however without defining
  1455. a synchronization mechanism, was replaced by a single pointer. The
  1456. <constant>V4L2_FBUF_CAP_SCALEUP</constant> and
  1457. <constant>V4L2_FBUF_CAP_SCALEDOWN</constant> flags were removed.
  1458. Applications can determine this capability more accurately using the
  1459. new cropping and scaling interface. The
  1460. <constant>V4L2_FBUF_CAP_CLIPPING</constant> flag was replaced by
  1461. <constant>V4L2_FBUF_CAP_LIST_CLIPPING</constant> and
  1462. <constant>V4L2_FBUF_CAP_BITMAP_CLIPPING</constant>.</para>
  1463. </listitem>
  1464. <listitem>
  1465. <para>In &v4l2-clip; the <structfield>x</structfield>,
  1466. <structfield>y</structfield>, <structfield>width</structfield> and
  1467. <structfield>height</structfield> field moved into a
  1468. <structfield>c</structfield> substructure of type &v4l2-rect;. The
  1469. <structfield>x</structfield> and <structfield>y</structfield> fields
  1470. were renamed to <structfield>left</structfield> and
  1471. <structfield>top</structfield>, &ie; offsets to a context dependent
  1472. origin.</para>
  1473. </listitem>
  1474. <listitem>
  1475. <para>In &v4l2-window; the <structfield>x</structfield>,
  1476. <structfield>y</structfield>, <structfield>width</structfield> and
  1477. <structfield>height</structfield> field moved into a
  1478. <structfield>w</structfield> substructure as above. A
  1479. <structfield>field</structfield> field of type %v4l2-field; was added
  1480. to distinguish between field and frame (interlaced) overlay.</para>
  1481. </listitem>
  1482. <listitem>
  1483. <para>The digital zoom interface, including struct
  1484. <structname>v4l2_zoomcap</structname>, struct
  1485. <structname>v4l2_zoom</structname>,
  1486. <constant>V4L2_ZOOM_NONCAP</constant> and
  1487. <constant>V4L2_ZOOM_WHILESTREAMING</constant> was replaced by a new
  1488. cropping and scaling interface. The previously unused struct
  1489. <structname>v4l2_cropcap</structname> and
  1490. <structname>v4l2_crop</structname> where redefined for this purpose.
  1491. See <xref linkend="crop" /> for details.</para>
  1492. </listitem>
  1493. <listitem>
  1494. <para>In &v4l2-vbi-format; the
  1495. <structfield>SAMPLE_FORMAT</structfield> field now contains a
  1496. four-character-code as used to identify video image formats and
  1497. <constant>V4L2_PIX_FMT_GREY</constant> replaces the
  1498. <constant>V4L2_VBI_SF_UBYTE</constant> define. The
  1499. <structfield>reserved</structfield> field was extended.</para>
  1500. </listitem>
  1501. <listitem>
  1502. <para>In &v4l2-captureparm; the type of the
  1503. <structfield>timeperframe</structfield> field changed from unsigned
  1504. long to &v4l2-fract;. This allows the accurate expression of multiples
  1505. of the NTSC-M frame rate 30000 / 1001. A new field
  1506. <structfield>readbuffers</structfield> was added to control the driver
  1507. behaviour in read I/O mode.</para>
  1508. <para>Similar changes were made to &v4l2-outputparm;.</para>
  1509. </listitem>
  1510. <listitem>
  1511. <para>The struct <structname>v4l2_performance</structname>
  1512. and <constant>VIDIOC_G_PERF</constant> ioctl were dropped. Except when
  1513. using the <link linkend="rw">read/write I/O method</link>, which is
  1514. limited anyway, this information is already available to
  1515. applications.</para>
  1516. </listitem>
  1517. <listitem>
  1518. <para>The example transformation from RGB to YCbCr color
  1519. space in the old V4L2 documentation was inaccurate, this has been
  1520. corrected in <xref linkend="pixfmt" />.<!-- 0.5670G should be
  1521. 0.587, and 127/112 != 255/224 --></para>
  1522. </listitem>
  1523. </orderedlist>
  1524. </section>
  1525. <section>
  1526. <title>V4L2 2003-06-19</title>
  1527. <orderedlist>
  1528. <listitem>
  1529. <para>A new capability flag
  1530. <constant>V4L2_CAP_RADIO</constant> was added for radio devices. Prior
  1531. to this change radio devices would identify solely by having exactly one
  1532. tuner whose type field reads <constant>V4L2_TUNER_RADIO</constant>.</para>
  1533. </listitem>
  1534. <listitem>
  1535. <para>An optional driver access priority mechanism was
  1536. added, see <xref linkend="app-pri" /> for details.</para>
  1537. </listitem>
  1538. <listitem>
  1539. <para>The audio input and output interface was found to be
  1540. incomplete.</para>
  1541. <para>Previously the &VIDIOC-G-AUDIO;
  1542. ioctl would enumerate the available audio inputs. An ioctl to
  1543. determine the current audio input, if more than one combines with the
  1544. current video input, did not exist. So
  1545. <constant>VIDIOC_G_AUDIO</constant> was renamed to
  1546. <constant>VIDIOC_G_AUDIO_OLD</constant>, this ioctl was removed on
  1547. Kernel 2.6.39. The &VIDIOC-ENUMAUDIO; ioctl was added to enumerate
  1548. audio inputs, while &VIDIOC-G-AUDIO; now reports the current audio
  1549. input.</para>
  1550. <para>The same changes were made to &VIDIOC-G-AUDOUT; and
  1551. &VIDIOC-ENUMAUDOUT;.</para>
  1552. <para>Until further the "videodev" module will automatically
  1553. translate between the old and new ioctls, but drivers and applications
  1554. must be updated to successfully compile again.</para>
  1555. </listitem>
  1556. <listitem>
  1557. <para>The &VIDIOC-OVERLAY; ioctl was incorrectly defined with
  1558. write-read parameter. It was changed to write-only, while the write-read
  1559. version was renamed to <constant>VIDIOC_OVERLAY_OLD</constant>. The old
  1560. ioctl was removed on Kernel 2.6.39. Until further the "videodev"
  1561. kernel module will automatically translate to the new version, so drivers
  1562. must be recompiled, but not applications.</para>
  1563. </listitem>
  1564. <listitem>
  1565. <para><xref linkend="overlay" /> incorrectly stated that
  1566. clipping rectangles define regions where the video can be seen.
  1567. Correct is that clipping rectangles define regions where
  1568. <emphasis>no</emphasis> video shall be displayed and so the graphics
  1569. surface can be seen.</para>
  1570. </listitem>
  1571. <listitem>
  1572. <para>The &VIDIOC-S-PARM; and &VIDIOC-S-CTRL; ioctls were
  1573. defined with write-only parameter, inconsistent with other ioctls
  1574. modifying their argument. They were changed to write-read, while a
  1575. <constant>_OLD</constant> suffix was added to the write-only versions.
  1576. The old ioctls were removed on Kernel 2.6.39. Drivers and
  1577. applications assuming a constant parameter need an update.</para>
  1578. </listitem>
  1579. </orderedlist>
  1580. </section>
  1581. <section>
  1582. <title>V4L2 2003-11-05</title>
  1583. <orderedlist>
  1584. <listitem>
  1585. <para>In <xref linkend="pixfmt-rgb" /> the following pixel
  1586. formats were incorrectly transferred from Bill Dirks' V4L2
  1587. specification. Descriptions below refer to bytes in memory, in
  1588. ascending address order.<informaltable>
  1589. <tgroup cols="3">
  1590. <thead>
  1591. <row>
  1592. <entry>Symbol</entry>
  1593. <entry>In this document prior to revision
  1594. 0.5</entry>
  1595. <entry>Corrected</entry>
  1596. </row>
  1597. </thead>
  1598. <tbody valign="top">
  1599. <row>
  1600. <entry><constant>V4L2_PIX_FMT_RGB24</constant></entry>
  1601. <entry>B, G, R</entry>
  1602. <entry>R, G, B</entry>
  1603. </row>
  1604. <row>
  1605. <entry><constant>V4L2_PIX_FMT_BGR24</constant></entry>
  1606. <entry>R, G, B</entry>
  1607. <entry>B, G, R</entry>
  1608. </row>
  1609. <row>
  1610. <entry><constant>V4L2_PIX_FMT_RGB32</constant></entry>
  1611. <entry>B, G, R, X</entry>
  1612. <entry>R, G, B, X</entry>
  1613. </row>
  1614. <row>
  1615. <entry><constant>V4L2_PIX_FMT_BGR32</constant></entry>
  1616. <entry>R, G, B, X</entry>
  1617. <entry>B, G, R, X</entry>
  1618. </row>
  1619. </tbody>
  1620. </tgroup>
  1621. </informaltable> The
  1622. <constant>V4L2_PIX_FMT_BGR24</constant> example was always
  1623. correct.</para>
  1624. <para>In <xref linkend="v4l-image-properties" /> the mapping
  1625. of the V4L <constant>VIDEO_PALETTE_RGB24</constant> and
  1626. <constant>VIDEO_PALETTE_RGB32</constant> formats to V4L2 pixel formats
  1627. was accordingly corrected.</para>
  1628. </listitem>
  1629. <listitem>
  1630. <para>Unrelated to the fixes above, drivers may still
  1631. interpret some V4L2 RGB pixel formats differently. These issues have
  1632. yet to be addressed, for details see <xref
  1633. linkend="pixfmt-rgb" />.</para>
  1634. </listitem>
  1635. </orderedlist>
  1636. </section>
  1637. <section>
  1638. <title>V4L2 in Linux 2.6.6, 2004-05-09</title>
  1639. <orderedlist>
  1640. <listitem>
  1641. <para>The &VIDIOC-CROPCAP; ioctl was incorrectly defined
  1642. with read-only parameter. It is now defined as write-read ioctl, while
  1643. the read-only version was renamed to
  1644. <constant>VIDIOC_CROPCAP_OLD</constant>. The old ioctl was removed
  1645. on Kernel 2.6.39.</para>
  1646. </listitem>
  1647. </orderedlist>
  1648. </section>
  1649. <section>
  1650. <title>V4L2 in Linux 2.6.8</title>
  1651. <orderedlist>
  1652. <listitem>
  1653. <para>A new field <structfield>input</structfield> (former
  1654. <structfield>reserved[0]</structfield>) was added to the &v4l2-buffer;
  1655. structure. Purpose of this field is to alternate between video inputs
  1656. (&eg; cameras) in step with the video capturing process. This function
  1657. must be enabled with the new <constant>V4L2_BUF_FLAG_INPUT</constant>
  1658. flag. The <structfield>flags</structfield> field is no longer
  1659. read-only.</para>
  1660. </listitem>
  1661. </orderedlist>
  1662. </section>
  1663. <section>
  1664. <title>V4L2 spec erratum 2004-08-01</title>
  1665. <orderedlist>
  1666. <listitem>
  1667. <para>The return value of the
  1668. <xref linkend="func-open" /> function was incorrectly documented.</para>
  1669. </listitem>
  1670. <listitem>
  1671. <para>Audio output ioctls end in -AUDOUT, not -AUDIOOUT.</para>
  1672. </listitem>
  1673. <listitem>
  1674. <para>In the Current Audio Input example the
  1675. <constant>VIDIOC_G_AUDIO</constant> ioctl took the wrong
  1676. argument.</para>
  1677. </listitem>
  1678. <listitem>
  1679. <para>The documentation of the &VIDIOC-QBUF; and
  1680. &VIDIOC-DQBUF; ioctls did not mention the &v4l2-buffer;
  1681. <structfield>memory</structfield> field. It was also missing from
  1682. examples. Also on the <constant>VIDIOC_DQBUF</constant> page the &EIO;
  1683. was not documented.</para>
  1684. </listitem>
  1685. </orderedlist>
  1686. </section>
  1687. <section>
  1688. <title>V4L2 in Linux 2.6.14</title>
  1689. <orderedlist>
  1690. <listitem>
  1691. <para>A new sliced VBI interface was added. It is documented
  1692. in <xref linkend="sliced" /> and replaces the interface first
  1693. proposed in V4L2 specification 0.8.</para>
  1694. </listitem>
  1695. </orderedlist>
  1696. </section>
  1697. <section>
  1698. <title>V4L2 in Linux 2.6.15</title>
  1699. <orderedlist>
  1700. <listitem>
  1701. <para>The &VIDIOC-LOG-STATUS; ioctl was added.</para>
  1702. </listitem>
  1703. <listitem>
  1704. <para>New video standards
  1705. <constant>V4L2_STD_NTSC_443</constant>,
  1706. <constant>V4L2_STD_SECAM_LC</constant>,
  1707. <constant>V4L2_STD_SECAM_DK</constant> (a set of SECAM D, K and K1),
  1708. and <constant>V4L2_STD_ATSC</constant> (a set of
  1709. <constant>V4L2_STD_ATSC_8_VSB</constant> and
  1710. <constant>V4L2_STD_ATSC_16_VSB</constant>) were defined. Note the
  1711. <constant>V4L2_STD_525_60</constant> set now includes
  1712. <constant>V4L2_STD_NTSC_443</constant>. See also <xref
  1713. linkend="v4l2-std-id" />.</para>
  1714. </listitem>
  1715. <listitem>
  1716. <para>The <constant>VIDIOC_G_COMP</constant> and
  1717. <constant>VIDIOC_S_COMP</constant> ioctl were renamed to
  1718. <constant>VIDIOC_G_MPEGCOMP</constant> and
  1719. <constant>VIDIOC_S_MPEGCOMP</constant> respectively. Their argument
  1720. was replaced by a struct
  1721. <structname>v4l2_mpeg_compression</structname> pointer. (The
  1722. <constant>VIDIOC_G_MPEGCOMP</constant> and
  1723. <constant>VIDIOC_S_MPEGCOMP</constant> ioctls where removed in Linux
  1724. 2.6.25.)</para>
  1725. </listitem>
  1726. </orderedlist>
  1727. </section>
  1728. <section>
  1729. <title>V4L2 spec erratum 2005-11-27</title>
  1730. <para>The capture example in <xref linkend="capture-example" />
  1731. called the &VIDIOC-S-CROP; ioctl without checking if cropping is
  1732. supported. In the video standard selection example in
  1733. <xref linkend="standard" /> the &VIDIOC-S-STD; call used the wrong
  1734. argument type.</para>
  1735. </section>
  1736. <section>
  1737. <title>V4L2 spec erratum 2006-01-10</title>
  1738. <orderedlist>
  1739. <listitem>
  1740. <para>The <constant>V4L2_IN_ST_COLOR_KILL</constant> flag in
  1741. &v4l2-input; not only indicates if the color killer is enabled, but
  1742. also if it is active. (The color killer disables color decoding when
  1743. it detects no color in the video signal to improve the image
  1744. quality.)</para>
  1745. </listitem>
  1746. <listitem>
  1747. <para>&VIDIOC-S-PARM; is a write-read ioctl, not write-only as
  1748. stated on its reference page. The ioctl changed in 2003 as noted above.</para>
  1749. </listitem>
  1750. </orderedlist>
  1751. </section>
  1752. <section>
  1753. <title>V4L2 spec erratum 2006-02-03</title>
  1754. <orderedlist>
  1755. <listitem>
  1756. <para>In &v4l2-captureparm; and &v4l2-outputparm; the
  1757. <structfield>timeperframe</structfield> field gives the time in
  1758. seconds, not microseconds.</para>
  1759. </listitem>
  1760. </orderedlist>
  1761. </section>
  1762. <section>
  1763. <title>V4L2 spec erratum 2006-02-04</title>
  1764. <orderedlist>
  1765. <listitem>
  1766. <para>The <structfield>clips</structfield> field in
  1767. &v4l2-window; must point to an array of &v4l2-clip;, not a linked
  1768. list, because drivers ignore the struct
  1769. <structname>v4l2_clip</structname>.<structfield>next</structfield>
  1770. pointer.</para>
  1771. </listitem>
  1772. </orderedlist>
  1773. </section>
  1774. <section>
  1775. <title>V4L2 in Linux 2.6.17</title>
  1776. <orderedlist>
  1777. <listitem>
  1778. <para>New video standard macros were added:
  1779. <constant>V4L2_STD_NTSC_M_KR</constant> (NTSC M South Korea), and the
  1780. sets <constant>V4L2_STD_MN</constant>,
  1781. <constant>V4L2_STD_B</constant>, <constant>V4L2_STD_GH</constant> and
  1782. <constant>V4L2_STD_DK</constant>. The
  1783. <constant>V4L2_STD_NTSC</constant> and
  1784. <constant>V4L2_STD_SECAM</constant> sets now include
  1785. <constant>V4L2_STD_NTSC_M_KR</constant> and
  1786. <constant>V4L2_STD_SECAM_LC</constant> respectively.</para>
  1787. </listitem>
  1788. <listitem>
  1789. <para>A new <constant>V4L2_TUNER_MODE_LANG1_LANG2</constant>
  1790. was defined to record both languages of a bilingual program. The
  1791. use of <constant>V4L2_TUNER_MODE_STEREO</constant> for this purpose
  1792. is deprecated now. See the &VIDIOC-G-TUNER; section for
  1793. details.</para>
  1794. </listitem>
  1795. </orderedlist>
  1796. </section>
  1797. <section>
  1798. <title>V4L2 spec erratum 2006-09-23 (Draft 0.15)</title>
  1799. <orderedlist>
  1800. <listitem>
  1801. <para>In various places
  1802. <constant>V4L2_BUF_TYPE_SLICED_VBI_CAPTURE</constant> and
  1803. <constant>V4L2_BUF_TYPE_SLICED_VBI_OUTPUT</constant> of the sliced VBI
  1804. interface were not mentioned along with other buffer types.</para>
  1805. </listitem>
  1806. <listitem>
  1807. <para>In <xref linkend="vidioc-g-audio" /> it was clarified
  1808. that the &v4l2-audio; <structfield>mode</structfield> field is a flags
  1809. field.</para>
  1810. </listitem>
  1811. <listitem>
  1812. <para><xref linkend="vidioc-querycap" /> did not mention the
  1813. sliced VBI and radio capability flags.</para>
  1814. </listitem>
  1815. <listitem>
  1816. <para>In <xref linkend="vidioc-g-frequency" /> it was
  1817. clarified that applications must initialize the tuner
  1818. <structfield>type</structfield> field of &v4l2-frequency; before
  1819. calling &VIDIOC-S-FREQUENCY;.</para>
  1820. </listitem>
  1821. <listitem>
  1822. <para>The <structfield>reserved</structfield> array
  1823. in &v4l2-requestbuffers; has 2 elements, not 32.</para>
  1824. </listitem>
  1825. <listitem>
  1826. <para>In <xref linkend="output" /> and <xref
  1827. linkend="raw-vbi" /> the device file names
  1828. <filename>/dev/vout</filename> which never caught on were replaced
  1829. by <filename>/dev/video</filename>.</para>
  1830. </listitem>
  1831. <listitem>
  1832. <para>With Linux 2.6.15 the possible range for VBI device minor
  1833. numbers was extended from 224-239 to 224-255. Accordingly device file names
  1834. <filename>/dev/vbi0</filename> to <filename>/dev/vbi31</filename> are
  1835. possible now.</para>
  1836. </listitem>
  1837. </orderedlist>
  1838. </section>
  1839. <section>
  1840. <title>V4L2 in Linux 2.6.18</title>
  1841. <orderedlist>
  1842. <listitem>
  1843. <para>New ioctls &VIDIOC-G-EXT-CTRLS;, &VIDIOC-S-EXT-CTRLS;
  1844. and &VIDIOC-TRY-EXT-CTRLS; were added, a flag to skip unsupported
  1845. controls with &VIDIOC-QUERYCTRL;, new control types
  1846. <constant>V4L2_CTRL_TYPE_INTEGER64</constant> and
  1847. <constant>V4L2_CTRL_TYPE_CTRL_CLASS</constant> (<xref
  1848. linkend="v4l2-ctrl-type" />), and new control flags
  1849. <constant>V4L2_CTRL_FLAG_READ_ONLY</constant>,
  1850. <constant>V4L2_CTRL_FLAG_UPDATE</constant>,
  1851. <constant>V4L2_CTRL_FLAG_INACTIVE</constant> and
  1852. <constant>V4L2_CTRL_FLAG_SLIDER</constant> (<xref
  1853. linkend="control-flags" />). See <xref
  1854. linkend="extended-controls" /> for details.</para>
  1855. </listitem>
  1856. </orderedlist>
  1857. </section>
  1858. <section>
  1859. <title>V4L2 in Linux 2.6.19</title>
  1860. <orderedlist>
  1861. <listitem>
  1862. <para>In &v4l2-sliced-vbi-cap; a buffer type field was added
  1863. replacing a reserved field. Note on architectures where the size of
  1864. enum types differs from int types the size of the structure changed.
  1865. The &VIDIOC-G-SLICED-VBI-CAP; ioctl was redefined from being read-only
  1866. to write-read. Applications must initialize the type field and clear
  1867. the reserved fields now. These changes may <emphasis>break the
  1868. compatibility</emphasis> with older drivers and applications.</para>
  1869. </listitem>
  1870. <listitem>
  1871. <para>The ioctls &VIDIOC-ENUM-FRAMESIZES; and
  1872. &VIDIOC-ENUM-FRAMEINTERVALS; were added.</para>
  1873. </listitem>
  1874. <listitem>
  1875. <para>A new pixel format <constant>V4L2_PIX_FMT_RGB444</constant> (<xref
  1876. linkend="rgb-formats" />) was added.</para>
  1877. </listitem>
  1878. </orderedlist>
  1879. </section>
  1880. <section>
  1881. <title>V4L2 spec erratum 2006-10-12 (Draft 0.17)</title>
  1882. <orderedlist>
  1883. <listitem>
  1884. <para><constant>V4L2_PIX_FMT_HM12</constant> (<xref
  1885. linkend="reserved-formats" />) is a YUV 4:2:0, not 4:2:2 format.</para>
  1886. </listitem>
  1887. </orderedlist>
  1888. </section>
  1889. <section>
  1890. <title>V4L2 in Linux 2.6.21</title>
  1891. <orderedlist>
  1892. <listitem>
  1893. <para>The <filename>videodev2.h</filename> header file is
  1894. now dual licensed under GNU General Public License version two or
  1895. later, and under a 3-clause BSD-style license.</para>
  1896. </listitem>
  1897. </orderedlist>
  1898. </section>
  1899. <section>
  1900. <title>V4L2 in Linux 2.6.22</title>
  1901. <orderedlist>
  1902. <listitem>
  1903. <para>Two new field orders
  1904. <constant>V4L2_FIELD_INTERLACED_TB</constant> and
  1905. <constant>V4L2_FIELD_INTERLACED_BT</constant> were
  1906. added. See <xref linkend="v4l2-field" /> for details.</para>
  1907. </listitem>
  1908. <listitem>
  1909. <para>Three new clipping/blending methods with a global or
  1910. straight or inverted local alpha value were added to the video overlay
  1911. interface. See the description of the &VIDIOC-G-FBUF; and
  1912. &VIDIOC-S-FBUF; ioctls for details.</para>
  1913. <para>A new <structfield>global_alpha</structfield> field
  1914. was added to <link
  1915. linkend="v4l2-window"><structname>v4l2_window</structname></link>,
  1916. extending the structure. This may <emphasis>break
  1917. compatibility</emphasis> with applications using a struct
  1918. <structname>v4l2_window</structname> directly. However the <link
  1919. linkend="vidioc-g-fmt">VIDIOC_G/S/TRY_FMT</link> ioctls, which take a
  1920. pointer to a <link linkend="v4l2-format">v4l2_format</link> parent
  1921. structure with padding bytes at the end, are not affected.</para>
  1922. </listitem>
  1923. <listitem>
  1924. <para>The format of the <structfield>chromakey</structfield>
  1925. field in &v4l2-window; changed from "host order RGB32" to a pixel
  1926. value in the same format as the framebuffer. This may <emphasis>break
  1927. compatibility</emphasis> with existing applications. Drivers
  1928. supporting the "host order RGB32" format are not known.</para>
  1929. </listitem>
  1930. </orderedlist>
  1931. </section>
  1932. <section>
  1933. <title>V4L2 in Linux 2.6.24</title>
  1934. <orderedlist>
  1935. <listitem>
  1936. <para>The pixel formats
  1937. <constant>V4L2_PIX_FMT_PAL8</constant>,
  1938. <constant>V4L2_PIX_FMT_YUV444</constant>,
  1939. <constant>V4L2_PIX_FMT_YUV555</constant>,
  1940. <constant>V4L2_PIX_FMT_YUV565</constant> and
  1941. <constant>V4L2_PIX_FMT_YUV32</constant> were added.</para>
  1942. </listitem>
  1943. </orderedlist>
  1944. </section>
  1945. <section>
  1946. <title>V4L2 in Linux 2.6.25</title>
  1947. <orderedlist>
  1948. <listitem>
  1949. <para>The pixel formats <link linkend="V4L2-PIX-FMT-Y16">
  1950. <constant>V4L2_PIX_FMT_Y16</constant></link> and <link
  1951. linkend="V4L2-PIX-FMT-SBGGR16">
  1952. <constant>V4L2_PIX_FMT_SBGGR16</constant></link> were added.</para>
  1953. </listitem>
  1954. <listitem>
  1955. <para>New <link linkend="control">controls</link>
  1956. <constant>V4L2_CID_POWER_LINE_FREQUENCY</constant>,
  1957. <constant>V4L2_CID_HUE_AUTO</constant>,
  1958. <constant>V4L2_CID_WHITE_BALANCE_TEMPERATURE</constant>,
  1959. <constant>V4L2_CID_SHARPNESS</constant> and
  1960. <constant>V4L2_CID_BACKLIGHT_COMPENSATION</constant> were added. The
  1961. controls <constant>V4L2_CID_BLACK_LEVEL</constant>,
  1962. <constant>V4L2_CID_WHITENESS</constant>,
  1963. <constant>V4L2_CID_HCENTER</constant> and
  1964. <constant>V4L2_CID_VCENTER</constant> were deprecated.
  1965. </para>
  1966. </listitem>
  1967. <listitem>
  1968. <para>A <link linkend="camera-controls">Camera controls
  1969. class</link> was added, with the new controls
  1970. <constant>V4L2_CID_EXPOSURE_AUTO</constant>,
  1971. <constant>V4L2_CID_EXPOSURE_ABSOLUTE</constant>,
  1972. <constant>V4L2_CID_EXPOSURE_AUTO_PRIORITY</constant>,
  1973. <constant>V4L2_CID_PAN_RELATIVE</constant>,
  1974. <constant>V4L2_CID_TILT_RELATIVE</constant>,
  1975. <constant>V4L2_CID_PAN_RESET</constant>,
  1976. <constant>V4L2_CID_TILT_RESET</constant>,
  1977. <constant>V4L2_CID_PAN_ABSOLUTE</constant>,
  1978. <constant>V4L2_CID_TILT_ABSOLUTE</constant>,
  1979. <constant>V4L2_CID_FOCUS_ABSOLUTE</constant>,
  1980. <constant>V4L2_CID_FOCUS_RELATIVE</constant> and
  1981. <constant>V4L2_CID_FOCUS_AUTO</constant>.</para>
  1982. </listitem>
  1983. <listitem>
  1984. <para>The <constant>VIDIOC_G_MPEGCOMP</constant> and
  1985. <constant>VIDIOC_S_MPEGCOMP</constant> ioctls, which were superseded
  1986. by the <link linkend="extended-controls">extended controls</link>
  1987. interface in Linux 2.6.18, where finally removed from the
  1988. <filename>videodev2.h</filename> header file.</para>
  1989. </listitem>
  1990. </orderedlist>
  1991. </section>
  1992. <section>
  1993. <title>V4L2 in Linux 2.6.26</title>
  1994. <orderedlist>
  1995. <listitem>
  1996. <para>The pixel formats
  1997. <constant>V4L2_PIX_FMT_Y16</constant> and
  1998. <constant>V4L2_PIX_FMT_SBGGR16</constant> were added.</para>
  1999. </listitem>
  2000. <listitem>
  2001. <para>Added user controls
  2002. <constant>V4L2_CID_CHROMA_AGC</constant> and
  2003. <constant>V4L2_CID_COLOR_KILLER</constant>.</para>
  2004. </listitem>
  2005. </orderedlist>
  2006. </section>
  2007. <section>
  2008. <title>V4L2 in Linux 2.6.27</title>
  2009. <orderedlist>
  2010. <listitem>
  2011. <para>The &VIDIOC-S-HW-FREQ-SEEK; ioctl and the
  2012. <constant>V4L2_CAP_HW_FREQ_SEEK</constant> capability were added.</para>
  2013. </listitem>
  2014. <listitem>
  2015. <para>The pixel formats
  2016. <constant>V4L2_PIX_FMT_YVYU</constant>,
  2017. <constant>V4L2_PIX_FMT_PCA501</constant>,
  2018. <constant>V4L2_PIX_FMT_PCA505</constant>,
  2019. <constant>V4L2_PIX_FMT_PCA508</constant>,
  2020. <constant>V4L2_PIX_FMT_PCA561</constant>,
  2021. <constant>V4L2_PIX_FMT_SGBRG8</constant>,
  2022. <constant>V4L2_PIX_FMT_PAC207</constant> and
  2023. <constant>V4L2_PIX_FMT_PJPG</constant> were added.</para>
  2024. </listitem>
  2025. </orderedlist>
  2026. </section>
  2027. <section>
  2028. <title>V4L2 in Linux 2.6.28</title>
  2029. <orderedlist>
  2030. <listitem>
  2031. <para>Added <constant>V4L2_MPEG_AUDIO_ENCODING_AAC</constant> and
  2032. <constant>V4L2_MPEG_AUDIO_ENCODING_AC3</constant> MPEG audio encodings.</para>
  2033. </listitem>
  2034. <listitem>
  2035. <para>Added <constant>V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC</constant> MPEG
  2036. video encoding.</para>
  2037. </listitem>
  2038. <listitem>
  2039. <para>The pixel formats
  2040. <constant>V4L2_PIX_FMT_SGRBG10</constant> and
  2041. <constant>V4L2_PIX_FMT_SGRBG10DPCM8</constant> were added.</para>
  2042. </listitem>
  2043. </orderedlist>
  2044. </section>
  2045. <section>
  2046. <title>V4L2 in Linux 2.6.29</title>
  2047. <orderedlist>
  2048. <listitem>
  2049. <para>The <constant>VIDIOC_G_CHIP_IDENT</constant> ioctl was renamed
  2050. to <constant>VIDIOC_G_CHIP_IDENT_OLD</constant> and <constant>VIDIOC_DBG_G_CHIP_IDENT</constant>
  2051. was introduced in its place. The old struct <structname>v4l2_chip_ident</structname>
  2052. was renamed to <structname id="v4l2-chip-ident-old">v4l2_chip_ident_old</structname>.</para>
  2053. </listitem>
  2054. <listitem>
  2055. <para>The pixel formats
  2056. <constant>V4L2_PIX_FMT_VYUY</constant>,
  2057. <constant>V4L2_PIX_FMT_NV16</constant> and
  2058. <constant>V4L2_PIX_FMT_NV61</constant> were added.</para>
  2059. </listitem>
  2060. <listitem>
  2061. <para>Added camera controls
  2062. <constant>V4L2_CID_ZOOM_ABSOLUTE</constant>,
  2063. <constant>V4L2_CID_ZOOM_RELATIVE</constant>,
  2064. <constant>V4L2_CID_ZOOM_CONTINUOUS</constant> and
  2065. <constant>V4L2_CID_PRIVACY</constant>.</para>
  2066. </listitem>
  2067. </orderedlist>
  2068. </section>
  2069. <section>
  2070. <title>V4L2 in Linux 2.6.30</title>
  2071. <orderedlist>
  2072. <listitem>
  2073. <para>New control flag <constant>V4L2_CTRL_FLAG_WRITE_ONLY</constant> was added.</para>
  2074. </listitem>
  2075. <listitem>
  2076. <para>New control <constant>V4L2_CID_COLORFX</constant> was added.</para>
  2077. </listitem>
  2078. </orderedlist>
  2079. </section>
  2080. <section>
  2081. <title>V4L2 in Linux 2.6.32</title>
  2082. <orderedlist>
  2083. <listitem>
  2084. <para>In order to be easier to compare a V4L2 API and a kernel
  2085. version, now V4L2 API is numbered using the Linux Kernel version numeration.</para>
  2086. </listitem>
  2087. <listitem>
  2088. <para>Finalized the RDS capture API. See <xref linkend="rds" /> for
  2089. more information.</para>
  2090. </listitem>
  2091. <listitem>
  2092. <para>Added new capabilities for modulators and RDS encoders.</para>
  2093. </listitem>
  2094. <listitem>
  2095. <para>Add description for libv4l API.</para>
  2096. </listitem>
  2097. <listitem>
  2098. <para>Added support for string controls via new type <constant>V4L2_CTRL_TYPE_STRING</constant>.</para>
  2099. </listitem>
  2100. <listitem>
  2101. <para>Added <constant>V4L2_CID_BAND_STOP_FILTER</constant> documentation.</para>
  2102. </listitem>
  2103. <listitem>
  2104. <para>Added FM Modulator (FM TX) Extended Control Class: <constant>V4L2_CTRL_CLASS_FM_TX</constant> and their Control IDs.</para>
  2105. </listitem>
  2106. <listitem>
  2107. <para>Added FM Receiver (FM RX) Extended Control Class: <constant>V4L2_CTRL_CLASS_FM_RX</constant> and their Control IDs.</para>
  2108. </listitem>
  2109. <listitem>
  2110. <para>Added Remote Controller chapter, describing the default Remote Controller mapping for media devices.</para>
  2111. </listitem>
  2112. </orderedlist>
  2113. </section>
  2114. <section>
  2115. <title>V4L2 in Linux 2.6.33</title>
  2116. <orderedlist>
  2117. <listitem>
  2118. <para>Added support for Digital Video timings in order to support HDTV receivers and transmitters.</para>
  2119. </listitem>
  2120. </orderedlist>
  2121. </section>
  2122. <section>
  2123. <title>V4L2 in Linux 2.6.34</title>
  2124. <orderedlist>
  2125. <listitem>
  2126. <para>Added
  2127. <constant>V4L2_CID_IRIS_ABSOLUTE</constant> and
  2128. <constant>V4L2_CID_IRIS_RELATIVE</constant> controls to the
  2129. <link linkend="camera-controls">Camera controls class</link>.
  2130. </para>
  2131. </listitem>
  2132. </orderedlist>
  2133. </section>
  2134. <section>
  2135. <title>V4L2 in Linux 2.6.37</title>
  2136. <orderedlist>
  2137. <listitem>
  2138. <para>Remove the vtx (videotext/teletext) API. This API was no longer
  2139. used and no hardware exists to verify the API. Nor were any userspace applications found
  2140. that used it. It was originally scheduled for removal in 2.6.35.
  2141. </para>
  2142. </listitem>
  2143. </orderedlist>
  2144. </section>
  2145. <section>
  2146. <title>V4L2 in Linux 2.6.39</title>
  2147. <orderedlist>
  2148. <listitem>
  2149. <para>The old VIDIOC_*_OLD symbols and V4L1 support were removed.</para>
  2150. </listitem>
  2151. <listitem>
  2152. <para>Multi-planar API added. Does not affect the compatibility of
  2153. current drivers and applications. See
  2154. <link linkend="planar-apis">multi-planar API</link>
  2155. for details.</para>
  2156. </listitem>
  2157. </orderedlist>
  2158. </section>
  2159. <section>
  2160. <title>V4L2 in Linux 3.1</title>
  2161. <orderedlist>
  2162. <listitem>
  2163. <para>VIDIOC_QUERYCAP now returns a per-subsystem version instead of a per-driver one.</para>
  2164. <para>Standardize an error code for invalid ioctl.</para>
  2165. <para>Added V4L2_CTRL_TYPE_BITMASK.</para>
  2166. </listitem>
  2167. </orderedlist>
  2168. </section>
  2169. <section>
  2170. <title>V4L2 in Linux 3.2</title>
  2171. <orderedlist>
  2172. <listitem>
  2173. <para>V4L2_CTRL_FLAG_VOLATILE was added to signal volatile controls to userspace.</para>
  2174. </listitem>
  2175. <listitem>
  2176. <para>Add selection API for extended control over cropping
  2177. and composing. Does not affect the compatibility of current
  2178. drivers and applications. See <link
  2179. linkend="selection-api"> selection API </link> for
  2180. details.</para>
  2181. </listitem>
  2182. </orderedlist>
  2183. </section>
  2184. <section>
  2185. <title>V4L2 in Linux 3.3</title>
  2186. <orderedlist>
  2187. <listitem>
  2188. <para>Added <constant>V4L2_CID_ALPHA_COMPONENT</constant> control
  2189. to the <link linkend="control">User controls class</link>.
  2190. </para>
  2191. </listitem>
  2192. <listitem>
  2193. <para>Added the device_caps field to struct v4l2_capabilities and added the new
  2194. V4L2_CAP_DEVICE_CAPS capability.</para>
  2195. </listitem>
  2196. </orderedlist>
  2197. </section>
  2198. <section>
  2199. <title>V4L2 in Linux 3.4</title>
  2200. <orderedlist>
  2201. <listitem>
  2202. <para>Added <link linkend="jpeg-controls">JPEG compression control
  2203. class</link>.</para>
  2204. </listitem>
  2205. <listitem>
  2206. <para>Extended the DV Timings API:
  2207. &VIDIOC-ENUM-DV-TIMINGS;, &VIDIOC-QUERY-DV-TIMINGS; and
  2208. &VIDIOC-DV-TIMINGS-CAP;.</para>
  2209. </listitem>
  2210. </orderedlist>
  2211. </section>
  2212. <section>
  2213. <title>V4L2 in Linux 3.5</title>
  2214. <orderedlist>
  2215. <listitem>
  2216. <para>Added integer menus, the new type will be
  2217. V4L2_CTRL_TYPE_INTEGER_MENU.</para>
  2218. </listitem>
  2219. <listitem>
  2220. <para>Added selection API for V4L2 subdev interface:
  2221. &VIDIOC-SUBDEV-G-SELECTION; and
  2222. &VIDIOC-SUBDEV-S-SELECTION;.</para>
  2223. </listitem>
  2224. <listitem>
  2225. <para> Added <constant>V4L2_COLORFX_ANTIQUE</constant>,
  2226. <constant>V4L2_COLORFX_ART_FREEZE</constant>,
  2227. <constant>V4L2_COLORFX_AQUA</constant>,
  2228. <constant>V4L2_COLORFX_SILHOUETTE</constant>,
  2229. <constant>V4L2_COLORFX_SOLARIZATION</constant>,
  2230. <constant>V4L2_COLORFX_VIVID</constant> and
  2231. <constant>V4L2_COLORFX_ARBITRARY_CBCR</constant> menu items
  2232. to the <constant>V4L2_CID_COLORFX</constant> control.</para>
  2233. </listitem>
  2234. <listitem>
  2235. <para> Added <constant>V4L2_CID_COLORFX_CBCR</constant> control.</para>
  2236. </listitem>
  2237. <listitem>
  2238. <para> Added camera controls <constant>V4L2_CID_AUTO_EXPOSURE_BIAS</constant>,
  2239. <constant>V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE</constant>,
  2240. <constant>V4L2_CID_IMAGE_STABILIZATION</constant>,
  2241. <constant>V4L2_CID_ISO_SENSITIVITY</constant>,
  2242. <constant>V4L2_CID_ISO_SENSITIVITY_AUTO</constant>,
  2243. <constant>V4L2_CID_EXPOSURE_METERING</constant>,
  2244. <constant>V4L2_CID_SCENE_MODE</constant>,
  2245. <constant>V4L2_CID_3A_LOCK</constant>,
  2246. <constant>V4L2_CID_AUTO_FOCUS_START</constant>,
  2247. <constant>V4L2_CID_AUTO_FOCUS_STOP</constant>,
  2248. <constant>V4L2_CID_AUTO_FOCUS_STATUS</constant> and
  2249. <constant>V4L2_CID_AUTO_FOCUS_RANGE</constant>.
  2250. </para>
  2251. </listitem>
  2252. </orderedlist>
  2253. </section>
  2254. <section>
  2255. <title>V4L2 in Linux 3.6</title>
  2256. <orderedlist>
  2257. <listitem>
  2258. <para>Replaced <structfield>input</structfield> in
  2259. <structname>v4l2_buffer</structname> by
  2260. <structfield>reserved2</structfield> and removed
  2261. <constant>V4L2_BUF_FLAG_INPUT</constant>.</para>
  2262. </listitem>
  2263. <listitem>
  2264. <para>Added V4L2_CAP_VIDEO_M2M and V4L2_CAP_VIDEO_M2M_MPLANE capabilities.</para>
  2265. </listitem>
  2266. <listitem>
  2267. <para>Added support for frequency band enumerations: &VIDIOC-ENUM-FREQ-BANDS;.</para>
  2268. </listitem>
  2269. </orderedlist>
  2270. </section>
  2271. <section>
  2272. <title>V4L2 in Linux 3.9</title>
  2273. <orderedlist>
  2274. <listitem>
  2275. <para>Added timestamp types to
  2276. <structfield>flags</structfield> field in
  2277. <structname>v4l2_buffer</structname>. See <xref
  2278. linkend="buffer-flags" />.</para>
  2279. </listitem>
  2280. <listitem>
  2281. <para>Added <constant>V4L2_EVENT_CTRL_CH_RANGE</constant> control event
  2282. changes flag. See <xref linkend="ctrl-changes-flags"/>.</para>
  2283. </listitem>
  2284. </orderedlist>
  2285. </section>
  2286. <section>
  2287. <title>V4L2 in Linux 3.10</title>
  2288. <orderedlist>
  2289. <listitem>
  2290. <para>Removed obsolete and unused DV_PRESET ioctls
  2291. VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET, VIDIOC_QUERY_DV_PRESET and
  2292. VIDIOC_ENUM_DV_PRESET. Remove the related v4l2_input/output capability
  2293. flags V4L2_IN_CAP_PRESETS and V4L2_OUT_CAP_PRESETS.
  2294. </para>
  2295. </listitem>
  2296. <listitem>
  2297. <para>Added new debugging ioctl &VIDIOC-DBG-G-CHIP-INFO;.
  2298. </para>
  2299. </listitem>
  2300. </orderedlist>
  2301. </section>
  2302. <section>
  2303. <title>V4L2 in Linux 3.11</title>
  2304. <orderedlist>
  2305. <listitem>
  2306. <para>Remove obsolete <constant>VIDIOC_DBG_G_CHIP_IDENT</constant> ioctl.
  2307. </para>
  2308. </listitem>
  2309. </orderedlist>
  2310. </section>
  2311. <section>
  2312. <title>V4L2 in Linux 3.14</title>
  2313. <orderedlist>
  2314. <listitem>
  2315. <para> In struct <structname>v4l2_rect</structname>, the type
  2316. of <structfield>width</structfield> and <structfield>height</structfield>
  2317. fields changed from _s32 to _u32.
  2318. </para>
  2319. </listitem>
  2320. </orderedlist>
  2321. </section>
  2322. <section>
  2323. <title>V4L2 in Linux 3.15</title>
  2324. <orderedlist>
  2325. <listitem>
  2326. <para>Added Software Defined Radio (SDR) Interface.
  2327. </para>
  2328. </listitem>
  2329. </orderedlist>
  2330. </section>
  2331. <section>
  2332. <title>V4L2 in Linux 3.16</title>
  2333. <orderedlist>
  2334. <listitem>
  2335. <para>Added event V4L2_EVENT_SOURCE_CHANGE.
  2336. </para>
  2337. </listitem>
  2338. </orderedlist>
  2339. </section>
  2340. <section>
  2341. <title>V4L2 in Linux 3.17</title>
  2342. <orderedlist>
  2343. <listitem>
  2344. <para>Extended &v4l2-pix-format;. Added format flags.
  2345. </para>
  2346. </listitem>
  2347. <listitem>
  2348. <para>Added compound control types and &VIDIOC-QUERY-EXT-CTRL;.
  2349. </para>
  2350. </listitem>
  2351. </orderedlist>
  2352. </section>
  2353. <section>
  2354. <title>V4L2 in Linux 3.18</title>
  2355. <orderedlist>
  2356. <listitem>
  2357. <para>Added <constant>V4L2_CID_PAN_SPEED</constant> and
  2358. <constant>V4L2_CID_TILT_SPEED</constant> camera controls.</para>
  2359. </listitem>
  2360. </orderedlist>
  2361. </section>
  2362. <section>
  2363. <title>V4L2 in Linux 3.19</title>
  2364. <orderedlist>
  2365. <listitem>
  2366. <para>Rewrote Colorspace chapter, added new &v4l2-ycbcr-encoding;
  2367. and &v4l2-quantization; fields to &v4l2-pix-format;, &v4l2-pix-format-mplane;
  2368. and &v4l2-mbus-framefmt;.
  2369. </para>
  2370. </listitem>
  2371. </orderedlist>
  2372. </section>
  2373. <section>
  2374. <title>V4L2 in Linux 4.4</title>
  2375. <orderedlist>
  2376. <listitem>
  2377. <para>Renamed <constant>V4L2_TUNER_ADC</constant> to
  2378. <constant>V4L2_TUNER_SDR</constant>. The use of
  2379. <constant>V4L2_TUNER_ADC</constant> is deprecated now.
  2380. </para>
  2381. </listitem>
  2382. <listitem>
  2383. <para>Added <constant>V4L2_CID_RF_TUNER_RF_GAIN</constant>
  2384. RF Tuner control.</para>
  2385. </listitem>
  2386. <listitem>
  2387. <para>Added transmitter support for Software Defined Radio (SDR)
  2388. Interface.</para>
  2389. </listitem>
  2390. </orderedlist>
  2391. </section>
  2392. <section id="other">
  2393. <title>Relation of V4L2 to other Linux multimedia APIs</title>
  2394. <section id="xvideo">
  2395. <title>X Video Extension</title>
  2396. <para>The X Video Extension (abbreviated XVideo or just Xv) is
  2397. an extension of the X Window system, implemented for example by the
  2398. XFree86 project. Its scope is similar to V4L2, an API to video capture
  2399. and output devices for X clients. Xv allows applications to display
  2400. live video in a window, send window contents to a TV output, and
  2401. capture or output still images in XPixmaps<footnote>
  2402. <para>This is not implemented in XFree86.</para>
  2403. </footnote>. With their implementation XFree86 makes the
  2404. extension available across many operating systems and
  2405. architectures.</para>
  2406. <para>Because the driver is embedded into the X server Xv has a
  2407. number of advantages over the V4L2 <link linkend="overlay">video
  2408. overlay interface</link>. The driver can easily determine the overlay
  2409. target, &ie; visible graphics memory or off-screen buffers for a
  2410. destructive overlay. It can program the RAMDAC for a non-destructive
  2411. overlay, scaling or color-keying, or the clipping functions of the
  2412. video capture hardware, always in sync with drawing operations or
  2413. windows moving or changing their stacking order.</para>
  2414. <para>To combine the advantages of Xv and V4L a special Xv
  2415. driver exists in XFree86 and XOrg, just programming any overlay capable
  2416. Video4Linux device it finds. To enable it
  2417. <filename>/etc/X11/XF86Config</filename> must contain these lines:</para>
  2418. <para><screen>
  2419. Section "Module"
  2420. Load "v4l"
  2421. EndSection</screen></para>
  2422. <para>As of XFree86 4.2 this driver still supports only V4L
  2423. ioctls, however it should work just fine with all V4L2 devices through
  2424. the V4L2 backward-compatibility layer. Since V4L2 permits multiple
  2425. opens it is possible (if supported by the V4L2 driver) to capture
  2426. video while an X client requested video overlay. Restrictions of
  2427. simultaneous capturing and overlay are discussed in <xref
  2428. linkend="overlay" /> apply.</para>
  2429. <para>Only marginally related to V4L2, XFree86 extended Xv to
  2430. support hardware YUV to RGB conversion and scaling for faster video
  2431. playback, and added an interface to MPEG-2 decoding hardware. This API
  2432. is useful to display images captured with V4L2 devices.</para>
  2433. </section>
  2434. <section>
  2435. <title>Digital Video</title>
  2436. <para>V4L2 does not support digital terrestrial, cable or
  2437. satellite broadcast. A separate project aiming at digital receivers
  2438. exists. You can find its homepage at <ulink
  2439. url="http://linuxtv.org">http://linuxtv.org</ulink>. The Linux DVB API
  2440. has no connection to the V4L2 API except that drivers for hybrid
  2441. hardware may support both.</para>
  2442. </section>
  2443. <section>
  2444. <title>Audio Interfaces</title>
  2445. <para>[to do - OSS/ALSA]</para>
  2446. </section>
  2447. </section>
  2448. <section id="experimental">
  2449. <title>Experimental API Elements</title>
  2450. <para>The following V4L2 API elements are currently experimental
  2451. and may change in the future.</para>
  2452. <itemizedlist>
  2453. <listitem>
  2454. <para>Video Output Overlay (OSD) Interface, <xref
  2455. linkend="osd" />.</para>
  2456. </listitem>
  2457. <listitem>
  2458. <para>&VIDIOC-DBG-G-REGISTER; and &VIDIOC-DBG-S-REGISTER;
  2459. ioctls.</para>
  2460. </listitem>
  2461. <listitem>
  2462. <para>&VIDIOC-DBG-G-CHIP-INFO; ioctl.</para>
  2463. </listitem>
  2464. <listitem>
  2465. <para>&VIDIOC-ENUM-DV-TIMINGS;, &VIDIOC-QUERY-DV-TIMINGS; and
  2466. &VIDIOC-DV-TIMINGS-CAP; ioctls.</para>
  2467. </listitem>
  2468. <listitem>
  2469. <para>Flash API. <xref linkend="flash-controls" /></para>
  2470. </listitem>
  2471. <listitem>
  2472. <para>&VIDIOC-CREATE-BUFS; and &VIDIOC-PREPARE-BUF; ioctls.</para>
  2473. </listitem>
  2474. <listitem>
  2475. <para>Selection API. <xref linkend="selection-api" /></para>
  2476. </listitem>
  2477. <listitem>
  2478. <para>Sub-device selection API: &VIDIOC-SUBDEV-G-SELECTION;
  2479. and &VIDIOC-SUBDEV-S-SELECTION; ioctls.</para>
  2480. </listitem>
  2481. <listitem>
  2482. <para>Support for frequency band enumeration: &VIDIOC-ENUM-FREQ-BANDS; ioctl.</para>
  2483. </listitem>
  2484. <listitem>
  2485. <para>Vendor and device specific media bus pixel formats.
  2486. <xref linkend="v4l2-mbus-vendor-spec-fmts" />.</para>
  2487. </listitem>
  2488. <listitem>
  2489. <para>Importing DMABUF file descriptors as a new IO method described
  2490. in <xref linkend="dmabuf" />.</para>
  2491. </listitem>
  2492. <listitem>
  2493. <para>Exporting DMABUF files using &VIDIOC-EXPBUF; ioctl.</para>
  2494. </listitem>
  2495. <listitem>
  2496. <para>Software Defined Radio (SDR) Interface, <xref linkend="sdr" />.</para>
  2497. </listitem>
  2498. </itemizedlist>
  2499. </section>
  2500. <section id="obsolete">
  2501. <title>Obsolete API Elements</title>
  2502. <para>The following V4L2 API elements were superseded by new
  2503. interfaces and should not be implemented in new drivers.</para>
  2504. <itemizedlist>
  2505. <listitem>
  2506. <para><constant>VIDIOC_G_MPEGCOMP</constant> and
  2507. <constant>VIDIOC_S_MPEGCOMP</constant> ioctls. Use Extended Controls,
  2508. <xref linkend="extended-controls" />.</para>
  2509. </listitem>
  2510. <listitem>
  2511. <para>VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET, VIDIOC_ENUM_DV_PRESETS and
  2512. VIDIOC_QUERY_DV_PRESET ioctls. Use the DV Timings API (<xref linkend="dv-timings" />).</para>
  2513. </listitem>
  2514. <listitem>
  2515. <para><constant>VIDIOC_SUBDEV_G_CROP</constant> and
  2516. <constant>VIDIOC_SUBDEV_S_CROP</constant> ioctls. Use
  2517. <constant>VIDIOC_SUBDEV_G_SELECTION</constant> and
  2518. <constant>VIDIOC_SUBDEV_S_SELECTION</constant>, <xref
  2519. linkend="vidioc-subdev-g-selection" />.</para>
  2520. </listitem>
  2521. </itemizedlist>
  2522. </section>
  2523. </section>