videodev2.h 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272
  1. /*
  2. * Video for Linux Two
  3. *
  4. * Header file for v4l or V4L2 drivers and applications
  5. * with public API.
  6. * All kernel-specific stuff were moved to media/v4l2-dev.h, so
  7. * no #if __KERNEL tests are allowed here
  8. *
  9. * See http://linuxtv.org for more info
  10. *
  11. * Author: Bill Dirks <bdirks@pacbell.net>
  12. * Justin Schoeman
  13. * et al.
  14. */
  15. #ifndef __LINUX_VIDEODEV2_H
  16. #define __LINUX_VIDEODEV2_H
  17. #ifdef __KERNEL__
  18. #include <linux/time.h> /* need struct timeval */
  19. #include <linux/compiler.h> /* need __user */
  20. #else
  21. #define __user
  22. #endif
  23. #include <linux/types.h>
  24. #define HAVE_V4L2 1
  25. /*
  26. * Common stuff for both V4L1 and V4L2
  27. * Moved from videodev.h
  28. */
  29. #define VIDEO_MAX_FRAME 32
  30. #define VID_TYPE_CAPTURE 1 /* Can capture */
  31. #define VID_TYPE_TUNER 2 /* Can tune */
  32. #define VID_TYPE_TELETEXT 4 /* Does teletext */
  33. #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
  34. #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
  35. #define VID_TYPE_CLIPPING 32 /* Can clip */
  36. #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
  37. #define VID_TYPE_SCALES 128 /* Scalable */
  38. #define VID_TYPE_MONOCHROME 256 /* Monochrome only */
  39. #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
  40. #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
  41. #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
  42. #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
  43. #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
  44. /*
  45. * M I S C E L L A N E O U S
  46. */
  47. /* Four-character-code (FOURCC) */
  48. #define v4l2_fourcc(a,b,c,d)\
  49. (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
  50. /*
  51. * E N U M S
  52. */
  53. enum v4l2_field {
  54. V4L2_FIELD_ANY = 0, /* driver can choose from none,
  55. top, bottom, interlaced
  56. depending on whatever it thinks
  57. is approximate ... */
  58. V4L2_FIELD_NONE = 1, /* this device has no fields ... */
  59. V4L2_FIELD_TOP = 2, /* top field only */
  60. V4L2_FIELD_BOTTOM = 3, /* bottom field only */
  61. V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */
  62. V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one
  63. buffer, top-bottom order */
  64. V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */
  65. V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into
  66. separate buffers */
  67. };
  68. #define V4L2_FIELD_HAS_TOP(field) \
  69. ((field) == V4L2_FIELD_TOP ||\
  70. (field) == V4L2_FIELD_INTERLACED ||\
  71. (field) == V4L2_FIELD_SEQ_TB ||\
  72. (field) == V4L2_FIELD_SEQ_BT)
  73. #define V4L2_FIELD_HAS_BOTTOM(field) \
  74. ((field) == V4L2_FIELD_BOTTOM ||\
  75. (field) == V4L2_FIELD_INTERLACED ||\
  76. (field) == V4L2_FIELD_SEQ_TB ||\
  77. (field) == V4L2_FIELD_SEQ_BT)
  78. #define V4L2_FIELD_HAS_BOTH(field) \
  79. ((field) == V4L2_FIELD_INTERLACED ||\
  80. (field) == V4L2_FIELD_SEQ_TB ||\
  81. (field) == V4L2_FIELD_SEQ_BT)
  82. enum v4l2_buf_type {
  83. V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
  84. V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
  85. V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
  86. V4L2_BUF_TYPE_VBI_CAPTURE = 4,
  87. V4L2_BUF_TYPE_VBI_OUTPUT = 5,
  88. #if 1
  89. /* Experimental Sliced VBI */
  90. V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
  91. V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
  92. #endif
  93. V4L2_BUF_TYPE_PRIVATE = 0x80,
  94. };
  95. enum v4l2_ctrl_type {
  96. V4L2_CTRL_TYPE_INTEGER = 1,
  97. V4L2_CTRL_TYPE_BOOLEAN = 2,
  98. V4L2_CTRL_TYPE_MENU = 3,
  99. V4L2_CTRL_TYPE_BUTTON = 4,
  100. V4L2_CTRL_TYPE_INTEGER64 = 5,
  101. V4L2_CTRL_TYPE_CTRL_CLASS = 6,
  102. };
  103. enum v4l2_tuner_type {
  104. V4L2_TUNER_RADIO = 1,
  105. V4L2_TUNER_ANALOG_TV = 2,
  106. V4L2_TUNER_DIGITAL_TV = 3,
  107. };
  108. enum v4l2_memory {
  109. V4L2_MEMORY_MMAP = 1,
  110. V4L2_MEMORY_USERPTR = 2,
  111. V4L2_MEMORY_OVERLAY = 3,
  112. };
  113. /* see also http://vektor.theorem.ca/graphics/ycbcr/ */
  114. enum v4l2_colorspace {
  115. /* ITU-R 601 -- broadcast NTSC/PAL */
  116. V4L2_COLORSPACE_SMPTE170M = 1,
  117. /* 1125-Line (US) HDTV */
  118. V4L2_COLORSPACE_SMPTE240M = 2,
  119. /* HD and modern captures. */
  120. V4L2_COLORSPACE_REC709 = 3,
  121. /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
  122. V4L2_COLORSPACE_BT878 = 4,
  123. /* These should be useful. Assume 601 extents. */
  124. V4L2_COLORSPACE_470_SYSTEM_M = 5,
  125. V4L2_COLORSPACE_470_SYSTEM_BG = 6,
  126. /* I know there will be cameras that send this. So, this is
  127. * unspecified chromaticities and full 0-255 on each of the
  128. * Y'CbCr components
  129. */
  130. V4L2_COLORSPACE_JPEG = 7,
  131. /* For RGB colourspaces, this is probably a good start. */
  132. V4L2_COLORSPACE_SRGB = 8,
  133. };
  134. enum v4l2_priority {
  135. V4L2_PRIORITY_UNSET = 0, /* not initialized */
  136. V4L2_PRIORITY_BACKGROUND = 1,
  137. V4L2_PRIORITY_INTERACTIVE = 2,
  138. V4L2_PRIORITY_RECORD = 3,
  139. V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE,
  140. };
  141. struct v4l2_rect {
  142. __s32 left;
  143. __s32 top;
  144. __s32 width;
  145. __s32 height;
  146. };
  147. struct v4l2_fract {
  148. __u32 numerator;
  149. __u32 denominator;
  150. };
  151. /*
  152. * D R I V E R C A P A B I L I T I E S
  153. */
  154. struct v4l2_capability
  155. {
  156. __u8 driver[16]; /* i.e. "bttv" */
  157. __u8 card[32]; /* i.e. "Hauppauge WinTV" */
  158. __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */
  159. __u32 version; /* should use KERNEL_VERSION() */
  160. __u32 capabilities; /* Device capabilities */
  161. __u32 reserved[4];
  162. };
  163. /* Values for 'capabilities' field */
  164. #define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
  165. #define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
  166. #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
  167. #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */
  168. #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */
  169. #if 1
  170. #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */
  171. #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
  172. #endif
  173. #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
  174. #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
  175. #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
  176. #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
  177. #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
  178. #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
  179. #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
  180. /*
  181. * V I D E O I M A G E F O R M A T
  182. */
  183. struct v4l2_pix_format
  184. {
  185. __u32 width;
  186. __u32 height;
  187. __u32 pixelformat;
  188. enum v4l2_field field;
  189. __u32 bytesperline; /* for padding, zero if unused */
  190. __u32 sizeimage;
  191. enum v4l2_colorspace colorspace;
  192. __u32 priv; /* private data, depends on pixelformat */
  193. };
  194. /* Pixel format FOURCC depth Description */
  195. #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */
  196. #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */
  197. #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */
  198. #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R','G','B','Q') /* 16 RGB-5-5-5 BE */
  199. #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R','G','B','R') /* 16 RGB-5-6-5 BE */
  200. #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B','G','R','3') /* 24 BGR-8-8-8 */
  201. #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R','G','B','3') /* 24 RGB-8-8-8 */
  202. #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */
  203. #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */
  204. #define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y') /* 8 Greyscale */
  205. #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */
  206. #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */
  207. #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y','U','Y','V') /* 16 YUV 4:2:2 */
  208. #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U','Y','V','Y') /* 16 YUV 4:2:2 */
  209. #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */
  210. #define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */
  211. #define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */
  212. /* two planes -- one Y, one Cr + Cb interleaved */
  213. #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2') /* 12 Y/CbCr 4:2:0 */
  214. #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1') /* 12 Y/CrCb 4:2:0 */
  215. /* The following formats are not defined in the V4L2 specification */
  216. #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y','U','V','9') /* 9 YUV 4:1:0 */
  217. #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */
  218. #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */
  219. #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */
  220. #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:1:1 16x16 macroblocks */
  221. /* see http://www.siliconimaging.com/RGB%20Bayer.htm */
  222. #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */
  223. /* compressed formats */
  224. #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */
  225. #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */
  226. #define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */
  227. #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG-1/2/4 */
  228. /* Vendor-specific formats */
  229. #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */
  230. #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */
  231. #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */
  232. #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */
  233. #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */
  234. /*
  235. * F O R M A T E N U M E R A T I O N
  236. */
  237. struct v4l2_fmtdesc
  238. {
  239. __u32 index; /* Format number */
  240. enum v4l2_buf_type type; /* buffer type */
  241. __u32 flags;
  242. __u8 description[32]; /* Description string */
  243. __u32 pixelformat; /* Format fourcc */
  244. __u32 reserved[4];
  245. };
  246. #define V4L2_FMT_FLAG_COMPRESSED 0x0001
  247. /*
  248. * T I M E C O D E
  249. */
  250. struct v4l2_timecode
  251. {
  252. __u32 type;
  253. __u32 flags;
  254. __u8 frames;
  255. __u8 seconds;
  256. __u8 minutes;
  257. __u8 hours;
  258. __u8 userbits[4];
  259. };
  260. /* Type */
  261. #define V4L2_TC_TYPE_24FPS 1
  262. #define V4L2_TC_TYPE_25FPS 2
  263. #define V4L2_TC_TYPE_30FPS 3
  264. #define V4L2_TC_TYPE_50FPS 4
  265. #define V4L2_TC_TYPE_60FPS 5
  266. /* Flags */
  267. #define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */
  268. #define V4L2_TC_FLAG_COLORFRAME 0x0002
  269. #define V4L2_TC_USERBITS_field 0x000C
  270. #define V4L2_TC_USERBITS_USERDEFINED 0x0000
  271. #define V4L2_TC_USERBITS_8BITCHARS 0x0008
  272. /* The above is based on SMPTE timecodes */
  273. #ifdef __KERNEL__
  274. /*
  275. * M P E G C O M P R E S S I O N P A R A M E T E R S
  276. *
  277. * ### WARNING: This experimental MPEG compression API is obsolete.
  278. * ### It is replaced by the MPEG controls API.
  279. * ### This old API will disappear in the near future!
  280. *
  281. */
  282. enum v4l2_bitrate_mode {
  283. V4L2_BITRATE_NONE = 0, /* not specified */
  284. V4L2_BITRATE_CBR, /* constant bitrate */
  285. V4L2_BITRATE_VBR, /* variable bitrate */
  286. };
  287. struct v4l2_bitrate {
  288. /* rates are specified in kbit/sec */
  289. enum v4l2_bitrate_mode mode;
  290. __u32 min;
  291. __u32 target; /* use this one for CBR */
  292. __u32 max;
  293. };
  294. enum v4l2_mpeg_streamtype {
  295. V4L2_MPEG_SS_1, /* MPEG-1 system stream */
  296. V4L2_MPEG_PS_2, /* MPEG-2 program stream */
  297. V4L2_MPEG_TS_2, /* MPEG-2 transport stream */
  298. V4L2_MPEG_PS_DVD, /* MPEG-2 program stream with DVD header fixups */
  299. };
  300. enum v4l2_mpeg_audiotype {
  301. V4L2_MPEG_AU_2_I, /* MPEG-2 layer 1 */
  302. V4L2_MPEG_AU_2_II, /* MPEG-2 layer 2 */
  303. V4L2_MPEG_AU_2_III, /* MPEG-2 layer 3 */
  304. V4L2_MPEG_AC3, /* AC3 */
  305. V4L2_MPEG_LPCM, /* LPCM */
  306. };
  307. enum v4l2_mpeg_videotype {
  308. V4L2_MPEG_VI_1, /* MPEG-1 */
  309. V4L2_MPEG_VI_2, /* MPEG-2 */
  310. };
  311. enum v4l2_mpeg_aspectratio {
  312. V4L2_MPEG_ASPECT_SQUARE = 1, /* square pixel */
  313. V4L2_MPEG_ASPECT_4_3 = 2, /* 4 : 3 */
  314. V4L2_MPEG_ASPECT_16_9 = 3, /* 16 : 9 */
  315. V4L2_MPEG_ASPECT_1_221 = 4, /* 1 : 2,21 */
  316. };
  317. struct v4l2_mpeg_compression {
  318. /* general */
  319. enum v4l2_mpeg_streamtype st_type;
  320. struct v4l2_bitrate st_bitrate;
  321. /* transport streams */
  322. __u16 ts_pid_pmt;
  323. __u16 ts_pid_audio;
  324. __u16 ts_pid_video;
  325. __u16 ts_pid_pcr;
  326. /* program stream */
  327. __u16 ps_size;
  328. __u16 reserved_1; /* align */
  329. /* audio */
  330. enum v4l2_mpeg_audiotype au_type;
  331. struct v4l2_bitrate au_bitrate;
  332. __u32 au_sample_rate;
  333. __u8 au_pesid;
  334. __u8 reserved_2[3]; /* align */
  335. /* video */
  336. enum v4l2_mpeg_videotype vi_type;
  337. enum v4l2_mpeg_aspectratio vi_aspect_ratio;
  338. struct v4l2_bitrate vi_bitrate;
  339. __u32 vi_frame_rate;
  340. __u16 vi_frames_per_gop;
  341. __u16 vi_bframes_count;
  342. __u8 vi_pesid;
  343. __u8 reserved_3[3]; /* align */
  344. /* misc flags */
  345. __u32 closed_gops:1;
  346. __u32 pulldown:1;
  347. __u32 reserved_4:30; /* align */
  348. /* I don't expect the above being perfect yet ;) */
  349. __u32 reserved_5[8];
  350. };
  351. #endif
  352. struct v4l2_jpegcompression
  353. {
  354. int quality;
  355. int APPn; /* Number of APP segment to be written,
  356. * must be 0..15 */
  357. int APP_len; /* Length of data in JPEG APPn segment */
  358. char APP_data[60]; /* Data in the JPEG APPn segment. */
  359. int COM_len; /* Length of data in JPEG COM segment */
  360. char COM_data[60]; /* Data in JPEG COM segment */
  361. __u32 jpeg_markers; /* Which markers should go into the JPEG
  362. * output. Unless you exactly know what
  363. * you do, leave them untouched.
  364. * Inluding less markers will make the
  365. * resulting code smaller, but there will
  366. * be fewer aplications which can read it.
  367. * The presence of the APP and COM marker
  368. * is influenced by APP_len and COM_len
  369. * ONLY, not by this property! */
  370. #define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
  371. #define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
  372. #define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
  373. #define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
  374. #define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
  375. * allways use APP0 */
  376. };
  377. /*
  378. * M E M O R Y - M A P P I N G B U F F E R S
  379. */
  380. struct v4l2_requestbuffers
  381. {
  382. __u32 count;
  383. enum v4l2_buf_type type;
  384. enum v4l2_memory memory;
  385. __u32 reserved[2];
  386. };
  387. struct v4l2_buffer
  388. {
  389. __u32 index;
  390. enum v4l2_buf_type type;
  391. __u32 bytesused;
  392. __u32 flags;
  393. enum v4l2_field field;
  394. struct timeval timestamp;
  395. struct v4l2_timecode timecode;
  396. __u32 sequence;
  397. /* memory location */
  398. enum v4l2_memory memory;
  399. union {
  400. __u32 offset;
  401. unsigned long userptr;
  402. } m;
  403. __u32 length;
  404. __u32 input;
  405. __u32 reserved;
  406. };
  407. /* Flags for 'flags' field */
  408. #define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */
  409. #define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */
  410. #define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */
  411. #define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
  412. #define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
  413. #define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
  414. #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
  415. #define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
  416. /*
  417. * O V E R L A Y P R E V I E W
  418. */
  419. struct v4l2_framebuffer
  420. {
  421. __u32 capability;
  422. __u32 flags;
  423. /* FIXME: in theory we should pass something like PCI device + memory
  424. * region + offset instead of some physical address */
  425. void* base;
  426. struct v4l2_pix_format fmt;
  427. };
  428. /* Flags for the 'capability' field. Read only */
  429. #define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
  430. #define V4L2_FBUF_CAP_CHROMAKEY 0x0002
  431. #define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
  432. #define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
  433. /* Flags for the 'flags' field. */
  434. #define V4L2_FBUF_FLAG_PRIMARY 0x0001
  435. #define V4L2_FBUF_FLAG_OVERLAY 0x0002
  436. #define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
  437. struct v4l2_clip
  438. {
  439. struct v4l2_rect c;
  440. struct v4l2_clip __user *next;
  441. };
  442. struct v4l2_window
  443. {
  444. struct v4l2_rect w;
  445. enum v4l2_field field;
  446. __u32 chromakey;
  447. struct v4l2_clip __user *clips;
  448. __u32 clipcount;
  449. void __user *bitmap;
  450. };
  451. /*
  452. * C A P T U R E P A R A M E T E R S
  453. */
  454. struct v4l2_captureparm
  455. {
  456. __u32 capability; /* Supported modes */
  457. __u32 capturemode; /* Current mode */
  458. struct v4l2_fract timeperframe; /* Time per frame in .1us units */
  459. __u32 extendedmode; /* Driver-specific extensions */
  460. __u32 readbuffers; /* # of buffers for read */
  461. __u32 reserved[4];
  462. };
  463. /* Flags for 'capability' and 'capturemode' fields */
  464. #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
  465. #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
  466. struct v4l2_outputparm
  467. {
  468. __u32 capability; /* Supported modes */
  469. __u32 outputmode; /* Current mode */
  470. struct v4l2_fract timeperframe; /* Time per frame in seconds */
  471. __u32 extendedmode; /* Driver-specific extensions */
  472. __u32 writebuffers; /* # of buffers for write */
  473. __u32 reserved[4];
  474. };
  475. /*
  476. * I N P U T I M A G E C R O P P I N G
  477. */
  478. struct v4l2_cropcap {
  479. enum v4l2_buf_type type;
  480. struct v4l2_rect bounds;
  481. struct v4l2_rect defrect;
  482. struct v4l2_fract pixelaspect;
  483. };
  484. struct v4l2_crop {
  485. enum v4l2_buf_type type;
  486. struct v4l2_rect c;
  487. };
  488. /*
  489. * A N A L O G V I D E O S T A N D A R D
  490. */
  491. typedef __u64 v4l2_std_id;
  492. /* one bit for each */
  493. #define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
  494. #define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
  495. #define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
  496. #define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
  497. #define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
  498. #define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
  499. #define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
  500. #define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
  501. #define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
  502. #define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
  503. #define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
  504. #define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
  505. #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
  506. #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
  507. #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
  508. #define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
  509. #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
  510. #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
  511. #define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
  512. #define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
  513. #define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
  514. #define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
  515. #define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
  516. #define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
  517. /* ATSC/HDTV */
  518. #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
  519. #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
  520. /* some merged standards */
  521. #define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC)
  522. #define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B)
  523. #define V4L2_STD_GH (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H)
  524. #define V4L2_STD_DK (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK)
  525. /* some common needed stuff */
  526. #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
  527. V4L2_STD_PAL_B1 |\
  528. V4L2_STD_PAL_G)
  529. #define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
  530. V4L2_STD_PAL_D1 |\
  531. V4L2_STD_PAL_K)
  532. #define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
  533. V4L2_STD_PAL_DK |\
  534. V4L2_STD_PAL_H |\
  535. V4L2_STD_PAL_I)
  536. #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
  537. V4L2_STD_NTSC_M_JP |\
  538. V4L2_STD_NTSC_M_KR)
  539. #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
  540. V4L2_STD_SECAM_K |\
  541. V4L2_STD_SECAM_K1)
  542. #define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
  543. V4L2_STD_SECAM_G |\
  544. V4L2_STD_SECAM_H |\
  545. V4L2_STD_SECAM_DK |\
  546. V4L2_STD_SECAM_L |\
  547. V4L2_STD_SECAM_LC)
  548. #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
  549. V4L2_STD_PAL_60 |\
  550. V4L2_STD_NTSC |\
  551. V4L2_STD_NTSC_443)
  552. #define V4L2_STD_625_50 (V4L2_STD_PAL |\
  553. V4L2_STD_PAL_N |\
  554. V4L2_STD_PAL_Nc |\
  555. V4L2_STD_SECAM)
  556. #define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\
  557. V4L2_STD_ATSC_16_VSB)
  558. #define V4L2_STD_UNKNOWN 0
  559. #define V4L2_STD_ALL (V4L2_STD_525_60 |\
  560. V4L2_STD_625_50)
  561. struct v4l2_standard
  562. {
  563. __u32 index;
  564. v4l2_std_id id;
  565. __u8 name[24];
  566. struct v4l2_fract frameperiod; /* Frames, not fields */
  567. __u32 framelines;
  568. __u32 reserved[4];
  569. };
  570. /*
  571. * V I D E O I N P U T S
  572. */
  573. struct v4l2_input
  574. {
  575. __u32 index; /* Which input */
  576. __u8 name[32]; /* Label */
  577. __u32 type; /* Type of input */
  578. __u32 audioset; /* Associated audios (bitfield) */
  579. __u32 tuner; /* Associated tuner */
  580. v4l2_std_id std;
  581. __u32 status;
  582. __u32 reserved[4];
  583. };
  584. /* Values for the 'type' field */
  585. #define V4L2_INPUT_TYPE_TUNER 1
  586. #define V4L2_INPUT_TYPE_CAMERA 2
  587. /* field 'status' - general */
  588. #define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */
  589. #define V4L2_IN_ST_NO_SIGNAL 0x00000002
  590. #define V4L2_IN_ST_NO_COLOR 0x00000004
  591. /* field 'status' - analog */
  592. #define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */
  593. #define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
  594. /* field 'status' - digital */
  595. #define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */
  596. #define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */
  597. #define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */
  598. /* field 'status' - VCR and set-top box */
  599. #define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */
  600. #define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
  601. #define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
  602. /*
  603. * V I D E O O U T P U T S
  604. */
  605. struct v4l2_output
  606. {
  607. __u32 index; /* Which output */
  608. __u8 name[32]; /* Label */
  609. __u32 type; /* Type of output */
  610. __u32 audioset; /* Associated audios (bitfield) */
  611. __u32 modulator; /* Associated modulator */
  612. v4l2_std_id std;
  613. __u32 reserved[4];
  614. };
  615. /* Values for the 'type' field */
  616. #define V4L2_OUTPUT_TYPE_MODULATOR 1
  617. #define V4L2_OUTPUT_TYPE_ANALOG 2
  618. #define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
  619. /*
  620. * C O N T R O L S
  621. */
  622. struct v4l2_control
  623. {
  624. __u32 id;
  625. __s32 value;
  626. };
  627. struct v4l2_ext_control
  628. {
  629. __u32 id;
  630. __u32 reserved2[2];
  631. union {
  632. __s32 value;
  633. __s64 value64;
  634. void *reserved;
  635. };
  636. } __attribute__ ((packed));
  637. struct v4l2_ext_controls
  638. {
  639. __u32 ctrl_class;
  640. __u32 count;
  641. __u32 error_idx;
  642. __u32 reserved[2];
  643. struct v4l2_ext_control *controls;
  644. };
  645. /* Values for ctrl_class field */
  646. #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
  647. #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
  648. #define V4L2_CTRL_ID_MASK (0x0fffffff)
  649. #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
  650. #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
  651. /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
  652. struct v4l2_queryctrl
  653. {
  654. __u32 id;
  655. enum v4l2_ctrl_type type;
  656. __u8 name[32]; /* Whatever */
  657. __s32 minimum; /* Note signedness */
  658. __s32 maximum;
  659. __s32 step;
  660. __s32 default_value;
  661. __u32 flags;
  662. __u32 reserved[2];
  663. };
  664. /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
  665. struct v4l2_querymenu
  666. {
  667. __u32 id;
  668. __u32 index;
  669. __u8 name[32]; /* Whatever */
  670. __u32 reserved;
  671. };
  672. /* Control flags */
  673. #define V4L2_CTRL_FLAG_DISABLED 0x0001
  674. #define V4L2_CTRL_FLAG_GRABBED 0x0002
  675. #define V4L2_CTRL_FLAG_READ_ONLY 0x0004
  676. #define V4L2_CTRL_FLAG_UPDATE 0x0008
  677. #define V4L2_CTRL_FLAG_INACTIVE 0x0010
  678. #define V4L2_CTRL_FLAG_SLIDER 0x0020
  679. /* Query flag, to be ORed with the control ID */
  680. #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
  681. /* User-class control IDs defined by V4L2 */
  682. #define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
  683. #define V4L2_CID_USER_BASE V4L2_CID_BASE
  684. /* IDs reserved for driver specific controls */
  685. #define V4L2_CID_PRIVATE_BASE 0x08000000
  686. #define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
  687. #define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
  688. #define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
  689. #define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
  690. #define V4L2_CID_HUE (V4L2_CID_BASE+3)
  691. #define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
  692. #define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
  693. #define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
  694. #define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
  695. #define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
  696. #define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
  697. #define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11)
  698. #define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
  699. #define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
  700. #define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
  701. #define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
  702. #define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
  703. #define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* ? Not sure */
  704. #define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
  705. #define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
  706. #define V4L2_CID_GAIN (V4L2_CID_BASE+19)
  707. #define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
  708. #define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
  709. #define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
  710. #define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
  711. #define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */
  712. /* MPEG-class control IDs defined by V4L2 */
  713. #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
  714. #define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
  715. /* MPEG streams */
  716. #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
  717. enum v4l2_mpeg_stream_type {
  718. V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
  719. V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */
  720. V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */
  721. V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */
  722. V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */
  723. V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
  724. };
  725. #define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
  726. #define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
  727. #define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
  728. #define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
  729. #define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
  730. #define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
  731. #define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)
  732. enum v4l2_mpeg_stream_vbi_fmt {
  733. V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */
  734. V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */
  735. };
  736. /* MPEG audio */
  737. #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
  738. enum v4l2_mpeg_audio_sampling_freq {
  739. V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
  740. V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
  741. V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
  742. };
  743. #define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
  744. enum v4l2_mpeg_audio_encoding {
  745. V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
  746. V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
  747. V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
  748. };
  749. #define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
  750. enum v4l2_mpeg_audio_l1_bitrate {
  751. V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
  752. V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
  753. V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
  754. V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
  755. V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
  756. V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
  757. V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
  758. V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
  759. V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
  760. V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
  761. V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
  762. V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
  763. V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
  764. V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
  765. };
  766. #define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
  767. enum v4l2_mpeg_audio_l2_bitrate {
  768. V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
  769. V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
  770. V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2,
  771. V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3,
  772. V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4,
  773. V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
  774. V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
  775. V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
  776. V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
  777. V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
  778. V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
  779. V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
  780. V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
  781. V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
  782. };
  783. #define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
  784. enum v4l2_mpeg_audio_l3_bitrate {
  785. V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
  786. V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
  787. V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2,
  788. V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3,
  789. V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
  790. V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5,
  791. V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6,
  792. V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
  793. V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
  794. V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
  795. V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
  796. V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
  797. V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
  798. V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
  799. };
  800. #define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
  801. enum v4l2_mpeg_audio_mode {
  802. V4L2_MPEG_AUDIO_MODE_STEREO = 0,
  803. V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
  804. V4L2_MPEG_AUDIO_MODE_DUAL = 2,
  805. V4L2_MPEG_AUDIO_MODE_MONO = 3,
  806. };
  807. #define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
  808. enum v4l2_mpeg_audio_mode_extension {
  809. V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
  810. V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
  811. V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
  812. V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
  813. };
  814. #define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
  815. enum v4l2_mpeg_audio_emphasis {
  816. V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
  817. V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
  818. V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
  819. };
  820. #define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
  821. enum v4l2_mpeg_audio_crc {
  822. V4L2_MPEG_AUDIO_CRC_NONE = 0,
  823. V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
  824. };
  825. /* MPEG video */
  826. #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
  827. enum v4l2_mpeg_video_encoding {
  828. V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
  829. V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
  830. };
  831. #define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
  832. enum v4l2_mpeg_video_aspect {
  833. V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
  834. V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
  835. V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
  836. V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
  837. };
  838. #define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
  839. #define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
  840. #define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
  841. #define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
  842. #define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
  843. enum v4l2_mpeg_video_bitrate_mode {
  844. V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
  845. V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
  846. };
  847. #define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
  848. #define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
  849. #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
  850. /* MPEG-class control IDs specific to the CX2584x driver as defined by V4L2 */
  851. #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
  852. #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
  853. enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
  854. V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
  855. V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
  856. };
  857. #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
  858. #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
  859. enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
  860. V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
  861. V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
  862. V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2,
  863. V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
  864. V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
  865. };
  866. #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
  867. enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
  868. V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
  869. V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
  870. };
  871. #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
  872. enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
  873. V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
  874. V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
  875. };
  876. #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
  877. #define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
  878. enum v4l2_mpeg_cx2341x_video_median_filter_type {
  879. V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
  880. V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
  881. V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2,
  882. V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
  883. V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
  884. };
  885. #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
  886. #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
  887. #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
  888. #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
  889. /*
  890. * T U N I N G
  891. */
  892. struct v4l2_tuner
  893. {
  894. __u32 index;
  895. __u8 name[32];
  896. enum v4l2_tuner_type type;
  897. __u32 capability;
  898. __u32 rangelow;
  899. __u32 rangehigh;
  900. __u32 rxsubchans;
  901. __u32 audmode;
  902. __s32 signal;
  903. __s32 afc;
  904. __u32 reserved[4];
  905. };
  906. struct v4l2_modulator
  907. {
  908. __u32 index;
  909. __u8 name[32];
  910. __u32 capability;
  911. __u32 rangelow;
  912. __u32 rangehigh;
  913. __u32 txsubchans;
  914. __u32 reserved[4];
  915. };
  916. /* Flags for the 'capability' field */
  917. #define V4L2_TUNER_CAP_LOW 0x0001
  918. #define V4L2_TUNER_CAP_NORM 0x0002
  919. #define V4L2_TUNER_CAP_STEREO 0x0010
  920. #define V4L2_TUNER_CAP_LANG2 0x0020
  921. #define V4L2_TUNER_CAP_SAP 0x0020
  922. #define V4L2_TUNER_CAP_LANG1 0x0040
  923. /* Flags for the 'rxsubchans' field */
  924. #define V4L2_TUNER_SUB_MONO 0x0001
  925. #define V4L2_TUNER_SUB_STEREO 0x0002
  926. #define V4L2_TUNER_SUB_LANG2 0x0004
  927. #define V4L2_TUNER_SUB_SAP 0x0004
  928. #define V4L2_TUNER_SUB_LANG1 0x0008
  929. /* Values for the 'audmode' field */
  930. #define V4L2_TUNER_MODE_MONO 0x0000
  931. #define V4L2_TUNER_MODE_STEREO 0x0001
  932. #define V4L2_TUNER_MODE_LANG2 0x0002
  933. #define V4L2_TUNER_MODE_SAP 0x0002
  934. #define V4L2_TUNER_MODE_LANG1 0x0003
  935. #define V4L2_TUNER_MODE_LANG1_LANG2 0x0004
  936. struct v4l2_frequency
  937. {
  938. __u32 tuner;
  939. enum v4l2_tuner_type type;
  940. __u32 frequency;
  941. __u32 reserved[8];
  942. };
  943. /*
  944. * A U D I O
  945. */
  946. struct v4l2_audio
  947. {
  948. __u32 index;
  949. __u8 name[32];
  950. __u32 capability;
  951. __u32 mode;
  952. __u32 reserved[2];
  953. };
  954. /* Flags for the 'capability' field */
  955. #define V4L2_AUDCAP_STEREO 0x00001
  956. #define V4L2_AUDCAP_AVL 0x00002
  957. /* Flags for the 'mode' field */
  958. #define V4L2_AUDMODE_AVL 0x00001
  959. struct v4l2_audioout
  960. {
  961. __u32 index;
  962. __u8 name[32];
  963. __u32 capability;
  964. __u32 mode;
  965. __u32 reserved[2];
  966. };
  967. /*
  968. * D A T A S E R V I C E S ( V B I )
  969. *
  970. * Data services API by Michael Schimek
  971. */
  972. /* Raw VBI */
  973. struct v4l2_vbi_format
  974. {
  975. __u32 sampling_rate; /* in 1 Hz */
  976. __u32 offset;
  977. __u32 samples_per_line;
  978. __u32 sample_format; /* V4L2_PIX_FMT_* */
  979. __s32 start[2];
  980. __u32 count[2];
  981. __u32 flags; /* V4L2_VBI_* */
  982. __u32 reserved[2]; /* must be zero */
  983. };
  984. /* VBI flags */
  985. #define V4L2_VBI_UNSYNC (1<< 0)
  986. #define V4L2_VBI_INTERLACED (1<< 1)
  987. #if 1
  988. /* Sliced VBI
  989. *
  990. * This implements is a proposal V4L2 API to allow SLICED VBI
  991. * required for some hardware encoders. It should change without
  992. * notice in the definitive implementation.
  993. */
  994. struct v4l2_sliced_vbi_format
  995. {
  996. __u16 service_set;
  997. /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
  998. service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
  999. (equals frame lines 313-336 for 625 line video
  1000. standards, 263-286 for 525 line standards) */
  1001. __u16 service_lines[2][24];
  1002. __u32 io_size;
  1003. __u32 reserved[2]; /* must be zero */
  1004. };
  1005. /* Teletext World System Teletext
  1006. (WST), defined on ITU-R BT.653-2 */
  1007. #define V4L2_SLICED_TELETEXT_B (0x0001)
  1008. /* Video Program System, defined on ETS 300 231*/
  1009. #define V4L2_SLICED_VPS (0x0400)
  1010. /* Closed Caption, defined on EIA-608 */
  1011. #define V4L2_SLICED_CAPTION_525 (0x1000)
  1012. /* Wide Screen System, defined on ITU-R BT1119.1 */
  1013. #define V4L2_SLICED_WSS_625 (0x4000)
  1014. #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525)
  1015. #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
  1016. struct v4l2_sliced_vbi_cap
  1017. {
  1018. __u16 service_set;
  1019. /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
  1020. service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
  1021. (equals frame lines 313-336 for 625 line video
  1022. standards, 263-286 for 525 line standards) */
  1023. __u16 service_lines[2][24];
  1024. __u32 reserved[4]; /* must be 0 */
  1025. };
  1026. struct v4l2_sliced_vbi_data
  1027. {
  1028. __u32 id;
  1029. __u32 field; /* 0: first field, 1: second field */
  1030. __u32 line; /* 1-23 */
  1031. __u32 reserved; /* must be 0 */
  1032. __u8 data[48];
  1033. };
  1034. #endif
  1035. /*
  1036. * A G G R E G A T E S T R U C T U R E S
  1037. */
  1038. /* Stream data format
  1039. */
  1040. struct v4l2_format
  1041. {
  1042. enum v4l2_buf_type type;
  1043. union
  1044. {
  1045. struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE
  1046. struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY
  1047. struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE
  1048. #if 1
  1049. struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE
  1050. #endif
  1051. __u8 raw_data[200]; // user-defined
  1052. } fmt;
  1053. };
  1054. /* Stream type-dependent parameters
  1055. */
  1056. struct v4l2_streamparm
  1057. {
  1058. enum v4l2_buf_type type;
  1059. union
  1060. {
  1061. struct v4l2_captureparm capture;
  1062. struct v4l2_outputparm output;
  1063. __u8 raw_data[200]; /* user-defined */
  1064. } parm;
  1065. };
  1066. /*
  1067. * 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
  1068. *
  1069. */
  1070. #define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability)
  1071. #define VIDIOC_RESERVED _IO ('V', 1)
  1072. #define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
  1073. #define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
  1074. #define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
  1075. #ifdef __KERNEL__
  1076. #define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression)
  1077. #define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression)
  1078. #endif
  1079. #define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
  1080. #define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
  1081. #define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
  1082. #define VIDIOC_S_FBUF _IOW ('V', 11, struct v4l2_framebuffer)
  1083. #define VIDIOC_OVERLAY _IOW ('V', 14, int)
  1084. #define VIDIOC_QBUF _IOWR ('V', 15, struct v4l2_buffer)
  1085. #define VIDIOC_DQBUF _IOWR ('V', 17, struct v4l2_buffer)
  1086. #define VIDIOC_STREAMON _IOW ('V', 18, int)
  1087. #define VIDIOC_STREAMOFF _IOW ('V', 19, int)
  1088. #define VIDIOC_G_PARM _IOWR ('V', 21, struct v4l2_streamparm)
  1089. #define VIDIOC_S_PARM _IOWR ('V', 22, struct v4l2_streamparm)
  1090. #define VIDIOC_G_STD _IOR ('V', 23, v4l2_std_id)
  1091. #define VIDIOC_S_STD _IOW ('V', 24, v4l2_std_id)
  1092. #define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_standard)
  1093. #define VIDIOC_ENUMINPUT _IOWR ('V', 26, struct v4l2_input)
  1094. #define VIDIOC_G_CTRL _IOWR ('V', 27, struct v4l2_control)
  1095. #define VIDIOC_S_CTRL _IOWR ('V', 28, struct v4l2_control)
  1096. #define VIDIOC_G_TUNER _IOWR ('V', 29, struct v4l2_tuner)
  1097. #define VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner)
  1098. #define VIDIOC_G_AUDIO _IOR ('V', 33, struct v4l2_audio)
  1099. #define VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio)
  1100. #define VIDIOC_QUERYCTRL _IOWR ('V', 36, struct v4l2_queryctrl)
  1101. #define VIDIOC_QUERYMENU _IOWR ('V', 37, struct v4l2_querymenu)
  1102. #define VIDIOC_G_INPUT _IOR ('V', 38, int)
  1103. #define VIDIOC_S_INPUT _IOWR ('V', 39, int)
  1104. #define VIDIOC_G_OUTPUT _IOR ('V', 46, int)
  1105. #define VIDIOC_S_OUTPUT _IOWR ('V', 47, int)
  1106. #define VIDIOC_ENUMOUTPUT _IOWR ('V', 48, struct v4l2_output)
  1107. #define VIDIOC_G_AUDOUT _IOR ('V', 49, struct v4l2_audioout)
  1108. #define VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout)
  1109. #define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator)
  1110. #define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator)
  1111. #define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency)
  1112. #define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency)
  1113. #define VIDIOC_CROPCAP _IOWR ('V', 58, struct v4l2_cropcap)
  1114. #define VIDIOC_G_CROP _IOWR ('V', 59, struct v4l2_crop)
  1115. #define VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop)
  1116. #define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression)
  1117. #define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression)
  1118. #define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id)
  1119. #define VIDIOC_TRY_FMT _IOWR ('V', 64, struct v4l2_format)
  1120. #define VIDIOC_ENUMAUDIO _IOWR ('V', 65, struct v4l2_audio)
  1121. #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout)
  1122. #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority)
  1123. #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority)
  1124. #if 1
  1125. #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap)
  1126. #endif
  1127. #define VIDIOC_LOG_STATUS _IO ('V', 70)
  1128. #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls)
  1129. #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls)
  1130. #define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls)
  1131. #ifdef __OLD_VIDIOC_
  1132. /* for compatibility, will go away some day */
  1133. #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int)
  1134. #define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm)
  1135. #define VIDIOC_S_CTRL_OLD _IOW ('V', 28, struct v4l2_control)
  1136. #define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio)
  1137. #define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout)
  1138. #define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap)
  1139. #endif
  1140. #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
  1141. #endif /* __LINUX_VIDEODEV2_H */
  1142. /*
  1143. * Local variables:
  1144. * c-basic-offset: 8
  1145. * End:
  1146. */