videodev2.h 97 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652
  1. /*
  2. * Video for Linux Two header file
  3. *
  4. * Copyright (C) 1999-2007 the contributors
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * Alternatively you can redistribute this file under the terms of the
  17. * BSD license as stated below:
  18. *
  19. * Redistribution and use in source and binary forms, with or without
  20. * modification, are permitted provided that the following conditions
  21. * are met:
  22. * 1. Redistributions of source code must retain the above copyright
  23. * notice, this list of conditions and the following disclaimer.
  24. * 2. Redistributions in binary form must reproduce the above copyright
  25. * notice, this list of conditions and the following disclaimer in
  26. * the documentation and/or other materials provided with the
  27. * distribution.
  28. * 3. The names of its contributors may not be used to endorse or promote
  29. * products derived from this software without specific prior written
  30. * permission.
  31. *
  32. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  33. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  34. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  35. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  36. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  37. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  38. * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  39. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  40. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  41. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  42. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  43. *
  44. * Header file for v4l or V4L2 drivers and applications
  45. * with public API.
  46. * All kernel-specific stuff were moved to media/v4l2-dev.h, so
  47. * no #if __KERNEL tests are allowed here
  48. *
  49. * See http://linuxtv.org for more info
  50. *
  51. * Author: Bill Dirks <bill@thedirks.org>
  52. * Justin Schoeman
  53. * Hans Verkuil <hverkuil@xs4all.nl>
  54. * et al.
  55. */
  56. #ifndef __LINUX_VIDEODEV2_H
  57. #define __LINUX_VIDEODEV2_H
  58. #ifdef __KERNEL__
  59. #include <linux/time.h> /* need struct timeval */
  60. #else
  61. #include <sys/time.h>
  62. #endif
  63. #include <linux/compiler.h>
  64. #include <linux/ioctl.h>
  65. #include <linux/types.h>
  66. /*
  67. * Common stuff for both V4L1 and V4L2
  68. * Moved from videodev.h
  69. */
  70. #define VIDEO_MAX_FRAME 32
  71. #define VIDEO_MAX_PLANES 8
  72. #ifndef __KERNEL__
  73. /* These defines are V4L1 specific and should not be used with the V4L2 API!
  74. They will be removed from this header in the future. */
  75. #define VID_TYPE_CAPTURE 1 /* Can capture */
  76. #define VID_TYPE_TUNER 2 /* Can tune */
  77. #define VID_TYPE_TELETEXT 4 /* Does teletext */
  78. #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
  79. #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
  80. #define VID_TYPE_CLIPPING 32 /* Can clip */
  81. #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
  82. #define VID_TYPE_SCALES 128 /* Scalable */
  83. #define VID_TYPE_MONOCHROME 256 /* Monochrome only */
  84. #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
  85. #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
  86. #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
  87. #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
  88. #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
  89. #endif
  90. /*
  91. * M I S C E L L A N E O U S
  92. */
  93. /* Four-character-code (FOURCC) */
  94. #define v4l2_fourcc(a, b, c, d)\
  95. ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))
  96. /*
  97. * E N U M S
  98. */
  99. enum v4l2_field {
  100. V4L2_FIELD_ANY = 0, /* driver can choose from none,
  101. top, bottom, interlaced
  102. depending on whatever it thinks
  103. is approximate ... */
  104. V4L2_FIELD_NONE = 1, /* this device has no fields ... */
  105. V4L2_FIELD_TOP = 2, /* top field only */
  106. V4L2_FIELD_BOTTOM = 3, /* bottom field only */
  107. V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */
  108. V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one
  109. buffer, top-bottom order */
  110. V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */
  111. V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into
  112. separate buffers */
  113. V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field
  114. first and the top field is
  115. transmitted first */
  116. V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field
  117. first and the bottom field is
  118. transmitted first */
  119. };
  120. #define V4L2_FIELD_HAS_TOP(field) \
  121. ((field) == V4L2_FIELD_TOP ||\
  122. (field) == V4L2_FIELD_INTERLACED ||\
  123. (field) == V4L2_FIELD_INTERLACED_TB ||\
  124. (field) == V4L2_FIELD_INTERLACED_BT ||\
  125. (field) == V4L2_FIELD_SEQ_TB ||\
  126. (field) == V4L2_FIELD_SEQ_BT)
  127. #define V4L2_FIELD_HAS_BOTTOM(field) \
  128. ((field) == V4L2_FIELD_BOTTOM ||\
  129. (field) == V4L2_FIELD_INTERLACED ||\
  130. (field) == V4L2_FIELD_INTERLACED_TB ||\
  131. (field) == V4L2_FIELD_INTERLACED_BT ||\
  132. (field) == V4L2_FIELD_SEQ_TB ||\
  133. (field) == V4L2_FIELD_SEQ_BT)
  134. #define V4L2_FIELD_HAS_BOTH(field) \
  135. ((field) == V4L2_FIELD_INTERLACED ||\
  136. (field) == V4L2_FIELD_INTERLACED_TB ||\
  137. (field) == V4L2_FIELD_INTERLACED_BT ||\
  138. (field) == V4L2_FIELD_SEQ_TB ||\
  139. (field) == V4L2_FIELD_SEQ_BT)
  140. enum v4l2_buf_type {
  141. V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
  142. V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
  143. V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
  144. V4L2_BUF_TYPE_VBI_CAPTURE = 4,
  145. V4L2_BUF_TYPE_VBI_OUTPUT = 5,
  146. V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
  147. V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
  148. #if 1
  149. /* Experimental */
  150. V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
  151. #endif
  152. V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
  153. V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,
  154. V4L2_BUF_TYPE_PRIVATE = 0x80,
  155. };
  156. #define V4L2_TYPE_IS_MULTIPLANAR(type) \
  157. ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE \
  158. || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
  159. #define V4L2_TYPE_IS_OUTPUT(type) \
  160. ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT \
  161. || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE \
  162. || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY \
  163. || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \
  164. || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \
  165. || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT)
  166. enum v4l2_tuner_type {
  167. V4L2_TUNER_RADIO = 1,
  168. V4L2_TUNER_ANALOG_TV = 2,
  169. V4L2_TUNER_DIGITAL_TV = 3,
  170. };
  171. enum v4l2_memory {
  172. V4L2_MEMORY_MMAP = 1,
  173. V4L2_MEMORY_USERPTR = 2,
  174. V4L2_MEMORY_OVERLAY = 3,
  175. };
  176. /* see also http://vektor.theorem.ca/graphics/ycbcr/ */
  177. enum v4l2_colorspace {
  178. /* ITU-R 601 -- broadcast NTSC/PAL */
  179. V4L2_COLORSPACE_SMPTE170M = 1,
  180. /* 1125-Line (US) HDTV */
  181. V4L2_COLORSPACE_SMPTE240M = 2,
  182. /* HD and modern captures. */
  183. V4L2_COLORSPACE_REC709 = 3,
  184. /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
  185. V4L2_COLORSPACE_BT878 = 4,
  186. /* These should be useful. Assume 601 extents. */
  187. V4L2_COLORSPACE_470_SYSTEM_M = 5,
  188. V4L2_COLORSPACE_470_SYSTEM_BG = 6,
  189. /* I know there will be cameras that send this. So, this is
  190. * unspecified chromaticities and full 0-255 on each of the
  191. * Y'CbCr components
  192. */
  193. V4L2_COLORSPACE_JPEG = 7,
  194. /* For RGB colourspaces, this is probably a good start. */
  195. V4L2_COLORSPACE_SRGB = 8,
  196. };
  197. enum v4l2_priority {
  198. V4L2_PRIORITY_UNSET = 0, /* not initialized */
  199. V4L2_PRIORITY_BACKGROUND = 1,
  200. V4L2_PRIORITY_INTERACTIVE = 2,
  201. V4L2_PRIORITY_RECORD = 3,
  202. V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE,
  203. };
  204. struct v4l2_rect {
  205. __s32 left;
  206. __s32 top;
  207. __s32 width;
  208. __s32 height;
  209. };
  210. struct v4l2_fract {
  211. __u32 numerator;
  212. __u32 denominator;
  213. };
  214. /**
  215. * struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP
  216. *
  217. * @driver: name of the driver module (e.g. "bttv")
  218. * @card: name of the card (e.g. "Hauppauge WinTV")
  219. * @bus_info: name of the bus (e.g. "PCI:" + pci_name(pci_dev) )
  220. * @version: KERNEL_VERSION
  221. * @capabilities: capabilities of the physical device as a whole
  222. * @device_caps: capabilities accessed via this particular device (node)
  223. * @reserved: reserved fields for future extensions
  224. */
  225. struct v4l2_capability {
  226. __u8 driver[16];
  227. __u8 card[32];
  228. __u8 bus_info[32];
  229. __u32 version;
  230. __u32 capabilities;
  231. __u32 device_caps;
  232. __u32 reserved[3];
  233. };
  234. /* Values for 'capabilities' field */
  235. #define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
  236. #define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
  237. #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
  238. #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */
  239. #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */
  240. #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */
  241. #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
  242. #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
  243. #define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */
  244. #define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */
  245. #define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */
  246. /* Is a video capture device that supports multiplanar formats */
  247. #define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
  248. /* Is a video output device that supports multiplanar formats */
  249. #define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
  250. #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
  251. #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
  252. #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
  253. #define V4L2_CAP_MODULATOR 0x00080000 /* has a modulator */
  254. #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
  255. #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
  256. #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
  257. #define V4L2_CAP_DEVICE_CAPS 0x80000000 /* sets device capabilities field */
  258. /*
  259. * V I D E O I M A G E F O R M A T
  260. */
  261. struct v4l2_pix_format {
  262. __u32 width;
  263. __u32 height;
  264. __u32 pixelformat;
  265. __u32 field; /* enum v4l2_field */
  266. __u32 bytesperline; /* for padding, zero if unused */
  267. __u32 sizeimage;
  268. __u32 colorspace; /* enum v4l2_colorspace */
  269. __u32 priv; /* private data, depends on pixelformat */
  270. };
  271. /* Pixel format FOURCC depth Description */
  272. /* RGB formats */
  273. #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */
  274. #define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */
  275. #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */
  276. #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */
  277. #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */
  278. #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */
  279. #define V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */
  280. #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */
  281. #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */
  282. #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */
  283. #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */
  284. /* Grey formats */
  285. #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
  286. #define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
  287. #define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
  288. #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
  289. #define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */
  290. #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
  291. /* Grey bit-packed formats */
  292. #define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */
  293. /* Palette formats */
  294. #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
  295. /* Luminance+Chrominance formats */
  296. #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */
  297. #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */
  298. #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */
  299. #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */
  300. #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
  301. #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */
  302. #define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */
  303. #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */
  304. #define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */
  305. #define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */
  306. #define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */
  307. #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */
  308. #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */
  309. #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */
  310. #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
  311. #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
  312. #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */
  313. #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
  314. #define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */
  315. /* two planes -- one Y, one Cr + Cb interleaved */
  316. #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
  317. #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */
  318. #define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
  319. #define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
  320. #define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */
  321. #define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */
  322. /* two non contiguous planes - one Y, one Cr + Cb interleaved */
  323. #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
  324. #define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
  325. /* three non contiguous planes - Y, Cb, Cr */
  326. #define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */
  327. /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
  328. #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
  329. #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
  330. #define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */
  331. #define V4L2_PIX_FMT_SRGGB8 v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */
  332. #define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10 BGBG.. GRGR.. */
  333. #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */
  334. #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */
  335. #define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */
  336. #define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12 BGBG.. GRGR.. */
  337. #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */
  338. #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */
  339. #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */
  340. /* 10bit raw bayer DPCM compressed to 8 bits */
  341. #define V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8')
  342. #define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8')
  343. #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
  344. #define V4L2_PIX_FMT_SRGGB10DPCM8 v4l2_fourcc('b', 'R', 'A', '8')
  345. /*
  346. * 10bit raw bayer, expanded to 16 bits
  347. * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
  348. */
  349. #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */
  350. /* compressed formats */
  351. #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */
  352. #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */
  353. #define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */
  354. #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
  355. #define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
  356. #define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
  357. #define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
  358. #define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
  359. #define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
  360. #define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 ES */
  361. #define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */
  362. #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
  363. #define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
  364. /* Vendor-specific formats */
  365. #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
  366. #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
  367. #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
  368. #define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
  369. #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
  370. #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
  371. #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
  372. #define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */
  373. #define V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */
  374. #define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */
  375. #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
  376. #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
  377. #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
  378. #define V4L2_PIX_FMT_JL2005BCD v4l2_fourcc('J', 'L', '2', '0') /* compressed RGGB bayer */
  379. #define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
  380. #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
  381. #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
  382. #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
  383. #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
  384. #define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
  385. #define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
  386. #define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
  387. #define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
  388. #define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
  389. #define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
  390. /*
  391. * F O R M A T E N U M E R A T I O N
  392. */
  393. struct v4l2_fmtdesc {
  394. __u32 index; /* Format number */
  395. __u32 type; /* enum v4l2_buf_type */
  396. __u32 flags;
  397. __u8 description[32]; /* Description string */
  398. __u32 pixelformat; /* Format fourcc */
  399. __u32 reserved[4];
  400. };
  401. #define V4L2_FMT_FLAG_COMPRESSED 0x0001
  402. #define V4L2_FMT_FLAG_EMULATED 0x0002
  403. #if 1
  404. /* Experimental Frame Size and frame rate enumeration */
  405. /*
  406. * F R A M E S I Z E E N U M E R A T I O N
  407. */
  408. enum v4l2_frmsizetypes {
  409. V4L2_FRMSIZE_TYPE_DISCRETE = 1,
  410. V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
  411. V4L2_FRMSIZE_TYPE_STEPWISE = 3,
  412. };
  413. struct v4l2_frmsize_discrete {
  414. __u32 width; /* Frame width [pixel] */
  415. __u32 height; /* Frame height [pixel] */
  416. };
  417. struct v4l2_frmsize_stepwise {
  418. __u32 min_width; /* Minimum frame width [pixel] */
  419. __u32 max_width; /* Maximum frame width [pixel] */
  420. __u32 step_width; /* Frame width step size [pixel] */
  421. __u32 min_height; /* Minimum frame height [pixel] */
  422. __u32 max_height; /* Maximum frame height [pixel] */
  423. __u32 step_height; /* Frame height step size [pixel] */
  424. };
  425. struct v4l2_frmsizeenum {
  426. __u32 index; /* Frame size number */
  427. __u32 pixel_format; /* Pixel format */
  428. __u32 type; /* Frame size type the device supports. */
  429. union { /* Frame size */
  430. struct v4l2_frmsize_discrete discrete;
  431. struct v4l2_frmsize_stepwise stepwise;
  432. };
  433. __u32 reserved[2]; /* Reserved space for future use */
  434. };
  435. /*
  436. * F R A M E R A T E E N U M E R A T I O N
  437. */
  438. enum v4l2_frmivaltypes {
  439. V4L2_FRMIVAL_TYPE_DISCRETE = 1,
  440. V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
  441. V4L2_FRMIVAL_TYPE_STEPWISE = 3,
  442. };
  443. struct v4l2_frmival_stepwise {
  444. struct v4l2_fract min; /* Minimum frame interval [s] */
  445. struct v4l2_fract max; /* Maximum frame interval [s] */
  446. struct v4l2_fract step; /* Frame interval step size [s] */
  447. };
  448. struct v4l2_frmivalenum {
  449. __u32 index; /* Frame format index */
  450. __u32 pixel_format; /* Pixel format */
  451. __u32 width; /* Frame width */
  452. __u32 height; /* Frame height */
  453. __u32 type; /* Frame interval type the device supports. */
  454. union { /* Frame interval */
  455. struct v4l2_fract discrete;
  456. struct v4l2_frmival_stepwise stepwise;
  457. };
  458. __u32 reserved[2]; /* Reserved space for future use */
  459. };
  460. #endif
  461. /*
  462. * T I M E C O D E
  463. */
  464. struct v4l2_timecode {
  465. __u32 type;
  466. __u32 flags;
  467. __u8 frames;
  468. __u8 seconds;
  469. __u8 minutes;
  470. __u8 hours;
  471. __u8 userbits[4];
  472. };
  473. /* Type */
  474. #define V4L2_TC_TYPE_24FPS 1
  475. #define V4L2_TC_TYPE_25FPS 2
  476. #define V4L2_TC_TYPE_30FPS 3
  477. #define V4L2_TC_TYPE_50FPS 4
  478. #define V4L2_TC_TYPE_60FPS 5
  479. /* Flags */
  480. #define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */
  481. #define V4L2_TC_FLAG_COLORFRAME 0x0002
  482. #define V4L2_TC_USERBITS_field 0x000C
  483. #define V4L2_TC_USERBITS_USERDEFINED 0x0000
  484. #define V4L2_TC_USERBITS_8BITCHARS 0x0008
  485. /* The above is based on SMPTE timecodes */
  486. struct v4l2_jpegcompression {
  487. int quality;
  488. int APPn; /* Number of APP segment to be written,
  489. * must be 0..15 */
  490. int APP_len; /* Length of data in JPEG APPn segment */
  491. char APP_data[60]; /* Data in the JPEG APPn segment. */
  492. int COM_len; /* Length of data in JPEG COM segment */
  493. char COM_data[60]; /* Data in JPEG COM segment */
  494. __u32 jpeg_markers; /* Which markers should go into the JPEG
  495. * output. Unless you exactly know what
  496. * you do, leave them untouched.
  497. * Inluding less markers will make the
  498. * resulting code smaller, but there will
  499. * be fewer applications which can read it.
  500. * The presence of the APP and COM marker
  501. * is influenced by APP_len and COM_len
  502. * ONLY, not by this property! */
  503. #define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
  504. #define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
  505. #define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
  506. #define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
  507. #define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
  508. * allways use APP0 */
  509. };
  510. /*
  511. * M E M O R Y - M A P P I N G B U F F E R S
  512. */
  513. struct v4l2_requestbuffers {
  514. __u32 count;
  515. __u32 type; /* enum v4l2_buf_type */
  516. __u32 memory; /* enum v4l2_memory */
  517. __u32 reserved[2];
  518. };
  519. /**
  520. * struct v4l2_plane - plane info for multi-planar buffers
  521. * @bytesused: number of bytes occupied by data in the plane (payload)
  522. * @length: size of this plane (NOT the payload) in bytes
  523. * @mem_offset: when memory in the associated struct v4l2_buffer is
  524. * V4L2_MEMORY_MMAP, equals the offset from the start of
  525. * the device memory for this plane (or is a "cookie" that
  526. * should be passed to mmap() called on the video node)
  527. * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer
  528. * pointing to this plane
  529. * @data_offset: offset in the plane to the start of data; usually 0,
  530. * unless there is a header in front of the data
  531. *
  532. * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
  533. * with two planes can have one plane for Y, and another for interleaved CbCr
  534. * components. Each plane can reside in a separate memory buffer, or even in
  535. * a completely separate memory node (e.g. in embedded devices).
  536. */
  537. struct v4l2_plane {
  538. __u32 bytesused;
  539. __u32 length;
  540. union {
  541. __u32 mem_offset;
  542. unsigned long userptr;
  543. } m;
  544. __u32 data_offset;
  545. __u32 reserved[11];
  546. };
  547. /**
  548. * struct v4l2_buffer - video buffer info
  549. * @index: id number of the buffer
  550. * @type: enum v4l2_buf_type; buffer type (type == *_MPLANE for
  551. * multiplanar buffers);
  552. * @bytesused: number of bytes occupied by data in the buffer (payload);
  553. * unused (set to 0) for multiplanar buffers
  554. * @flags: buffer informational flags
  555. * @field: enum v4l2_field; field order of the image in the buffer
  556. * @timestamp: frame timestamp
  557. * @timecode: frame timecode
  558. * @sequence: sequence count of this frame
  559. * @memory: enum v4l2_memory; the method, in which the actual video data is
  560. * passed
  561. * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
  562. * offset from the start of the device memory for this plane,
  563. * (or a "cookie" that should be passed to mmap() as offset)
  564. * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
  565. * a userspace pointer pointing to this buffer
  566. * @planes: for multiplanar buffers; userspace pointer to the array of plane
  567. * info structs for this buffer
  568. * @length: size in bytes of the buffer (NOT its payload) for single-plane
  569. * buffers (when type != *_MPLANE); number of elements in the
  570. * planes array for multi-plane buffers
  571. * @input: input number from which the video data has has been captured
  572. *
  573. * Contains data exchanged by application and driver using one of the Streaming
  574. * I/O methods.
  575. */
  576. struct v4l2_buffer {
  577. __u32 index;
  578. __u32 type;
  579. __u32 bytesused;
  580. __u32 flags;
  581. __u32 field;
  582. struct timeval timestamp;
  583. struct v4l2_timecode timecode;
  584. __u32 sequence;
  585. /* memory location */
  586. __u32 memory;
  587. union {
  588. __u32 offset;
  589. unsigned long userptr;
  590. struct v4l2_plane *planes;
  591. } m;
  592. __u32 length;
  593. __u32 input;
  594. __u32 reserved;
  595. };
  596. /* Flags for 'flags' field */
  597. #define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */
  598. #define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */
  599. #define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */
  600. #define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
  601. #define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
  602. #define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
  603. /* Buffer is ready, but the data contained within is corrupted. */
  604. #define V4L2_BUF_FLAG_ERROR 0x0040
  605. #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
  606. #define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
  607. #define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */
  608. /* Cache handling flags */
  609. #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800
  610. #define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000
  611. /*
  612. * O V E R L A Y P R E V I E W
  613. */
  614. struct v4l2_framebuffer {
  615. __u32 capability;
  616. __u32 flags;
  617. /* FIXME: in theory we should pass something like PCI device + memory
  618. * region + offset instead of some physical address */
  619. void *base;
  620. struct v4l2_pix_format fmt;
  621. };
  622. /* Flags for the 'capability' field. Read only */
  623. #define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
  624. #define V4L2_FBUF_CAP_CHROMAKEY 0x0002
  625. #define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
  626. #define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
  627. #define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
  628. #define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
  629. #define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
  630. #define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080
  631. /* Flags for the 'flags' field. */
  632. #define V4L2_FBUF_FLAG_PRIMARY 0x0001
  633. #define V4L2_FBUF_FLAG_OVERLAY 0x0002
  634. #define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
  635. #define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
  636. #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
  637. #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
  638. #define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040
  639. struct v4l2_clip {
  640. struct v4l2_rect c;
  641. struct v4l2_clip __user *next;
  642. };
  643. struct v4l2_window {
  644. struct v4l2_rect w;
  645. __u32 field; /* enum v4l2_field */
  646. __u32 chromakey;
  647. struct v4l2_clip __user *clips;
  648. __u32 clipcount;
  649. void __user *bitmap;
  650. __u8 global_alpha;
  651. };
  652. /*
  653. * C A P T U R E P A R A M E T E R S
  654. */
  655. struct v4l2_captureparm {
  656. __u32 capability; /* Supported modes */
  657. __u32 capturemode; /* Current mode */
  658. struct v4l2_fract timeperframe; /* Time per frame in .1us units */
  659. __u32 extendedmode; /* Driver-specific extensions */
  660. __u32 readbuffers; /* # of buffers for read */
  661. __u32 reserved[4];
  662. };
  663. /* Flags for 'capability' and 'capturemode' fields */
  664. #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
  665. #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
  666. struct v4l2_outputparm {
  667. __u32 capability; /* Supported modes */
  668. __u32 outputmode; /* Current mode */
  669. struct v4l2_fract timeperframe; /* Time per frame in seconds */
  670. __u32 extendedmode; /* Driver-specific extensions */
  671. __u32 writebuffers; /* # of buffers for write */
  672. __u32 reserved[4];
  673. };
  674. /*
  675. * I N P U T I M A G E C R O P P I N G
  676. */
  677. struct v4l2_cropcap {
  678. __u32 type; /* enum v4l2_buf_type */
  679. struct v4l2_rect bounds;
  680. struct v4l2_rect defrect;
  681. struct v4l2_fract pixelaspect;
  682. };
  683. struct v4l2_crop {
  684. __u32 type; /* enum v4l2_buf_type */
  685. struct v4l2_rect c;
  686. };
  687. /* Hints for adjustments of selection rectangle */
  688. #define V4L2_SEL_FLAG_GE 0x00000001
  689. #define V4L2_SEL_FLAG_LE 0x00000002
  690. /* Selection targets */
  691. /* Current cropping area */
  692. #define V4L2_SEL_TGT_CROP_ACTIVE 0x0000
  693. /* Default cropping area */
  694. #define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
  695. /* Cropping bounds */
  696. #define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
  697. /* Current composing area */
  698. #define V4L2_SEL_TGT_COMPOSE_ACTIVE 0x0100
  699. /* Default composing area */
  700. #define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101
  701. /* Composing bounds */
  702. #define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102
  703. /* Current composing area plus all padding pixels */
  704. #define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103
  705. /**
  706. * struct v4l2_selection - selection info
  707. * @type: buffer type (do not use *_MPLANE types)
  708. * @target: selection target, used to choose one of possible rectangles
  709. * @flags: constraints flags
  710. * @r: coordinates of selection window
  711. * @reserved: for future use, rounds structure size to 64 bytes, set to zero
  712. *
  713. * Hardware may use multiple helper windows to process a video stream.
  714. * The structure is used to exchange this selection areas between
  715. * an application and a driver.
  716. */
  717. struct v4l2_selection {
  718. __u32 type;
  719. __u32 target;
  720. __u32 flags;
  721. struct v4l2_rect r;
  722. __u32 reserved[9];
  723. };
  724. /*
  725. * A N A L O G V I D E O S T A N D A R D
  726. */
  727. typedef __u64 v4l2_std_id;
  728. /* one bit for each */
  729. #define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
  730. #define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
  731. #define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
  732. #define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
  733. #define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
  734. #define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
  735. #define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
  736. #define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
  737. #define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
  738. #define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
  739. #define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
  740. #define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
  741. #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) /* BTSC */
  742. #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) /* EIA-J */
  743. #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
  744. #define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000) /* FM A2 */
  745. #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
  746. #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
  747. #define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
  748. #define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
  749. #define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
  750. #define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
  751. #define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
  752. #define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
  753. /* ATSC/HDTV */
  754. #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
  755. #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
  756. /* FIXME:
  757. Although std_id is 64 bits, there is an issue on PPC32 architecture that
  758. makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
  759. this value to 32 bits.
  760. As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
  761. it should work fine. However, if needed to add more than two standards,
  762. v4l2-common.c should be fixed.
  763. */
  764. /*
  765. * Some macros to merge video standards in order to make live easier for the
  766. * drivers and V4L2 applications
  767. */
  768. /*
  769. * "Common" NTSC/M - It should be noticed that V4L2_STD_NTSC_443 is
  770. * Missing here.
  771. */
  772. #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
  773. V4L2_STD_NTSC_M_JP |\
  774. V4L2_STD_NTSC_M_KR)
  775. /* Secam macros */
  776. #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
  777. V4L2_STD_SECAM_K |\
  778. V4L2_STD_SECAM_K1)
  779. /* All Secam Standards */
  780. #define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
  781. V4L2_STD_SECAM_G |\
  782. V4L2_STD_SECAM_H |\
  783. V4L2_STD_SECAM_DK |\
  784. V4L2_STD_SECAM_L |\
  785. V4L2_STD_SECAM_LC)
  786. /* PAL macros */
  787. #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
  788. V4L2_STD_PAL_B1 |\
  789. V4L2_STD_PAL_G)
  790. #define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
  791. V4L2_STD_PAL_D1 |\
  792. V4L2_STD_PAL_K)
  793. /*
  794. * "Common" PAL - This macro is there to be compatible with the old
  795. * V4L1 concept of "PAL": /BGDKHI.
  796. * Several PAL standards are mising here: /M, /N and /Nc
  797. */
  798. #define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
  799. V4L2_STD_PAL_DK |\
  800. V4L2_STD_PAL_H |\
  801. V4L2_STD_PAL_I)
  802. /* Chroma "agnostic" standards */
  803. #define V4L2_STD_B (V4L2_STD_PAL_B |\
  804. V4L2_STD_PAL_B1 |\
  805. V4L2_STD_SECAM_B)
  806. #define V4L2_STD_G (V4L2_STD_PAL_G |\
  807. V4L2_STD_SECAM_G)
  808. #define V4L2_STD_H (V4L2_STD_PAL_H |\
  809. V4L2_STD_SECAM_H)
  810. #define V4L2_STD_L (V4L2_STD_SECAM_L |\
  811. V4L2_STD_SECAM_LC)
  812. #define V4L2_STD_GH (V4L2_STD_G |\
  813. V4L2_STD_H)
  814. #define V4L2_STD_DK (V4L2_STD_PAL_DK |\
  815. V4L2_STD_SECAM_DK)
  816. #define V4L2_STD_BG (V4L2_STD_B |\
  817. V4L2_STD_G)
  818. #define V4L2_STD_MN (V4L2_STD_PAL_M |\
  819. V4L2_STD_PAL_N |\
  820. V4L2_STD_PAL_Nc |\
  821. V4L2_STD_NTSC)
  822. /* Standards where MTS/BTSC stereo could be found */
  823. #define V4L2_STD_MTS (V4L2_STD_NTSC_M |\
  824. V4L2_STD_PAL_M |\
  825. V4L2_STD_PAL_N |\
  826. V4L2_STD_PAL_Nc)
  827. /* Standards for Countries with 60Hz Line frequency */
  828. #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
  829. V4L2_STD_PAL_60 |\
  830. V4L2_STD_NTSC |\
  831. V4L2_STD_NTSC_443)
  832. /* Standards for Countries with 50Hz Line frequency */
  833. #define V4L2_STD_625_50 (V4L2_STD_PAL |\
  834. V4L2_STD_PAL_N |\
  835. V4L2_STD_PAL_Nc |\
  836. V4L2_STD_SECAM)
  837. #define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\
  838. V4L2_STD_ATSC_16_VSB)
  839. /* Macros with none and all analog standards */
  840. #define V4L2_STD_UNKNOWN 0
  841. #define V4L2_STD_ALL (V4L2_STD_525_60 |\
  842. V4L2_STD_625_50)
  843. struct v4l2_standard {
  844. __u32 index;
  845. v4l2_std_id id;
  846. __u8 name[24];
  847. struct v4l2_fract frameperiod; /* Frames, not fields */
  848. __u32 framelines;
  849. __u32 reserved[4];
  850. };
  851. /* The DV Preset API is deprecated in favor of the DV Timings API.
  852. New drivers shouldn't use this anymore! */
  853. /*
  854. * V I D E O T I M I N G S D V P R E S E T
  855. */
  856. struct v4l2_dv_preset {
  857. __u32 preset;
  858. __u32 reserved[4];
  859. };
  860. /*
  861. * D V P R E S E T S E N U M E R A T I O N
  862. */
  863. struct v4l2_dv_enum_preset {
  864. __u32 index;
  865. __u32 preset;
  866. __u8 name[32]; /* Name of the preset timing */
  867. __u32 width;
  868. __u32 height;
  869. __u32 reserved[4];
  870. };
  871. /*
  872. * D V P R E S E T V A L U E S
  873. */
  874. #define V4L2_DV_INVALID 0
  875. #define V4L2_DV_480P59_94 1 /* BT.1362 */
  876. #define V4L2_DV_576P50 2 /* BT.1362 */
  877. #define V4L2_DV_720P24 3 /* SMPTE 296M */
  878. #define V4L2_DV_720P25 4 /* SMPTE 296M */
  879. #define V4L2_DV_720P30 5 /* SMPTE 296M */
  880. #define V4L2_DV_720P50 6 /* SMPTE 296M */
  881. #define V4L2_DV_720P59_94 7 /* SMPTE 274M */
  882. #define V4L2_DV_720P60 8 /* SMPTE 274M/296M */
  883. #define V4L2_DV_1080I29_97 9 /* BT.1120/ SMPTE 274M */
  884. #define V4L2_DV_1080I30 10 /* BT.1120/ SMPTE 274M */
  885. #define V4L2_DV_1080I25 11 /* BT.1120 */
  886. #define V4L2_DV_1080I50 12 /* SMPTE 296M */
  887. #define V4L2_DV_1080I60 13 /* SMPTE 296M */
  888. #define V4L2_DV_1080P24 14 /* SMPTE 296M */
  889. #define V4L2_DV_1080P25 15 /* SMPTE 296M */
  890. #define V4L2_DV_1080P30 16 /* SMPTE 296M */
  891. #define V4L2_DV_1080P50 17 /* BT.1120 */
  892. #define V4L2_DV_1080P60 18 /* BT.1120 */
  893. /*
  894. * D V B T T I M I N G S
  895. */
  896. /** struct v4l2_bt_timings - BT.656/BT.1120 timing data
  897. * @width: total width of the active video in pixels
  898. * @height: total height of the active video in lines
  899. * @interlaced: Interlaced or progressive
  900. * @polarities: Positive or negative polarities
  901. * @pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000
  902. * @hfrontporch:Horizontal front porch in pixels
  903. * @hsync: Horizontal Sync length in pixels
  904. * @hbackporch: Horizontal back porch in pixels
  905. * @vfrontporch:Vertical front porch in lines
  906. * @vsync: Vertical Sync length in lines
  907. * @vbackporch: Vertical back porch in lines
  908. * @il_vfrontporch:Vertical front porch for the even field
  909. * (aka field 2) of interlaced field formats
  910. * @il_vsync: Vertical Sync length for the even field
  911. * (aka field 2) of interlaced field formats
  912. * @il_vbackporch:Vertical back porch for the even field
  913. * (aka field 2) of interlaced field formats
  914. * @standards: Standards the timing belongs to
  915. * @flags: Flags
  916. * @reserved: Reserved fields, must be zeroed.
  917. *
  918. * A note regarding vertical interlaced timings: height refers to the total
  919. * height of the active video frame (= two fields). The blanking timings refer
  920. * to the blanking of each field. So the height of the total frame is
  921. * calculated as follows:
  922. *
  923. * tot_height = height + vfrontporch + vsync + vbackporch +
  924. * il_vfrontporch + il_vsync + il_vbackporch
  925. *
  926. * The active height of each field is height / 2.
  927. */
  928. struct v4l2_bt_timings {
  929. __u32 width;
  930. __u32 height;
  931. __u32 interlaced;
  932. __u32 polarities;
  933. __u64 pixelclock;
  934. __u32 hfrontporch;
  935. __u32 hsync;
  936. __u32 hbackporch;
  937. __u32 vfrontporch;
  938. __u32 vsync;
  939. __u32 vbackporch;
  940. __u32 il_vfrontporch;
  941. __u32 il_vsync;
  942. __u32 il_vbackporch;
  943. __u32 standards;
  944. __u32 flags;
  945. __u32 reserved[14];
  946. } __attribute__ ((packed));
  947. /* Interlaced or progressive format */
  948. #define V4L2_DV_PROGRESSIVE 0
  949. #define V4L2_DV_INTERLACED 1
  950. /* Polarities. If bit is not set, it is assumed to be negative polarity */
  951. #define V4L2_DV_VSYNC_POS_POL 0x00000001
  952. #define V4L2_DV_HSYNC_POS_POL 0x00000002
  953. /* Timings standards */
  954. #define V4L2_DV_BT_STD_CEA861 (1 << 0) /* CEA-861 Digital TV Profile */
  955. #define V4L2_DV_BT_STD_DMT (1 << 1) /* VESA Discrete Monitor Timings */
  956. #define V4L2_DV_BT_STD_CVT (1 << 2) /* VESA Coordinated Video Timings */
  957. #define V4L2_DV_BT_STD_GTF (1 << 3) /* VESA Generalized Timings Formula */
  958. /* Flags */
  959. /* CVT/GTF specific: timing uses reduced blanking (CVT) or the 'Secondary
  960. GTF' curve (GTF). In both cases the horizontal and/or vertical blanking
  961. intervals are reduced, allowing a higher resolution over the same
  962. bandwidth. This is a read-only flag. */
  963. #define V4L2_DV_FL_REDUCED_BLANKING (1 << 0)
  964. /* CEA-861 specific: set for CEA-861 formats with a framerate of a multiple
  965. of six. These formats can be optionally played at 1 / 1.001 speed.
  966. This is a read-only flag. */
  967. #define V4L2_DV_FL_CAN_REDUCE_FPS (1 << 1)
  968. /* CEA-861 specific: only valid for video transmitters, the flag is cleared
  969. by receivers.
  970. If the framerate of the format is a multiple of six, then the pixelclock
  971. used to set up the transmitter is divided by 1.001 to make it compatible
  972. with 60 Hz based standards such as NTSC and PAL-M that use a framerate of
  973. 29.97 Hz. Otherwise this flag is cleared. If the transmitter can't generate
  974. such frequencies, then the flag will also be cleared. */
  975. #define V4L2_DV_FL_REDUCED_FPS (1 << 2)
  976. /* Specific to interlaced formats: if set, then field 1 is really one half-line
  977. longer and field 2 is really one half-line shorter, so each field has
  978. exactly the same number of half-lines. Whether half-lines can be detected
  979. or used depends on the hardware. */
  980. #define V4L2_DV_FL_HALF_LINE (1 << 0)
  981. /** struct v4l2_dv_timings - DV timings
  982. * @type: the type of the timings
  983. * @bt: BT656/1120 timings
  984. */
  985. struct v4l2_dv_timings {
  986. __u32 type;
  987. union {
  988. struct v4l2_bt_timings bt;
  989. __u32 reserved[32];
  990. };
  991. } __attribute__ ((packed));
  992. /* Values for the type field */
  993. #define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */
  994. /** struct v4l2_enum_dv_timings - DV timings enumeration
  995. * @index: enumeration index
  996. * @reserved: must be zeroed
  997. * @timings: the timings for the given index
  998. */
  999. struct v4l2_enum_dv_timings {
  1000. __u32 index;
  1001. __u32 reserved[3];
  1002. struct v4l2_dv_timings timings;
  1003. };
  1004. /** struct v4l2_bt_timings_cap - BT.656/BT.1120 timing capabilities
  1005. * @min_width: width in pixels
  1006. * @max_width: width in pixels
  1007. * @min_height: height in lines
  1008. * @max_height: height in lines
  1009. * @min_pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000
  1010. * @max_pixelclock: Pixel clock in HZ. Ex. 74.25MHz->74250000
  1011. * @standards: Supported standards
  1012. * @capabilities: Supported capabilities
  1013. * @reserved: Must be zeroed
  1014. */
  1015. struct v4l2_bt_timings_cap {
  1016. __u32 min_width;
  1017. __u32 max_width;
  1018. __u32 min_height;
  1019. __u32 max_height;
  1020. __u64 min_pixelclock;
  1021. __u64 max_pixelclock;
  1022. __u32 standards;
  1023. __u32 capabilities;
  1024. __u32 reserved[16];
  1025. } __attribute__ ((packed));
  1026. /* Supports interlaced formats */
  1027. #define V4L2_DV_BT_CAP_INTERLACED (1 << 0)
  1028. /* Supports progressive formats */
  1029. #define V4L2_DV_BT_CAP_PROGRESSIVE (1 << 1)
  1030. /* Supports CVT/GTF reduced blanking */
  1031. #define V4L2_DV_BT_CAP_REDUCED_BLANKING (1 << 2)
  1032. /* Supports custom formats */
  1033. #define V4L2_DV_BT_CAP_CUSTOM (1 << 3)
  1034. /** struct v4l2_dv_timings_cap - DV timings capabilities
  1035. * @type: the type of the timings (same as in struct v4l2_dv_timings)
  1036. * @bt: the BT656/1120 timings capabilities
  1037. */
  1038. struct v4l2_dv_timings_cap {
  1039. __u32 type;
  1040. __u32 reserved[3];
  1041. union {
  1042. struct v4l2_bt_timings_cap bt;
  1043. __u32 raw_data[32];
  1044. };
  1045. };
  1046. /*
  1047. * V I D E O I N P U T S
  1048. */
  1049. struct v4l2_input {
  1050. __u32 index; /* Which input */
  1051. __u8 name[32]; /* Label */
  1052. __u32 type; /* Type of input */
  1053. __u32 audioset; /* Associated audios (bitfield) */
  1054. __u32 tuner; /* enum v4l2_tuner_type */
  1055. v4l2_std_id std;
  1056. __u32 status;
  1057. __u32 capabilities;
  1058. __u32 reserved[3];
  1059. };
  1060. /* Values for the 'type' field */
  1061. #define V4L2_INPUT_TYPE_TUNER 1
  1062. #define V4L2_INPUT_TYPE_CAMERA 2
  1063. /* field 'status' - general */
  1064. #define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */
  1065. #define V4L2_IN_ST_NO_SIGNAL 0x00000002
  1066. #define V4L2_IN_ST_NO_COLOR 0x00000004
  1067. /* field 'status' - sensor orientation */
  1068. /* If sensor is mounted upside down set both bits */
  1069. #define V4L2_IN_ST_HFLIP 0x00000010 /* Frames are flipped horizontally */
  1070. #define V4L2_IN_ST_VFLIP 0x00000020 /* Frames are flipped vertically */
  1071. /* field 'status' - analog */
  1072. #define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */
  1073. #define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
  1074. /* field 'status' - digital */
  1075. #define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */
  1076. #define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */
  1077. #define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */
  1078. /* field 'status' - VCR and set-top box */
  1079. #define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */
  1080. #define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
  1081. #define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
  1082. /* capabilities flags */
  1083. #define V4L2_IN_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
  1084. #define V4L2_IN_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
  1085. #define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */
  1086. /*
  1087. * V I D E O O U T P U T S
  1088. */
  1089. struct v4l2_output {
  1090. __u32 index; /* Which output */
  1091. __u8 name[32]; /* Label */
  1092. __u32 type; /* Type of output */
  1093. __u32 audioset; /* Associated audios (bitfield) */
  1094. __u32 modulator; /* Associated modulator */
  1095. v4l2_std_id std;
  1096. __u32 capabilities;
  1097. __u32 reserved[3];
  1098. };
  1099. /* Values for the 'type' field */
  1100. #define V4L2_OUTPUT_TYPE_MODULATOR 1
  1101. #define V4L2_OUTPUT_TYPE_ANALOG 2
  1102. #define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
  1103. /* capabilities flags */
  1104. #define V4L2_OUT_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
  1105. #define V4L2_OUT_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
  1106. #define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */
  1107. /*
  1108. * C O N T R O L S
  1109. */
  1110. struct v4l2_control {
  1111. __u32 id;
  1112. __s32 value;
  1113. };
  1114. struct v4l2_ext_control {
  1115. __u32 id;
  1116. __u32 size;
  1117. __u32 reserved2[1];
  1118. union {
  1119. __s32 value;
  1120. __s64 value64;
  1121. char *string;
  1122. };
  1123. } __attribute__ ((packed));
  1124. struct v4l2_ext_controls {
  1125. __u32 ctrl_class;
  1126. __u32 count;
  1127. __u32 error_idx;
  1128. __u32 reserved[2];
  1129. struct v4l2_ext_control *controls;
  1130. };
  1131. /* Values for ctrl_class field */
  1132. #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
  1133. #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
  1134. #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
  1135. #define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */
  1136. #define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */
  1137. #define V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */
  1138. #define V4L2_CTRL_CLASS_IMAGE_SOURCE 0x009e0000 /* Image source controls */
  1139. #define V4L2_CTRL_CLASS_IMAGE_PROC 0x009f0000 /* Image processing controls */
  1140. #define V4L2_CTRL_ID_MASK (0x0fffffff)
  1141. #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
  1142. #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
  1143. enum v4l2_ctrl_type {
  1144. V4L2_CTRL_TYPE_INTEGER = 1,
  1145. V4L2_CTRL_TYPE_BOOLEAN = 2,
  1146. V4L2_CTRL_TYPE_MENU = 3,
  1147. V4L2_CTRL_TYPE_BUTTON = 4,
  1148. V4L2_CTRL_TYPE_INTEGER64 = 5,
  1149. V4L2_CTRL_TYPE_CTRL_CLASS = 6,
  1150. V4L2_CTRL_TYPE_STRING = 7,
  1151. V4L2_CTRL_TYPE_BITMASK = 8,
  1152. V4L2_CTRL_TYPE_INTEGER_MENU = 9,
  1153. };
  1154. /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
  1155. struct v4l2_queryctrl {
  1156. __u32 id;
  1157. __u32 type; /* enum v4l2_ctrl_type */
  1158. __u8 name[32]; /* Whatever */
  1159. __s32 minimum; /* Note signedness */
  1160. __s32 maximum;
  1161. __s32 step;
  1162. __s32 default_value;
  1163. __u32 flags;
  1164. __u32 reserved[2];
  1165. };
  1166. /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
  1167. struct v4l2_querymenu {
  1168. __u32 id;
  1169. __u32 index;
  1170. union {
  1171. __u8 name[32]; /* Whatever */
  1172. __s64 value;
  1173. };
  1174. __u32 reserved;
  1175. } __attribute__ ((packed));
  1176. /* Control flags */
  1177. #define V4L2_CTRL_FLAG_DISABLED 0x0001
  1178. #define V4L2_CTRL_FLAG_GRABBED 0x0002
  1179. #define V4L2_CTRL_FLAG_READ_ONLY 0x0004
  1180. #define V4L2_CTRL_FLAG_UPDATE 0x0008
  1181. #define V4L2_CTRL_FLAG_INACTIVE 0x0010
  1182. #define V4L2_CTRL_FLAG_SLIDER 0x0020
  1183. #define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040
  1184. #define V4L2_CTRL_FLAG_VOLATILE 0x0080
  1185. /* Query flag, to be ORed with the control ID */
  1186. #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
  1187. /* User-class control IDs defined by V4L2 */
  1188. #define V4L2_CID_MAX_CTRLS 1024
  1189. #define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
  1190. #define V4L2_CID_USER_BASE V4L2_CID_BASE
  1191. /* IDs reserved for driver specific controls */
  1192. #define V4L2_CID_PRIVATE_BASE 0x08000000
  1193. #define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
  1194. #define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
  1195. #define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
  1196. #define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
  1197. #define V4L2_CID_HUE (V4L2_CID_BASE+3)
  1198. #define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
  1199. #define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
  1200. #define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
  1201. #define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
  1202. #define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
  1203. #define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
  1204. #define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11) /* Deprecated */
  1205. #define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
  1206. #define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
  1207. #define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
  1208. #define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
  1209. #define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
  1210. #define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* Deprecated */
  1211. #define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
  1212. #define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
  1213. #define V4L2_CID_GAIN (V4L2_CID_BASE+19)
  1214. #define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
  1215. #define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
  1216. /* Deprecated; use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */
  1217. #define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
  1218. #define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
  1219. #define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24)
  1220. enum v4l2_power_line_frequency {
  1221. V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0,
  1222. V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1,
  1223. V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2,
  1224. V4L2_CID_POWER_LINE_FREQUENCY_AUTO = 3,
  1225. };
  1226. #define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25)
  1227. #define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26)
  1228. #define V4L2_CID_SHARPNESS (V4L2_CID_BASE+27)
  1229. #define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28)
  1230. #define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29)
  1231. #define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30)
  1232. #define V4L2_CID_COLORFX (V4L2_CID_BASE+31)
  1233. enum v4l2_colorfx {
  1234. V4L2_COLORFX_NONE = 0,
  1235. V4L2_COLORFX_BW = 1,
  1236. V4L2_COLORFX_SEPIA = 2,
  1237. V4L2_COLORFX_NEGATIVE = 3,
  1238. V4L2_COLORFX_EMBOSS = 4,
  1239. V4L2_COLORFX_SKETCH = 5,
  1240. V4L2_COLORFX_SKY_BLUE = 6,
  1241. V4L2_COLORFX_GRASS_GREEN = 7,
  1242. V4L2_COLORFX_SKIN_WHITEN = 8,
  1243. V4L2_COLORFX_VIVID = 9,
  1244. V4L2_COLORFX_AQUA = 10,
  1245. V4L2_COLORFX_ART_FREEZE = 11,
  1246. V4L2_COLORFX_SILHOUETTE = 12,
  1247. V4L2_COLORFX_SOLARIZATION = 13,
  1248. V4L2_COLORFX_ANTIQUE = 14,
  1249. V4L2_COLORFX_SET_CBCR = 15,
  1250. };
  1251. #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
  1252. #define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
  1253. #define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
  1254. #define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
  1255. #define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
  1256. #define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
  1257. #define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
  1258. #define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39)
  1259. #define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40)
  1260. #define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)
  1261. #define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42)
  1262. /* last CID + 1 */
  1263. #define V4L2_CID_LASTP1 (V4L2_CID_BASE+43)
  1264. /* MPEG-class control IDs defined by V4L2 */
  1265. #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
  1266. #define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
  1267. /* MPEG streams, specific to multiplexed streams */
  1268. #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
  1269. enum v4l2_mpeg_stream_type {
  1270. V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
  1271. V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */
  1272. V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */
  1273. V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */
  1274. V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */
  1275. V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
  1276. };
  1277. #define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
  1278. #define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
  1279. #define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
  1280. #define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
  1281. #define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
  1282. #define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
  1283. #define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)
  1284. enum v4l2_mpeg_stream_vbi_fmt {
  1285. V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */
  1286. V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */
  1287. };
  1288. /* MPEG audio controls specific to multiplexed streams */
  1289. #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
  1290. enum v4l2_mpeg_audio_sampling_freq {
  1291. V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
  1292. V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
  1293. V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
  1294. };
  1295. #define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
  1296. enum v4l2_mpeg_audio_encoding {
  1297. V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
  1298. V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
  1299. V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
  1300. V4L2_MPEG_AUDIO_ENCODING_AAC = 3,
  1301. V4L2_MPEG_AUDIO_ENCODING_AC3 = 4,
  1302. };
  1303. #define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
  1304. enum v4l2_mpeg_audio_l1_bitrate {
  1305. V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
  1306. V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
  1307. V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
  1308. V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
  1309. V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
  1310. V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
  1311. V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
  1312. V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
  1313. V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
  1314. V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
  1315. V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
  1316. V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
  1317. V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
  1318. V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
  1319. };
  1320. #define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
  1321. enum v4l2_mpeg_audio_l2_bitrate {
  1322. V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
  1323. V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
  1324. V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2,
  1325. V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3,
  1326. V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4,
  1327. V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
  1328. V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
  1329. V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
  1330. V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
  1331. V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
  1332. V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
  1333. V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
  1334. V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
  1335. V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
  1336. };
  1337. #define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
  1338. enum v4l2_mpeg_audio_l3_bitrate {
  1339. V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
  1340. V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
  1341. V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2,
  1342. V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3,
  1343. V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
  1344. V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5,
  1345. V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6,
  1346. V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
  1347. V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
  1348. V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
  1349. V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
  1350. V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
  1351. V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
  1352. V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
  1353. };
  1354. #define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
  1355. enum v4l2_mpeg_audio_mode {
  1356. V4L2_MPEG_AUDIO_MODE_STEREO = 0,
  1357. V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
  1358. V4L2_MPEG_AUDIO_MODE_DUAL = 2,
  1359. V4L2_MPEG_AUDIO_MODE_MONO = 3,
  1360. };
  1361. #define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
  1362. enum v4l2_mpeg_audio_mode_extension {
  1363. V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
  1364. V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
  1365. V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
  1366. V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
  1367. };
  1368. #define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
  1369. enum v4l2_mpeg_audio_emphasis {
  1370. V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
  1371. V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
  1372. V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
  1373. };
  1374. #define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
  1375. enum v4l2_mpeg_audio_crc {
  1376. V4L2_MPEG_AUDIO_CRC_NONE = 0,
  1377. V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
  1378. };
  1379. #define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109)
  1380. #define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110)
  1381. #define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111)
  1382. enum v4l2_mpeg_audio_ac3_bitrate {
  1383. V4L2_MPEG_AUDIO_AC3_BITRATE_32K = 0,
  1384. V4L2_MPEG_AUDIO_AC3_BITRATE_40K = 1,
  1385. V4L2_MPEG_AUDIO_AC3_BITRATE_48K = 2,
  1386. V4L2_MPEG_AUDIO_AC3_BITRATE_56K = 3,
  1387. V4L2_MPEG_AUDIO_AC3_BITRATE_64K = 4,
  1388. V4L2_MPEG_AUDIO_AC3_BITRATE_80K = 5,
  1389. V4L2_MPEG_AUDIO_AC3_BITRATE_96K = 6,
  1390. V4L2_MPEG_AUDIO_AC3_BITRATE_112K = 7,
  1391. V4L2_MPEG_AUDIO_AC3_BITRATE_128K = 8,
  1392. V4L2_MPEG_AUDIO_AC3_BITRATE_160K = 9,
  1393. V4L2_MPEG_AUDIO_AC3_BITRATE_192K = 10,
  1394. V4L2_MPEG_AUDIO_AC3_BITRATE_224K = 11,
  1395. V4L2_MPEG_AUDIO_AC3_BITRATE_256K = 12,
  1396. V4L2_MPEG_AUDIO_AC3_BITRATE_320K = 13,
  1397. V4L2_MPEG_AUDIO_AC3_BITRATE_384K = 14,
  1398. V4L2_MPEG_AUDIO_AC3_BITRATE_448K = 15,
  1399. V4L2_MPEG_AUDIO_AC3_BITRATE_512K = 16,
  1400. V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17,
  1401. V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
  1402. };
  1403. #define V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (V4L2_CID_MPEG_BASE+112)
  1404. enum v4l2_mpeg_audio_dec_playback {
  1405. V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO = 0,
  1406. V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO = 1,
  1407. V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT = 2,
  1408. V4L2_MPEG_AUDIO_DEC_PLAYBACK_RIGHT = 3,
  1409. V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO = 4,
  1410. V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO = 5,
  1411. };
  1412. #define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_MPEG_BASE+113)
  1413. /* MPEG video controls specific to multiplexed streams */
  1414. #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
  1415. enum v4l2_mpeg_video_encoding {
  1416. V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
  1417. V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
  1418. V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,
  1419. };
  1420. #define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
  1421. enum v4l2_mpeg_video_aspect {
  1422. V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
  1423. V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
  1424. V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
  1425. V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
  1426. };
  1427. #define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
  1428. #define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
  1429. #define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
  1430. #define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
  1431. #define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
  1432. enum v4l2_mpeg_video_bitrate_mode {
  1433. V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
  1434. V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
  1435. };
  1436. #define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
  1437. #define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
  1438. #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
  1439. #define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)
  1440. #define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)
  1441. #define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212)
  1442. #define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213)
  1443. #define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214)
  1444. #define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215)
  1445. #define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+216)
  1446. enum v4l2_mpeg_video_header_mode {
  1447. V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE = 0,
  1448. V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1,
  1449. };
  1450. #define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217)
  1451. #define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218)
  1452. #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219)
  1453. #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220)
  1454. #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221)
  1455. enum v4l2_mpeg_video_multi_slice_mode {
  1456. V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0,
  1457. V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1,
  1458. V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2,
  1459. };
  1460. #define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
  1461. #define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223)
  1462. #define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224)
  1463. #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
  1464. #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
  1465. #define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302)
  1466. #define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+303)
  1467. #define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+304)
  1468. #define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+350)
  1469. #define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+351)
  1470. #define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+352)
  1471. #define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+353)
  1472. #define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+354)
  1473. #define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+355)
  1474. #define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+356)
  1475. #define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+357)
  1476. enum v4l2_mpeg_video_h264_entropy_mode {
  1477. V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC = 0,
  1478. V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC = 1,
  1479. };
  1480. #define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+358)
  1481. #define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+359)
  1482. enum v4l2_mpeg_video_h264_level {
  1483. V4L2_MPEG_VIDEO_H264_LEVEL_1_0 = 0,
  1484. V4L2_MPEG_VIDEO_H264_LEVEL_1B = 1,
  1485. V4L2_MPEG_VIDEO_H264_LEVEL_1_1 = 2,
  1486. V4L2_MPEG_VIDEO_H264_LEVEL_1_2 = 3,
  1487. V4L2_MPEG_VIDEO_H264_LEVEL_1_3 = 4,
  1488. V4L2_MPEG_VIDEO_H264_LEVEL_2_0 = 5,
  1489. V4L2_MPEG_VIDEO_H264_LEVEL_2_1 = 6,
  1490. V4L2_MPEG_VIDEO_H264_LEVEL_2_2 = 7,
  1491. V4L2_MPEG_VIDEO_H264_LEVEL_3_0 = 8,
  1492. V4L2_MPEG_VIDEO_H264_LEVEL_3_1 = 9,
  1493. V4L2_MPEG_VIDEO_H264_LEVEL_3_2 = 10,
  1494. V4L2_MPEG_VIDEO_H264_LEVEL_4_0 = 11,
  1495. V4L2_MPEG_VIDEO_H264_LEVEL_4_1 = 12,
  1496. V4L2_MPEG_VIDEO_H264_LEVEL_4_2 = 13,
  1497. V4L2_MPEG_VIDEO_H264_LEVEL_5_0 = 14,
  1498. V4L2_MPEG_VIDEO_H264_LEVEL_5_1 = 15,
  1499. };
  1500. #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+360)
  1501. #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+361)
  1502. #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+362)
  1503. enum v4l2_mpeg_video_h264_loop_filter_mode {
  1504. V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED = 0,
  1505. V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED = 1,
  1506. V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,
  1507. };
  1508. #define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+363)
  1509. enum v4l2_mpeg_video_h264_profile {
  1510. V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE = 0,
  1511. V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE = 1,
  1512. V4L2_MPEG_VIDEO_H264_PROFILE_MAIN = 2,
  1513. V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED = 3,
  1514. V4L2_MPEG_VIDEO_H264_PROFILE_HIGH = 4,
  1515. V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10 = 5,
  1516. V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422 = 6,
  1517. V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE = 7,
  1518. V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA = 8,
  1519. V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA = 9,
  1520. V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA = 10,
  1521. V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA = 11,
  1522. V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE = 12,
  1523. V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH = 13,
  1524. V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA = 14,
  1525. V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH = 15,
  1526. V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH = 16,
  1527. };
  1528. #define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+364)
  1529. #define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+365)
  1530. #define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+366)
  1531. #define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+367)
  1532. enum v4l2_mpeg_video_h264_vui_sar_idc {
  1533. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED = 0,
  1534. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 = 1,
  1535. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11 = 2,
  1536. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11 = 3,
  1537. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11 = 4,
  1538. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33 = 5,
  1539. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11 = 6,
  1540. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11 = 7,
  1541. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11 = 8,
  1542. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33 = 9,
  1543. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11 = 10,
  1544. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11 = 11,
  1545. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33 = 12,
  1546. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99 = 13,
  1547. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3 = 14,
  1548. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2 = 15,
  1549. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
  1550. V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
  1551. };
  1552. #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
  1553. #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
  1554. #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
  1555. #define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+403)
  1556. #define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+404)
  1557. #define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+405)
  1558. enum v4l2_mpeg_video_mpeg4_level {
  1559. V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 = 0,
  1560. V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B = 1,
  1561. V4L2_MPEG_VIDEO_MPEG4_LEVEL_1 = 2,
  1562. V4L2_MPEG_VIDEO_MPEG4_LEVEL_2 = 3,
  1563. V4L2_MPEG_VIDEO_MPEG4_LEVEL_3 = 4,
  1564. V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B = 5,
  1565. V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 = 6,
  1566. V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 = 7,
  1567. };
  1568. #define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+406)
  1569. enum v4l2_mpeg_video_mpeg4_profile {
  1570. V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE = 0,
  1571. V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE = 1,
  1572. V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE = 2,
  1573. V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE = 3,
  1574. V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 4,
  1575. };
  1576. #define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)
  1577. /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
  1578. #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
  1579. #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
  1580. enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
  1581. V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
  1582. V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
  1583. };
  1584. #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
  1585. #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
  1586. enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
  1587. V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
  1588. V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
  1589. V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2,
  1590. V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
  1591. V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
  1592. };
  1593. #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
  1594. enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
  1595. V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
  1596. V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
  1597. };
  1598. #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
  1599. enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
  1600. V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
  1601. V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
  1602. };
  1603. #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
  1604. #define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
  1605. enum v4l2_mpeg_cx2341x_video_median_filter_type {
  1606. V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
  1607. V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
  1608. V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2,
  1609. V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
  1610. V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
  1611. };
  1612. #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
  1613. #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
  1614. #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
  1615. #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
  1616. #define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)
  1617. /* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */
  1618. #define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100)
  1619. #define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0)
  1620. #define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1)
  1621. #define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+2)
  1622. enum v4l2_mpeg_mfc51_video_frame_skip_mode {
  1623. V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED = 0,
  1624. V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1,
  1625. V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2,
  1626. };
  1627. #define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+3)
  1628. enum v4l2_mpeg_mfc51_video_force_frame_type {
  1629. V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED = 0,
  1630. V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME = 1,
  1631. V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED = 2,
  1632. };
  1633. #define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+4)
  1634. #define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+5)
  1635. #define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+6)
  1636. #define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+7)
  1637. #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+50)
  1638. #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+51)
  1639. #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+52)
  1640. #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53)
  1641. #define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54)
  1642. /* Camera class control IDs */
  1643. #define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)
  1644. #define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1)
  1645. #define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE+1)
  1646. enum v4l2_exposure_auto_type {
  1647. V4L2_EXPOSURE_AUTO = 0,
  1648. V4L2_EXPOSURE_MANUAL = 1,
  1649. V4L2_EXPOSURE_SHUTTER_PRIORITY = 2,
  1650. V4L2_EXPOSURE_APERTURE_PRIORITY = 3
  1651. };
  1652. #define V4L2_CID_EXPOSURE_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+2)
  1653. #define V4L2_CID_EXPOSURE_AUTO_PRIORITY (V4L2_CID_CAMERA_CLASS_BASE+3)
  1654. #define V4L2_CID_PAN_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+4)
  1655. #define V4L2_CID_TILT_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+5)
  1656. #define V4L2_CID_PAN_RESET (V4L2_CID_CAMERA_CLASS_BASE+6)
  1657. #define V4L2_CID_TILT_RESET (V4L2_CID_CAMERA_CLASS_BASE+7)
  1658. #define V4L2_CID_PAN_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+8)
  1659. #define V4L2_CID_TILT_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+9)
  1660. #define V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+10)
  1661. #define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11)
  1662. #define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12)
  1663. #define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+13)
  1664. #define V4L2_CID_ZOOM_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+14)
  1665. #define V4L2_CID_ZOOM_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE+15)
  1666. #define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16)
  1667. #define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17)
  1668. #define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18)
  1669. #define V4L2_CID_AUTO_EXPOSURE_BIAS (V4L2_CID_CAMERA_CLASS_BASE+19)
  1670. #define V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE (V4L2_CID_CAMERA_CLASS_BASE+20)
  1671. enum v4l2_auto_n_preset_white_balance {
  1672. V4L2_WHITE_BALANCE_MANUAL = 0,
  1673. V4L2_WHITE_BALANCE_AUTO = 1,
  1674. V4L2_WHITE_BALANCE_INCANDESCENT = 2,
  1675. V4L2_WHITE_BALANCE_FLUORESCENT = 3,
  1676. V4L2_WHITE_BALANCE_FLUORESCENT_H = 4,
  1677. V4L2_WHITE_BALANCE_HORIZON = 5,
  1678. V4L2_WHITE_BALANCE_DAYLIGHT = 6,
  1679. V4L2_WHITE_BALANCE_FLASH = 7,
  1680. V4L2_WHITE_BALANCE_CLOUDY = 8,
  1681. V4L2_WHITE_BALANCE_SHADE = 9,
  1682. };
  1683. #define V4L2_CID_WIDE_DYNAMIC_RANGE (V4L2_CID_CAMERA_CLASS_BASE+21)
  1684. #define V4L2_CID_IMAGE_STABILIZATION (V4L2_CID_CAMERA_CLASS_BASE+22)
  1685. #define V4L2_CID_ISO_SENSITIVITY (V4L2_CID_CAMERA_CLASS_BASE+23)
  1686. #define V4L2_CID_ISO_SENSITIVITY_AUTO (V4L2_CID_CAMERA_CLASS_BASE+24)
  1687. enum v4l2_iso_sensitivity_auto_type {
  1688. V4L2_ISO_SENSITIVITY_MANUAL = 0,
  1689. V4L2_ISO_SENSITIVITY_AUTO = 1,
  1690. };
  1691. #define V4L2_CID_EXPOSURE_METERING (V4L2_CID_CAMERA_CLASS_BASE+25)
  1692. enum v4l2_exposure_metering {
  1693. V4L2_EXPOSURE_METERING_AVERAGE = 0,
  1694. V4L2_EXPOSURE_METERING_CENTER_WEIGHTED = 1,
  1695. V4L2_EXPOSURE_METERING_SPOT = 2,
  1696. };
  1697. #define V4L2_CID_SCENE_MODE (V4L2_CID_CAMERA_CLASS_BASE+26)
  1698. enum v4l2_scene_mode {
  1699. V4L2_SCENE_MODE_NONE = 0,
  1700. V4L2_SCENE_MODE_BACKLIGHT = 1,
  1701. V4L2_SCENE_MODE_BEACH_SNOW = 2,
  1702. V4L2_SCENE_MODE_CANDLE_LIGHT = 3,
  1703. V4L2_SCENE_MODE_DAWN_DUSK = 4,
  1704. V4L2_SCENE_MODE_FALL_COLORS = 5,
  1705. V4L2_SCENE_MODE_FIREWORKS = 6,
  1706. V4L2_SCENE_MODE_LANDSCAPE = 7,
  1707. V4L2_SCENE_MODE_NIGHT = 8,
  1708. V4L2_SCENE_MODE_PARTY_INDOOR = 9,
  1709. V4L2_SCENE_MODE_PORTRAIT = 10,
  1710. V4L2_SCENE_MODE_SPORTS = 11,
  1711. V4L2_SCENE_MODE_SUNSET = 12,
  1712. V4L2_SCENE_MODE_TEXT = 13,
  1713. };
  1714. #define V4L2_CID_3A_LOCK (V4L2_CID_CAMERA_CLASS_BASE+27)
  1715. #define V4L2_LOCK_EXPOSURE (1 << 0)
  1716. #define V4L2_LOCK_WHITE_BALANCE (1 << 1)
  1717. #define V4L2_LOCK_FOCUS (1 << 2)
  1718. #define V4L2_CID_AUTO_FOCUS_START (V4L2_CID_CAMERA_CLASS_BASE+28)
  1719. #define V4L2_CID_AUTO_FOCUS_STOP (V4L2_CID_CAMERA_CLASS_BASE+29)
  1720. #define V4L2_CID_AUTO_FOCUS_STATUS (V4L2_CID_CAMERA_CLASS_BASE+30)
  1721. #define V4L2_AUTO_FOCUS_STATUS_IDLE (0 << 0)
  1722. #define V4L2_AUTO_FOCUS_STATUS_BUSY (1 << 0)
  1723. #define V4L2_AUTO_FOCUS_STATUS_REACHED (1 << 1)
  1724. #define V4L2_AUTO_FOCUS_STATUS_FAILED (1 << 2)
  1725. #define V4L2_CID_AUTO_FOCUS_RANGE (V4L2_CID_CAMERA_CLASS_BASE+31)
  1726. enum v4l2_auto_focus_range {
  1727. V4L2_AUTO_FOCUS_RANGE_AUTO = 0,
  1728. V4L2_AUTO_FOCUS_RANGE_NORMAL = 1,
  1729. V4L2_AUTO_FOCUS_RANGE_MACRO = 2,
  1730. V4L2_AUTO_FOCUS_RANGE_INFINITY = 3,
  1731. };
  1732. /* FM Modulator class control IDs */
  1733. #define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
  1734. #define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1)
  1735. #define V4L2_CID_RDS_TX_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 1)
  1736. #define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 2)
  1737. #define V4L2_CID_RDS_TX_PTY (V4L2_CID_FM_TX_CLASS_BASE + 3)
  1738. #define V4L2_CID_RDS_TX_PS_NAME (V4L2_CID_FM_TX_CLASS_BASE + 5)
  1739. #define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 6)
  1740. #define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 64)
  1741. #define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 65)
  1742. #define V4L2_CID_AUDIO_LIMITER_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 66)
  1743. #define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 80)
  1744. #define V4L2_CID_AUDIO_COMPRESSION_GAIN (V4L2_CID_FM_TX_CLASS_BASE + 81)
  1745. #define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD (V4L2_CID_FM_TX_CLASS_BASE + 82)
  1746. #define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 83)
  1747. #define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 84)
  1748. #define V4L2_CID_PILOT_TONE_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 96)
  1749. #define V4L2_CID_PILOT_TONE_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 97)
  1750. #define V4L2_CID_PILOT_TONE_FREQUENCY (V4L2_CID_FM_TX_CLASS_BASE + 98)
  1751. #define V4L2_CID_TUNE_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 112)
  1752. enum v4l2_preemphasis {
  1753. V4L2_PREEMPHASIS_DISABLED = 0,
  1754. V4L2_PREEMPHASIS_50_uS = 1,
  1755. V4L2_PREEMPHASIS_75_uS = 2,
  1756. };
  1757. #define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113)
  1758. #define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114)
  1759. /* Flash and privacy (indicator) light controls */
  1760. #define V4L2_CID_FLASH_CLASS_BASE (V4L2_CTRL_CLASS_FLASH | 0x900)
  1761. #define V4L2_CID_FLASH_CLASS (V4L2_CTRL_CLASS_FLASH | 1)
  1762. #define V4L2_CID_FLASH_LED_MODE (V4L2_CID_FLASH_CLASS_BASE + 1)
  1763. enum v4l2_flash_led_mode {
  1764. V4L2_FLASH_LED_MODE_NONE,
  1765. V4L2_FLASH_LED_MODE_FLASH,
  1766. V4L2_FLASH_LED_MODE_TORCH,
  1767. };
  1768. #define V4L2_CID_FLASH_STROBE_SOURCE (V4L2_CID_FLASH_CLASS_BASE + 2)
  1769. enum v4l2_flash_strobe_source {
  1770. V4L2_FLASH_STROBE_SOURCE_SOFTWARE,
  1771. V4L2_FLASH_STROBE_SOURCE_EXTERNAL,
  1772. };
  1773. #define V4L2_CID_FLASH_STROBE (V4L2_CID_FLASH_CLASS_BASE + 3)
  1774. #define V4L2_CID_FLASH_STROBE_STOP (V4L2_CID_FLASH_CLASS_BASE + 4)
  1775. #define V4L2_CID_FLASH_STROBE_STATUS (V4L2_CID_FLASH_CLASS_BASE + 5)
  1776. #define V4L2_CID_FLASH_TIMEOUT (V4L2_CID_FLASH_CLASS_BASE + 6)
  1777. #define V4L2_CID_FLASH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 7)
  1778. #define V4L2_CID_FLASH_TORCH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 8)
  1779. #define V4L2_CID_FLASH_INDICATOR_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 9)
  1780. #define V4L2_CID_FLASH_FAULT (V4L2_CID_FLASH_CLASS_BASE + 10)
  1781. #define V4L2_FLASH_FAULT_OVER_VOLTAGE (1 << 0)
  1782. #define V4L2_FLASH_FAULT_TIMEOUT (1 << 1)
  1783. #define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2)
  1784. #define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3)
  1785. #define V4L2_FLASH_FAULT_OVER_CURRENT (1 << 4)
  1786. #define V4L2_FLASH_FAULT_INDICATOR (1 << 5)
  1787. #define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11)
  1788. #define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12)
  1789. /* JPEG-class control IDs defined by V4L2 */
  1790. #define V4L2_CID_JPEG_CLASS_BASE (V4L2_CTRL_CLASS_JPEG | 0x900)
  1791. #define V4L2_CID_JPEG_CLASS (V4L2_CTRL_CLASS_JPEG | 1)
  1792. #define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1)
  1793. enum v4l2_jpeg_chroma_subsampling {
  1794. V4L2_JPEG_CHROMA_SUBSAMPLING_444 = 0,
  1795. V4L2_JPEG_CHROMA_SUBSAMPLING_422 = 1,
  1796. V4L2_JPEG_CHROMA_SUBSAMPLING_420 = 2,
  1797. V4L2_JPEG_CHROMA_SUBSAMPLING_411 = 3,
  1798. V4L2_JPEG_CHROMA_SUBSAMPLING_410 = 4,
  1799. V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY = 5,
  1800. };
  1801. #define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2)
  1802. #define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3)
  1803. #define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4)
  1804. #define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0)
  1805. #define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1)
  1806. #define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16)
  1807. #define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
  1808. #define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
  1809. /* Image source controls */
  1810. #define V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900)
  1811. #define V4L2_CID_IMAGE_SOURCE_CLASS (V4L2_CTRL_CLASS_IMAGE_SOURCE | 1)
  1812. #define V4L2_CID_VBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 1)
  1813. #define V4L2_CID_HBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 2)
  1814. #define V4L2_CID_ANALOGUE_GAIN (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 3)
  1815. /* Image processing controls */
  1816. #define V4L2_CID_IMAGE_PROC_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_PROC | 0x900)
  1817. #define V4L2_CID_IMAGE_PROC_CLASS (V4L2_CTRL_CLASS_IMAGE_PROC | 1)
  1818. #define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
  1819. #define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
  1820. /*
  1821. * T U N I N G
  1822. */
  1823. struct v4l2_tuner {
  1824. __u32 index;
  1825. __u8 name[32];
  1826. __u32 type; /* enum v4l2_tuner_type */
  1827. __u32 capability;
  1828. __u32 rangelow;
  1829. __u32 rangehigh;
  1830. __u32 rxsubchans;
  1831. __u32 audmode;
  1832. __s32 signal;
  1833. __s32 afc;
  1834. __u32 reserved[4];
  1835. };
  1836. struct v4l2_modulator {
  1837. __u32 index;
  1838. __u8 name[32];
  1839. __u32 capability;
  1840. __u32 rangelow;
  1841. __u32 rangehigh;
  1842. __u32 txsubchans;
  1843. __u32 reserved[4];
  1844. };
  1845. /* Flags for the 'capability' field */
  1846. #define V4L2_TUNER_CAP_LOW 0x0001
  1847. #define V4L2_TUNER_CAP_NORM 0x0002
  1848. #define V4L2_TUNER_CAP_STEREO 0x0010
  1849. #define V4L2_TUNER_CAP_LANG2 0x0020
  1850. #define V4L2_TUNER_CAP_SAP 0x0020
  1851. #define V4L2_TUNER_CAP_LANG1 0x0040
  1852. #define V4L2_TUNER_CAP_RDS 0x0080
  1853. #define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
  1854. #define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
  1855. /* Flags for the 'rxsubchans' field */
  1856. #define V4L2_TUNER_SUB_MONO 0x0001
  1857. #define V4L2_TUNER_SUB_STEREO 0x0002
  1858. #define V4L2_TUNER_SUB_LANG2 0x0004
  1859. #define V4L2_TUNER_SUB_SAP 0x0004
  1860. #define V4L2_TUNER_SUB_LANG1 0x0008
  1861. #define V4L2_TUNER_SUB_RDS 0x0010
  1862. /* Values for the 'audmode' field */
  1863. #define V4L2_TUNER_MODE_MONO 0x0000
  1864. #define V4L2_TUNER_MODE_STEREO 0x0001
  1865. #define V4L2_TUNER_MODE_LANG2 0x0002
  1866. #define V4L2_TUNER_MODE_SAP 0x0002
  1867. #define V4L2_TUNER_MODE_LANG1 0x0003
  1868. #define V4L2_TUNER_MODE_LANG1_LANG2 0x0004
  1869. struct v4l2_frequency {
  1870. __u32 tuner;
  1871. __u32 type; /* enum v4l2_tuner_type */
  1872. __u32 frequency;
  1873. __u32 reserved[8];
  1874. };
  1875. struct v4l2_hw_freq_seek {
  1876. __u32 tuner;
  1877. __u32 type; /* enum v4l2_tuner_type */
  1878. __u32 seek_upward;
  1879. __u32 wrap_around;
  1880. __u32 spacing;
  1881. __u32 reserved[7];
  1882. };
  1883. /*
  1884. * R D S
  1885. */
  1886. struct v4l2_rds_data {
  1887. __u8 lsb;
  1888. __u8 msb;
  1889. __u8 block;
  1890. } __attribute__ ((packed));
  1891. #define V4L2_RDS_BLOCK_MSK 0x7
  1892. #define V4L2_RDS_BLOCK_A 0
  1893. #define V4L2_RDS_BLOCK_B 1
  1894. #define V4L2_RDS_BLOCK_C 2
  1895. #define V4L2_RDS_BLOCK_D 3
  1896. #define V4L2_RDS_BLOCK_C_ALT 4
  1897. #define V4L2_RDS_BLOCK_INVALID 7
  1898. #define V4L2_RDS_BLOCK_CORRECTED 0x40
  1899. #define V4L2_RDS_BLOCK_ERROR 0x80
  1900. /*
  1901. * A U D I O
  1902. */
  1903. struct v4l2_audio {
  1904. __u32 index;
  1905. __u8 name[32];
  1906. __u32 capability;
  1907. __u32 mode;
  1908. __u32 reserved[2];
  1909. };
  1910. /* Flags for the 'capability' field */
  1911. #define V4L2_AUDCAP_STEREO 0x00001
  1912. #define V4L2_AUDCAP_AVL 0x00002
  1913. /* Flags for the 'mode' field */
  1914. #define V4L2_AUDMODE_AVL 0x00001
  1915. struct v4l2_audioout {
  1916. __u32 index;
  1917. __u8 name[32];
  1918. __u32 capability;
  1919. __u32 mode;
  1920. __u32 reserved[2];
  1921. };
  1922. /*
  1923. * M P E G S E R V I C E S
  1924. *
  1925. * NOTE: EXPERIMENTAL API
  1926. */
  1927. #if 1
  1928. #define V4L2_ENC_IDX_FRAME_I (0)
  1929. #define V4L2_ENC_IDX_FRAME_P (1)
  1930. #define V4L2_ENC_IDX_FRAME_B (2)
  1931. #define V4L2_ENC_IDX_FRAME_MASK (0xf)
  1932. struct v4l2_enc_idx_entry {
  1933. __u64 offset;
  1934. __u64 pts;
  1935. __u32 length;
  1936. __u32 flags;
  1937. __u32 reserved[2];
  1938. };
  1939. #define V4L2_ENC_IDX_ENTRIES (64)
  1940. struct v4l2_enc_idx {
  1941. __u32 entries;
  1942. __u32 entries_cap;
  1943. __u32 reserved[4];
  1944. struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES];
  1945. };
  1946. #define V4L2_ENC_CMD_START (0)
  1947. #define V4L2_ENC_CMD_STOP (1)
  1948. #define V4L2_ENC_CMD_PAUSE (2)
  1949. #define V4L2_ENC_CMD_RESUME (3)
  1950. /* Flags for V4L2_ENC_CMD_STOP */
  1951. #define V4L2_ENC_CMD_STOP_AT_GOP_END (1 << 0)
  1952. struct v4l2_encoder_cmd {
  1953. __u32 cmd;
  1954. __u32 flags;
  1955. union {
  1956. struct {
  1957. __u32 data[8];
  1958. } raw;
  1959. };
  1960. };
  1961. /* Decoder commands */
  1962. #define V4L2_DEC_CMD_START (0)
  1963. #define V4L2_DEC_CMD_STOP (1)
  1964. #define V4L2_DEC_CMD_PAUSE (2)
  1965. #define V4L2_DEC_CMD_RESUME (3)
  1966. /* Flags for V4L2_DEC_CMD_START */
  1967. #define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0)
  1968. /* Flags for V4L2_DEC_CMD_PAUSE */
  1969. #define V4L2_DEC_CMD_PAUSE_TO_BLACK (1 << 0)
  1970. /* Flags for V4L2_DEC_CMD_STOP */
  1971. #define V4L2_DEC_CMD_STOP_TO_BLACK (1 << 0)
  1972. #define V4L2_DEC_CMD_STOP_IMMEDIATELY (1 << 1)
  1973. /* Play format requirements (returned by the driver): */
  1974. /* The decoder has no special format requirements */
  1975. #define V4L2_DEC_START_FMT_NONE (0)
  1976. /* The decoder requires full GOPs */
  1977. #define V4L2_DEC_START_FMT_GOP (1)
  1978. /* The structure must be zeroed before use by the application
  1979. This ensures it can be extended safely in the future. */
  1980. struct v4l2_decoder_cmd {
  1981. __u32 cmd;
  1982. __u32 flags;
  1983. union {
  1984. struct {
  1985. __u64 pts;
  1986. } stop;
  1987. struct {
  1988. /* 0 or 1000 specifies normal speed,
  1989. 1 specifies forward single stepping,
  1990. -1 specifies backward single stepping,
  1991. >1: playback at speed/1000 of the normal speed,
  1992. <-1: reverse playback at (-speed/1000) of the normal speed. */
  1993. __s32 speed;
  1994. __u32 format;
  1995. } start;
  1996. struct {
  1997. __u32 data[16];
  1998. } raw;
  1999. };
  2000. };
  2001. #endif
  2002. /*
  2003. * D A T A S E R V I C E S ( V B I )
  2004. *
  2005. * Data services API by Michael Schimek
  2006. */
  2007. /* Raw VBI */
  2008. struct v4l2_vbi_format {
  2009. __u32 sampling_rate; /* in 1 Hz */
  2010. __u32 offset;
  2011. __u32 samples_per_line;
  2012. __u32 sample_format; /* V4L2_PIX_FMT_* */
  2013. __s32 start[2];
  2014. __u32 count[2];
  2015. __u32 flags; /* V4L2_VBI_* */
  2016. __u32 reserved[2]; /* must be zero */
  2017. };
  2018. /* VBI flags */
  2019. #define V4L2_VBI_UNSYNC (1 << 0)
  2020. #define V4L2_VBI_INTERLACED (1 << 1)
  2021. /* Sliced VBI
  2022. *
  2023. * This implements is a proposal V4L2 API to allow SLICED VBI
  2024. * required for some hardware encoders. It should change without
  2025. * notice in the definitive implementation.
  2026. */
  2027. struct v4l2_sliced_vbi_format {
  2028. __u16 service_set;
  2029. /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
  2030. service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
  2031. (equals frame lines 313-336 for 625 line video
  2032. standards, 263-286 for 525 line standards) */
  2033. __u16 service_lines[2][24];
  2034. __u32 io_size;
  2035. __u32 reserved[2]; /* must be zero */
  2036. };
  2037. /* Teletext World System Teletext
  2038. (WST), defined on ITU-R BT.653-2 */
  2039. #define V4L2_SLICED_TELETEXT_B (0x0001)
  2040. /* Video Program System, defined on ETS 300 231*/
  2041. #define V4L2_SLICED_VPS (0x0400)
  2042. /* Closed Caption, defined on EIA-608 */
  2043. #define V4L2_SLICED_CAPTION_525 (0x1000)
  2044. /* Wide Screen System, defined on ITU-R BT1119.1 */
  2045. #define V4L2_SLICED_WSS_625 (0x4000)
  2046. #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525)
  2047. #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
  2048. struct v4l2_sliced_vbi_cap {
  2049. __u16 service_set;
  2050. /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
  2051. service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
  2052. (equals frame lines 313-336 for 625 line video
  2053. standards, 263-286 for 525 line standards) */
  2054. __u16 service_lines[2][24];
  2055. __u32 type; /* enum v4l2_buf_type */
  2056. __u32 reserved[3]; /* must be 0 */
  2057. };
  2058. struct v4l2_sliced_vbi_data {
  2059. __u32 id;
  2060. __u32 field; /* 0: first field, 1: second field */
  2061. __u32 line; /* 1-23 */
  2062. __u32 reserved; /* must be 0 */
  2063. __u8 data[48];
  2064. };
  2065. /*
  2066. * Sliced VBI data inserted into MPEG Streams
  2067. */
  2068. /*
  2069. * V4L2_MPEG_STREAM_VBI_FMT_IVTV:
  2070. *
  2071. * Structure of payload contained in an MPEG 2 Private Stream 1 PES Packet in an
  2072. * MPEG-2 Program Pack that contains V4L2_MPEG_STREAM_VBI_FMT_IVTV Sliced VBI
  2073. * data
  2074. *
  2075. * Note, the MPEG-2 Program Pack and Private Stream 1 PES packet header
  2076. * definitions are not included here. See the MPEG-2 specifications for details
  2077. * on these headers.
  2078. */
  2079. /* Line type IDs */
  2080. #define V4L2_MPEG_VBI_IVTV_TELETEXT_B (1)
  2081. #define V4L2_MPEG_VBI_IVTV_CAPTION_525 (4)
  2082. #define V4L2_MPEG_VBI_IVTV_WSS_625 (5)
  2083. #define V4L2_MPEG_VBI_IVTV_VPS (7)
  2084. struct v4l2_mpeg_vbi_itv0_line {
  2085. __u8 id; /* One of V4L2_MPEG_VBI_IVTV_* above */
  2086. __u8 data[42]; /* Sliced VBI data for the line */
  2087. } __attribute__ ((packed));
  2088. struct v4l2_mpeg_vbi_itv0 {
  2089. __le32 linemask[2]; /* Bitmasks of VBI service lines present */
  2090. struct v4l2_mpeg_vbi_itv0_line line[35];
  2091. } __attribute__ ((packed));
  2092. struct v4l2_mpeg_vbi_ITV0 {
  2093. struct v4l2_mpeg_vbi_itv0_line line[36];
  2094. } __attribute__ ((packed));
  2095. #define V4L2_MPEG_VBI_IVTV_MAGIC0 "itv0"
  2096. #define V4L2_MPEG_VBI_IVTV_MAGIC1 "ITV0"
  2097. struct v4l2_mpeg_vbi_fmt_ivtv {
  2098. __u8 magic[4];
  2099. union {
  2100. struct v4l2_mpeg_vbi_itv0 itv0;
  2101. struct v4l2_mpeg_vbi_ITV0 ITV0;
  2102. };
  2103. } __attribute__ ((packed));
  2104. /*
  2105. * A G G R E G A T E S T R U C T U R E S
  2106. */
  2107. /**
  2108. * struct v4l2_plane_pix_format - additional, per-plane format definition
  2109. * @sizeimage: maximum size in bytes required for data, for which
  2110. * this plane will be used
  2111. * @bytesperline: distance in bytes between the leftmost pixels in two
  2112. * adjacent lines
  2113. */
  2114. struct v4l2_plane_pix_format {
  2115. __u32 sizeimage;
  2116. __u16 bytesperline;
  2117. __u16 reserved[7];
  2118. } __attribute__ ((packed));
  2119. /**
  2120. * struct v4l2_pix_format_mplane - multiplanar format definition
  2121. * @width: image width in pixels
  2122. * @height: image height in pixels
  2123. * @pixelformat: little endian four character code (fourcc)
  2124. * @field: enum v4l2_field; field order (for interlaced video)
  2125. * @colorspace: enum v4l2_colorspace; supplemental to pixelformat
  2126. * @plane_fmt: per-plane information
  2127. * @num_planes: number of planes for this format
  2128. */
  2129. struct v4l2_pix_format_mplane {
  2130. __u32 width;
  2131. __u32 height;
  2132. __u32 pixelformat;
  2133. __u32 field;
  2134. __u32 colorspace;
  2135. struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
  2136. __u8 num_planes;
  2137. __u8 reserved[11];
  2138. } __attribute__ ((packed));
  2139. /**
  2140. * struct v4l2_format - stream data format
  2141. * @type: enum v4l2_buf_type; type of the data stream
  2142. * @pix: definition of an image format
  2143. * @pix_mp: definition of a multiplanar image format
  2144. * @win: definition of an overlaid image
  2145. * @vbi: raw VBI capture or output parameters
  2146. * @sliced: sliced VBI capture or output parameters
  2147. * @raw_data: placeholder for future extensions and custom formats
  2148. */
  2149. struct v4l2_format {
  2150. __u32 type;
  2151. union {
  2152. struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
  2153. struct v4l2_pix_format_mplane pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
  2154. struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
  2155. struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */
  2156. struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
  2157. __u8 raw_data[200]; /* user-defined */
  2158. } fmt;
  2159. };
  2160. /* Stream type-dependent parameters
  2161. */
  2162. struct v4l2_streamparm {
  2163. __u32 type; /* enum v4l2_buf_type */
  2164. union {
  2165. struct v4l2_captureparm capture;
  2166. struct v4l2_outputparm output;
  2167. __u8 raw_data[200]; /* user-defined */
  2168. } parm;
  2169. };
  2170. /*
  2171. * E V E N T S
  2172. */
  2173. #define V4L2_EVENT_ALL 0
  2174. #define V4L2_EVENT_VSYNC 1
  2175. #define V4L2_EVENT_EOS 2
  2176. #define V4L2_EVENT_CTRL 3
  2177. #define V4L2_EVENT_FRAME_SYNC 4
  2178. #define V4L2_EVENT_PRIVATE_START 0x08000000
  2179. /* Payload for V4L2_EVENT_VSYNC */
  2180. struct v4l2_event_vsync {
  2181. /* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */
  2182. __u8 field;
  2183. } __attribute__ ((packed));
  2184. /* Payload for V4L2_EVENT_CTRL */
  2185. #define V4L2_EVENT_CTRL_CH_VALUE (1 << 0)
  2186. #define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1)
  2187. struct v4l2_event_ctrl {
  2188. __u32 changes;
  2189. __u32 type;
  2190. union {
  2191. __s32 value;
  2192. __s64 value64;
  2193. };
  2194. __u32 flags;
  2195. __s32 minimum;
  2196. __s32 maximum;
  2197. __s32 step;
  2198. __s32 default_value;
  2199. };
  2200. struct v4l2_event_frame_sync {
  2201. __u32 frame_sequence;
  2202. };
  2203. struct v4l2_event {
  2204. __u32 type;
  2205. union {
  2206. struct v4l2_event_vsync vsync;
  2207. struct v4l2_event_ctrl ctrl;
  2208. struct v4l2_event_frame_sync frame_sync;
  2209. __u8 data[64];
  2210. } u;
  2211. __u32 pending;
  2212. __u32 sequence;
  2213. struct timespec timestamp;
  2214. __u32 id;
  2215. __u32 reserved[8];
  2216. };
  2217. #define V4L2_EVENT_SUB_FL_SEND_INITIAL (1 << 0)
  2218. #define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK (1 << 1)
  2219. struct v4l2_event_subscription {
  2220. __u32 type;
  2221. __u32 id;
  2222. __u32 flags;
  2223. __u32 reserved[5];
  2224. };
  2225. /*
  2226. * A D V A N C E D D E B U G G I N G
  2227. *
  2228. * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
  2229. * FOR DEBUGGING, TESTING AND INTERNAL USE ONLY!
  2230. */
  2231. /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
  2232. #define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */
  2233. #define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */
  2234. #define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */
  2235. #define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */
  2236. struct v4l2_dbg_match {
  2237. __u32 type; /* Match type */
  2238. union { /* Match this chip, meaning determined by type */
  2239. __u32 addr;
  2240. char name[32];
  2241. };
  2242. } __attribute__ ((packed));
  2243. struct v4l2_dbg_register {
  2244. struct v4l2_dbg_match match;
  2245. __u32 size; /* register size in bytes */
  2246. __u64 reg;
  2247. __u64 val;
  2248. } __attribute__ ((packed));
  2249. /* VIDIOC_DBG_G_CHIP_IDENT */
  2250. struct v4l2_dbg_chip_ident {
  2251. struct v4l2_dbg_match match;
  2252. __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */
  2253. __u32 revision; /* chip revision, chip specific */
  2254. } __attribute__ ((packed));
  2255. /**
  2256. * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument
  2257. * @index: on return, index of the first created buffer
  2258. * @count: entry: number of requested buffers,
  2259. * return: number of created buffers
  2260. * @memory: enum v4l2_memory; buffer memory type
  2261. * @format: frame format, for which buffers are requested
  2262. * @reserved: future extensions
  2263. */
  2264. struct v4l2_create_buffers {
  2265. __u32 index;
  2266. __u32 count;
  2267. __u32 memory;
  2268. struct v4l2_format format;
  2269. __u32 reserved[8];
  2270. };
  2271. /*
  2272. * I O C T L C O D E S F O R V I D E O D E V I C E S
  2273. *
  2274. */
  2275. #define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability)
  2276. #define VIDIOC_RESERVED _IO('V', 1)
  2277. #define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc)
  2278. #define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format)
  2279. #define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format)
  2280. #define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers)
  2281. #define VIDIOC_QUERYBUF _IOWR('V', 9, struct v4l2_buffer)
  2282. #define VIDIOC_G_FBUF _IOR('V', 10, struct v4l2_framebuffer)
  2283. #define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer)
  2284. #define VIDIOC_OVERLAY _IOW('V', 14, int)
  2285. #define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer)
  2286. #define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer)
  2287. #define VIDIOC_STREAMON _IOW('V', 18, int)
  2288. #define VIDIOC_STREAMOFF _IOW('V', 19, int)
  2289. #define VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm)
  2290. #define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm)
  2291. #define VIDIOC_G_STD _IOR('V', 23, v4l2_std_id)
  2292. #define VIDIOC_S_STD _IOW('V', 24, v4l2_std_id)
  2293. #define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard)
  2294. #define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input)
  2295. #define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control)
  2296. #define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control)
  2297. #define VIDIOC_G_TUNER _IOWR('V', 29, struct v4l2_tuner)
  2298. #define VIDIOC_S_TUNER _IOW('V', 30, struct v4l2_tuner)
  2299. #define VIDIOC_G_AUDIO _IOR('V', 33, struct v4l2_audio)
  2300. #define VIDIOC_S_AUDIO _IOW('V', 34, struct v4l2_audio)
  2301. #define VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl)
  2302. #define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu)
  2303. #define VIDIOC_G_INPUT _IOR('V', 38, int)
  2304. #define VIDIOC_S_INPUT _IOWR('V', 39, int)
  2305. #define VIDIOC_G_OUTPUT _IOR('V', 46, int)
  2306. #define VIDIOC_S_OUTPUT _IOWR('V', 47, int)
  2307. #define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output)
  2308. #define VIDIOC_G_AUDOUT _IOR('V', 49, struct v4l2_audioout)
  2309. #define VIDIOC_S_AUDOUT _IOW('V', 50, struct v4l2_audioout)
  2310. #define VIDIOC_G_MODULATOR _IOWR('V', 54, struct v4l2_modulator)
  2311. #define VIDIOC_S_MODULATOR _IOW('V', 55, struct v4l2_modulator)
  2312. #define VIDIOC_G_FREQUENCY _IOWR('V', 56, struct v4l2_frequency)
  2313. #define VIDIOC_S_FREQUENCY _IOW('V', 57, struct v4l2_frequency)
  2314. #define VIDIOC_CROPCAP _IOWR('V', 58, struct v4l2_cropcap)
  2315. #define VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop)
  2316. #define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop)
  2317. #define VIDIOC_G_JPEGCOMP _IOR('V', 61, struct v4l2_jpegcompression)
  2318. #define VIDIOC_S_JPEGCOMP _IOW('V', 62, struct v4l2_jpegcompression)
  2319. #define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id)
  2320. #define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format)
  2321. #define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio)
  2322. #define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout)
  2323. #define VIDIOC_G_PRIORITY _IOR('V', 67, __u32) /* enum v4l2_priority */
  2324. #define VIDIOC_S_PRIORITY _IOW('V', 68, __u32) /* enum v4l2_priority */
  2325. #define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap)
  2326. #define VIDIOC_LOG_STATUS _IO('V', 70)
  2327. #define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls)
  2328. #define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls)
  2329. #define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls)
  2330. #if 1
  2331. #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)
  2332. #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
  2333. #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx)
  2334. #define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd)
  2335. #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd)
  2336. #endif
  2337. #if 1
  2338. /* Experimental, meant for debugging, testing and internal use.
  2339. Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
  2340. You must be root to use these ioctls. Never use these in applications! */
  2341. #define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
  2342. #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
  2343. /* Experimental, meant for debugging, testing and internal use.
  2344. Never use this ioctl in applications! */
  2345. #define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident)
  2346. #endif
  2347. #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
  2348. /* These four DV Preset ioctls are deprecated in favor of the DV Timings
  2349. ioctls. */
  2350. #define VIDIOC_ENUM_DV_PRESETS _IOWR('V', 83, struct v4l2_dv_enum_preset)
  2351. #define VIDIOC_S_DV_PRESET _IOWR('V', 84, struct v4l2_dv_preset)
  2352. #define VIDIOC_G_DV_PRESET _IOWR('V', 85, struct v4l2_dv_preset)
  2353. #define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct v4l2_dv_preset)
  2354. #define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
  2355. #define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
  2356. #define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
  2357. #define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
  2358. #define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
  2359. /* Experimental, the below two ioctls may change over the next couple of kernel
  2360. versions */
  2361. #define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
  2362. #define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer)
  2363. /* Experimental selection API */
  2364. #define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection)
  2365. #define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection)
  2366. /* Experimental, these two ioctls may change over the next couple of kernel
  2367. versions. */
  2368. #define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd)
  2369. #define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd)
  2370. /* Experimental, these three ioctls may change over the next couple of kernel
  2371. versions. */
  2372. #define VIDIOC_ENUM_DV_TIMINGS _IOWR('V', 98, struct v4l2_enum_dv_timings)
  2373. #define VIDIOC_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings)
  2374. #define VIDIOC_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap)
  2375. /* Reminder: when adding new ioctls please add support for them to
  2376. drivers/media/video/v4l2-compat-ioctl32.c as well! */
  2377. #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
  2378. #endif /* __LINUX_VIDEODEV2_H */