compat.xml 95 KB

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