videodev2.h 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040
  1. #ifndef __LINUX_VIDEODEV2_H
  2. #define __LINUX_VIDEODEV2_H
  3. /*
  4. * Video for Linux Two
  5. *
  6. * Header file for v4l or V4L2 drivers and applications, for
  7. * Linux kernels 2.2.x or 2.4.x.
  8. *
  9. * See http://bytesex.org/v4l/ for API specs and other
  10. * v4l2 documentation.
  11. *
  12. * Author: Bill Dirks <bdirks@pacbell.net>
  13. * Justin Schoeman
  14. * et al.
  15. */
  16. #ifdef __KERNEL__
  17. #include <linux/time.h> /* need struct timeval */
  18. #endif
  19. #include <linux/compiler.h> /* need __user */
  20. /*
  21. * M I S C E L L A N E O U S
  22. */
  23. /* Four-character-code (FOURCC) */
  24. #define v4l2_fourcc(a,b,c,d)\
  25. (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
  26. /*
  27. * E N U M S
  28. */
  29. enum v4l2_field {
  30. V4L2_FIELD_ANY = 0, /* driver can choose from none,
  31. top, bottom, interlaced
  32. depending on whatever it thinks
  33. is approximate ... */
  34. V4L2_FIELD_NONE = 1, /* this device has no fields ... */
  35. V4L2_FIELD_TOP = 2, /* top field only */
  36. V4L2_FIELD_BOTTOM = 3, /* bottom field only */
  37. V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */
  38. V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one
  39. buffer, top-bottom order */
  40. V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */
  41. V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into
  42. separate buffers */
  43. };
  44. #define V4L2_FIELD_HAS_TOP(field) \
  45. ((field) == V4L2_FIELD_TOP ||\
  46. (field) == V4L2_FIELD_INTERLACED ||\
  47. (field) == V4L2_FIELD_SEQ_TB ||\
  48. (field) == V4L2_FIELD_SEQ_BT)
  49. #define V4L2_FIELD_HAS_BOTTOM(field) \
  50. ((field) == V4L2_FIELD_BOTTOM ||\
  51. (field) == V4L2_FIELD_INTERLACED ||\
  52. (field) == V4L2_FIELD_SEQ_TB ||\
  53. (field) == V4L2_FIELD_SEQ_BT)
  54. #define V4L2_FIELD_HAS_BOTH(field) \
  55. ((field) == V4L2_FIELD_INTERLACED ||\
  56. (field) == V4L2_FIELD_SEQ_TB ||\
  57. (field) == V4L2_FIELD_SEQ_BT)
  58. enum v4l2_buf_type {
  59. V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
  60. V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
  61. V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
  62. V4L2_BUF_TYPE_VBI_CAPTURE = 4,
  63. V4L2_BUF_TYPE_VBI_OUTPUT = 5,
  64. #if 1
  65. /* Experimental Sliced VBI */
  66. V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
  67. V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
  68. #endif
  69. V4L2_BUF_TYPE_PRIVATE = 0x80,
  70. };
  71. enum v4l2_ctrl_type {
  72. V4L2_CTRL_TYPE_INTEGER = 1,
  73. V4L2_CTRL_TYPE_BOOLEAN = 2,
  74. V4L2_CTRL_TYPE_MENU = 3,
  75. V4L2_CTRL_TYPE_BUTTON = 4,
  76. };
  77. enum v4l2_tuner_type {
  78. V4L2_TUNER_RADIO = 1,
  79. V4L2_TUNER_ANALOG_TV = 2,
  80. V4L2_TUNER_DIGITAL_TV = 3,
  81. };
  82. enum v4l2_memory {
  83. V4L2_MEMORY_MMAP = 1,
  84. V4L2_MEMORY_USERPTR = 2,
  85. V4L2_MEMORY_OVERLAY = 3,
  86. };
  87. /* see also http://vektor.theorem.ca/graphics/ycbcr/ */
  88. enum v4l2_colorspace {
  89. /* ITU-R 601 -- broadcast NTSC/PAL */
  90. V4L2_COLORSPACE_SMPTE170M = 1,
  91. /* 1125-Line (US) HDTV */
  92. V4L2_COLORSPACE_SMPTE240M = 2,
  93. /* HD and modern captures. */
  94. V4L2_COLORSPACE_REC709 = 3,
  95. /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
  96. V4L2_COLORSPACE_BT878 = 4,
  97. /* These should be useful. Assume 601 extents. */
  98. V4L2_COLORSPACE_470_SYSTEM_M = 5,
  99. V4L2_COLORSPACE_470_SYSTEM_BG = 6,
  100. /* I know there will be cameras that send this. So, this is
  101. * unspecified chromaticities and full 0-255 on each of the
  102. * Y'CbCr components
  103. */
  104. V4L2_COLORSPACE_JPEG = 7,
  105. /* For RGB colourspaces, this is probably a good start. */
  106. V4L2_COLORSPACE_SRGB = 8,
  107. };
  108. enum v4l2_priority {
  109. V4L2_PRIORITY_UNSET = 0, /* not initialized */
  110. V4L2_PRIORITY_BACKGROUND = 1,
  111. V4L2_PRIORITY_INTERACTIVE = 2,
  112. V4L2_PRIORITY_RECORD = 3,
  113. V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE,
  114. };
  115. struct v4l2_rect {
  116. __s32 left;
  117. __s32 top;
  118. __s32 width;
  119. __s32 height;
  120. };
  121. struct v4l2_fract {
  122. __u32 numerator;
  123. __u32 denominator;
  124. };
  125. /*
  126. * D R I V E R C A P A B I L I T I E S
  127. */
  128. struct v4l2_capability
  129. {
  130. __u8 driver[16]; /* i.e. "bttv" */
  131. __u8 card[32]; /* i.e. "Hauppauge WinTV" */
  132. __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */
  133. __u32 version; /* should use KERNEL_VERSION() */
  134. __u32 capabilities; /* Device capabilities */
  135. __u32 reserved[4];
  136. };
  137. /* Values for 'capabilities' field */
  138. #define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
  139. #define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
  140. #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
  141. #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */
  142. #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */
  143. #if 1
  144. #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */
  145. #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
  146. #endif
  147. #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
  148. #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
  149. #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
  150. #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
  151. #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
  152. #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
  153. #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
  154. /*
  155. * V I D E O I M A G E F O R M A T
  156. */
  157. struct v4l2_pix_format
  158. {
  159. __u32 width;
  160. __u32 height;
  161. __u32 pixelformat;
  162. enum v4l2_field field;
  163. __u32 bytesperline; /* for padding, zero if unused */
  164. __u32 sizeimage;
  165. enum v4l2_colorspace colorspace;
  166. __u32 priv; /* private data, depends on pixelformat */
  167. };
  168. /* Pixel format FOURCC depth Description */
  169. #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */
  170. #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */
  171. #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */
  172. #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R','G','B','Q') /* 16 RGB-5-5-5 BE */
  173. #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R','G','B','R') /* 16 RGB-5-6-5 BE */
  174. #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B','G','R','3') /* 24 BGR-8-8-8 */
  175. #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R','G','B','3') /* 24 RGB-8-8-8 */
  176. #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */
  177. #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */
  178. #define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y') /* 8 Greyscale */
  179. #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */
  180. #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */
  181. #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y','U','Y','V') /* 16 YUV 4:2:2 */
  182. #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U','Y','V','Y') /* 16 YUV 4:2:2 */
  183. #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */
  184. #define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */
  185. #define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */
  186. /* two planes -- one Y, one Cr + Cb interleaved */
  187. #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2') /* 12 Y/CbCr 4:2:0 */
  188. #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1') /* 12 Y/CrCb 4:2:0 */
  189. /* The following formats are not defined in the V4L2 specification */
  190. #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y','U','V','9') /* 9 YUV 4:1:0 */
  191. #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */
  192. #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */
  193. #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */
  194. /* see http://www.siliconimaging.com/RGB%20Bayer.htm */
  195. #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */
  196. /* compressed formats */
  197. #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */
  198. #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */
  199. #define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */
  200. #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG */
  201. /* Vendor-specific formats */
  202. #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */
  203. #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */
  204. #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */
  205. #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */
  206. /*
  207. * F O R M A T E N U M E R A T I O N
  208. */
  209. struct v4l2_fmtdesc
  210. {
  211. __u32 index; /* Format number */
  212. enum v4l2_buf_type type; /* buffer type */
  213. __u32 flags;
  214. __u8 description[32]; /* Description string */
  215. __u32 pixelformat; /* Format fourcc */
  216. __u32 reserved[4];
  217. };
  218. #define V4L2_FMT_FLAG_COMPRESSED 0x0001
  219. /*
  220. * T I M E C O D E
  221. */
  222. struct v4l2_timecode
  223. {
  224. __u32 type;
  225. __u32 flags;
  226. __u8 frames;
  227. __u8 seconds;
  228. __u8 minutes;
  229. __u8 hours;
  230. __u8 userbits[4];
  231. };
  232. /* Type */
  233. #define V4L2_TC_TYPE_24FPS 1
  234. #define V4L2_TC_TYPE_25FPS 2
  235. #define V4L2_TC_TYPE_30FPS 3
  236. #define V4L2_TC_TYPE_50FPS 4
  237. #define V4L2_TC_TYPE_60FPS 5
  238. /* Flags */
  239. #define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */
  240. #define V4L2_TC_FLAG_COLORFRAME 0x0002
  241. #define V4L2_TC_USERBITS_field 0x000C
  242. #define V4L2_TC_USERBITS_USERDEFINED 0x0000
  243. #define V4L2_TC_USERBITS_8BITCHARS 0x0008
  244. /* The above is based on SMPTE timecodes */
  245. /*
  246. * 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
  247. *
  248. * ### WARNING: this is still work-in-progress right now, most likely
  249. * ### there will be some incompatible changes.
  250. *
  251. */
  252. enum v4l2_bitrate_mode {
  253. V4L2_BITRATE_NONE = 0, /* not specified */
  254. V4L2_BITRATE_CBR, /* constant bitrate */
  255. V4L2_BITRATE_VBR, /* variable bitrate */
  256. };
  257. struct v4l2_bitrate {
  258. /* rates are specified in kbit/sec */
  259. enum v4l2_bitrate_mode mode;
  260. __u32 min;
  261. __u32 target; /* use this one for CBR */
  262. __u32 max;
  263. };
  264. enum v4l2_mpeg_streamtype {
  265. V4L2_MPEG_SS_1, /* MPEG-1 system stream */
  266. V4L2_MPEG_PS_2, /* MPEG-2 program stream */
  267. V4L2_MPEG_TS_2, /* MPEG-2 transport stream */
  268. V4L2_MPEG_PS_DVD, /* MPEG-2 program stream with DVD header fixups */
  269. };
  270. enum v4l2_mpeg_audiotype {
  271. V4L2_MPEG_AU_2_I, /* MPEG-2 layer 1 */
  272. V4L2_MPEG_AU_2_II, /* MPEG-2 layer 2 */
  273. V4L2_MPEG_AU_2_III, /* MPEG-2 layer 3 */
  274. V4L2_MPEG_AC3, /* AC3 */
  275. V4L2_MPEG_LPCM, /* LPCM */
  276. };
  277. enum v4l2_mpeg_videotype {
  278. V4L2_MPEG_VI_1, /* MPEG-1 */
  279. V4L2_MPEG_VI_2, /* MPEG-2 */
  280. };
  281. enum v4l2_mpeg_aspectratio {
  282. V4L2_MPEG_ASPECT_SQUARE = 1, /* square pixel */
  283. V4L2_MPEG_ASPECT_4_3 = 2, /* 4 : 3 */
  284. V4L2_MPEG_ASPECT_16_9 = 3, /* 16 : 9 */
  285. V4L2_MPEG_ASPECT_1_221 = 4, /* 1 : 2,21 */
  286. };
  287. struct v4l2_mpeg_compression {
  288. /* general */
  289. enum v4l2_mpeg_streamtype st_type;
  290. struct v4l2_bitrate st_bitrate;
  291. /* transport streams */
  292. __u16 ts_pid_pmt;
  293. __u16 ts_pid_audio;
  294. __u16 ts_pid_video;
  295. __u16 ts_pid_pcr;
  296. /* program stream */
  297. __u16 ps_size;
  298. __u16 reserved_1; /* align */
  299. /* audio */
  300. enum v4l2_mpeg_audiotype au_type;
  301. struct v4l2_bitrate au_bitrate;
  302. __u32 au_sample_rate;
  303. __u8 au_pesid;
  304. __u8 reserved_2[3]; /* align */
  305. /* video */
  306. enum v4l2_mpeg_videotype vi_type;
  307. enum v4l2_mpeg_aspectratio vi_aspect_ratio;
  308. struct v4l2_bitrate vi_bitrate;
  309. __u32 vi_frame_rate;
  310. __u16 vi_frames_per_gop;
  311. __u16 vi_bframes_count;
  312. __u8 vi_pesid;
  313. __u8 reserved_3[3]; /* align */
  314. /* misc flags */
  315. __u32 closed_gops:1;
  316. __u32 pulldown:1;
  317. __u32 reserved_4:30; /* align */
  318. /* I don't expect the above being perfect yet ;) */
  319. __u32 reserved_5[8];
  320. };
  321. struct v4l2_jpegcompression
  322. {
  323. int quality;
  324. int APPn; /* Number of APP segment to be written,
  325. * must be 0..15 */
  326. int APP_len; /* Length of data in JPEG APPn segment */
  327. char APP_data[60]; /* Data in the JPEG APPn segment. */
  328. int COM_len; /* Length of data in JPEG COM segment */
  329. char COM_data[60]; /* Data in JPEG COM segment */
  330. __u32 jpeg_markers; /* Which markers should go into the JPEG
  331. * output. Unless you exactly know what
  332. * you do, leave them untouched.
  333. * Inluding less markers will make the
  334. * resulting code smaller, but there will
  335. * be fewer aplications which can read it.
  336. * The presence of the APP and COM marker
  337. * is influenced by APP_len and COM_len
  338. * ONLY, not by this property! */
  339. #define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
  340. #define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
  341. #define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
  342. #define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
  343. #define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
  344. * allways use APP0 */
  345. };
  346. /*
  347. * M E M O R Y - M A P P I N G B U F F E R S
  348. */
  349. struct v4l2_requestbuffers
  350. {
  351. __u32 count;
  352. enum v4l2_buf_type type;
  353. enum v4l2_memory memory;
  354. __u32 reserved[2];
  355. };
  356. struct v4l2_buffer
  357. {
  358. __u32 index;
  359. enum v4l2_buf_type type;
  360. __u32 bytesused;
  361. __u32 flags;
  362. enum v4l2_field field;
  363. struct timeval timestamp;
  364. struct v4l2_timecode timecode;
  365. __u32 sequence;
  366. /* memory location */
  367. enum v4l2_memory memory;
  368. union {
  369. __u32 offset;
  370. unsigned long userptr;
  371. } m;
  372. __u32 length;
  373. __u32 input;
  374. __u32 reserved;
  375. };
  376. /* Flags for 'flags' field */
  377. #define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */
  378. #define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */
  379. #define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */
  380. #define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
  381. #define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
  382. #define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
  383. #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
  384. #define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
  385. /*
  386. * O V E R L A Y P R E V I E W
  387. */
  388. struct v4l2_framebuffer
  389. {
  390. __u32 capability;
  391. __u32 flags;
  392. /* FIXME: in theory we should pass something like PCI device + memory
  393. * region + offset instead of some physical address */
  394. void* base;
  395. struct v4l2_pix_format fmt;
  396. };
  397. /* Flags for the 'capability' field. Read only */
  398. #define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
  399. #define V4L2_FBUF_CAP_CHROMAKEY 0x0002
  400. #define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
  401. #define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
  402. /* Flags for the 'flags' field. */
  403. #define V4L2_FBUF_FLAG_PRIMARY 0x0001
  404. #define V4L2_FBUF_FLAG_OVERLAY 0x0002
  405. #define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
  406. struct v4l2_clip
  407. {
  408. struct v4l2_rect c;
  409. struct v4l2_clip *next;
  410. };
  411. struct v4l2_window
  412. {
  413. struct v4l2_rect w;
  414. enum v4l2_field field;
  415. __u32 chromakey;
  416. struct v4l2_clip __user *clips;
  417. __u32 clipcount;
  418. void __user *bitmap;
  419. };
  420. /*
  421. * C A P T U R E P A R A M E T E R S
  422. */
  423. struct v4l2_captureparm
  424. {
  425. __u32 capability; /* Supported modes */
  426. __u32 capturemode; /* Current mode */
  427. struct v4l2_fract timeperframe; /* Time per frame in .1us units */
  428. __u32 extendedmode; /* Driver-specific extensions */
  429. __u32 readbuffers; /* # of buffers for read */
  430. __u32 reserved[4];
  431. };
  432. /* Flags for 'capability' and 'capturemode' fields */
  433. #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
  434. #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
  435. struct v4l2_outputparm
  436. {
  437. __u32 capability; /* Supported modes */
  438. __u32 outputmode; /* Current mode */
  439. struct v4l2_fract timeperframe; /* Time per frame in seconds */
  440. __u32 extendedmode; /* Driver-specific extensions */
  441. __u32 writebuffers; /* # of buffers for write */
  442. __u32 reserved[4];
  443. };
  444. /*
  445. * I N P U T I M A G E C R O P P I N G
  446. */
  447. struct v4l2_cropcap {
  448. enum v4l2_buf_type type;
  449. struct v4l2_rect bounds;
  450. struct v4l2_rect defrect;
  451. struct v4l2_fract pixelaspect;
  452. };
  453. struct v4l2_crop {
  454. enum v4l2_buf_type type;
  455. struct v4l2_rect c;
  456. };
  457. /*
  458. * A N A L O G V I D E O S T A N D A R D
  459. */
  460. typedef __u64 v4l2_std_id;
  461. /* one bit for each */
  462. #define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
  463. #define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
  464. #define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
  465. #define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
  466. #define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
  467. #define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
  468. #define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
  469. #define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
  470. #define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
  471. #define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
  472. #define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
  473. #define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
  474. #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
  475. #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
  476. #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
  477. #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
  478. #define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
  479. #define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
  480. #define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
  481. #define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
  482. #define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
  483. /* ATSC/HDTV */
  484. #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
  485. #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
  486. /* some common needed stuff */
  487. #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
  488. V4L2_STD_PAL_B1 |\
  489. V4L2_STD_PAL_G)
  490. #define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
  491. V4L2_STD_PAL_D1 |\
  492. V4L2_STD_PAL_K)
  493. #define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
  494. V4L2_STD_PAL_DK |\
  495. V4L2_STD_PAL_H |\
  496. V4L2_STD_PAL_I)
  497. #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
  498. V4L2_STD_NTSC_M_JP)
  499. #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
  500. V4L2_STD_SECAM_K |\
  501. V4L2_STD_SECAM_K1)
  502. #define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
  503. V4L2_STD_SECAM_G |\
  504. V4L2_STD_SECAM_H |\
  505. V4L2_STD_SECAM_DK |\
  506. V4L2_STD_SECAM_L)
  507. #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
  508. V4L2_STD_PAL_60 |\
  509. V4L2_STD_NTSC)
  510. #define V4L2_STD_625_50 (V4L2_STD_PAL |\
  511. V4L2_STD_PAL_N |\
  512. V4L2_STD_PAL_Nc |\
  513. V4L2_STD_SECAM)
  514. #define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\
  515. V4L2_STD_ATSC_16_VSB)
  516. #define V4L2_STD_UNKNOWN 0
  517. #define V4L2_STD_ALL (V4L2_STD_525_60 |\
  518. V4L2_STD_625_50)
  519. struct v4l2_standard
  520. {
  521. __u32 index;
  522. v4l2_std_id id;
  523. __u8 name[24];
  524. struct v4l2_fract frameperiod; /* Frames, not fields */
  525. __u32 framelines;
  526. __u32 reserved[4];
  527. };
  528. /*
  529. * V I D E O I N P U T S
  530. */
  531. struct v4l2_input
  532. {
  533. __u32 index; /* Which input */
  534. __u8 name[32]; /* Label */
  535. __u32 type; /* Type of input */
  536. __u32 audioset; /* Associated audios (bitfield) */
  537. __u32 tuner; /* Associated tuner */
  538. v4l2_std_id std;
  539. __u32 status;
  540. __u32 reserved[4];
  541. };
  542. /* Values for the 'type' field */
  543. #define V4L2_INPUT_TYPE_TUNER 1
  544. #define V4L2_INPUT_TYPE_CAMERA 2
  545. /* field 'status' - general */
  546. #define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */
  547. #define V4L2_IN_ST_NO_SIGNAL 0x00000002
  548. #define V4L2_IN_ST_NO_COLOR 0x00000004
  549. /* field 'status' - analog */
  550. #define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */
  551. #define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
  552. /* field 'status' - digital */
  553. #define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */
  554. #define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */
  555. #define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */
  556. /* field 'status' - VCR and set-top box */
  557. #define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */
  558. #define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
  559. #define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
  560. /*
  561. * V I D E O O U T P U T S
  562. */
  563. struct v4l2_output
  564. {
  565. __u32 index; /* Which output */
  566. __u8 name[32]; /* Label */
  567. __u32 type; /* Type of output */
  568. __u32 audioset; /* Associated audios (bitfield) */
  569. __u32 modulator; /* Associated modulator */
  570. v4l2_std_id std;
  571. __u32 reserved[4];
  572. };
  573. /* Values for the 'type' field */
  574. #define V4L2_OUTPUT_TYPE_MODULATOR 1
  575. #define V4L2_OUTPUT_TYPE_ANALOG 2
  576. #define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
  577. /*
  578. * C O N T R O L S
  579. */
  580. struct v4l2_control
  581. {
  582. __u32 id;
  583. __s32 value;
  584. };
  585. /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
  586. struct v4l2_queryctrl
  587. {
  588. __u32 id;
  589. enum v4l2_ctrl_type type;
  590. __u8 name[32]; /* Whatever */
  591. __s32 minimum; /* Note signedness */
  592. __s32 maximum;
  593. __s32 step;
  594. __s32 default_value;
  595. __u32 flags;
  596. __u32 reserved[2];
  597. };
  598. /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
  599. struct v4l2_querymenu
  600. {
  601. __u32 id;
  602. __u32 index;
  603. __u8 name[32]; /* Whatever */
  604. __u32 reserved;
  605. };
  606. /* Control flags */
  607. #define V4L2_CTRL_FLAG_DISABLED 0x0001
  608. #define V4L2_CTRL_FLAG_GRABBED 0x0002
  609. /* Control IDs defined by V4L2 */
  610. #define V4L2_CID_BASE 0x00980900
  611. /* IDs reserved for driver specific controls */
  612. #define V4L2_CID_PRIVATE_BASE 0x08000000
  613. #define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
  614. #define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
  615. #define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
  616. #define V4L2_CID_HUE (V4L2_CID_BASE+3)
  617. #define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
  618. #define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
  619. #define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
  620. #define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
  621. #define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
  622. #define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
  623. #define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11)
  624. #define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
  625. #define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
  626. #define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
  627. #define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
  628. #define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
  629. #define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* ? Not sure */
  630. #define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
  631. #define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
  632. #define V4L2_CID_GAIN (V4L2_CID_BASE+19)
  633. #define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
  634. #define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
  635. #define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
  636. #define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
  637. #define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */
  638. /*
  639. * T U N I N G
  640. */
  641. struct v4l2_tuner
  642. {
  643. __u32 index;
  644. __u8 name[32];
  645. enum v4l2_tuner_type type;
  646. __u32 capability;
  647. __u32 rangelow;
  648. __u32 rangehigh;
  649. __u32 rxsubchans;
  650. __u32 audmode;
  651. __s32 signal;
  652. __s32 afc;
  653. __u32 reserved[4];
  654. };
  655. struct v4l2_modulator
  656. {
  657. __u32 index;
  658. __u8 name[32];
  659. __u32 capability;
  660. __u32 rangelow;
  661. __u32 rangehigh;
  662. __u32 txsubchans;
  663. __u32 reserved[4];
  664. };
  665. /* Flags for the 'capability' field */
  666. #define V4L2_TUNER_CAP_LOW 0x0001
  667. #define V4L2_TUNER_CAP_NORM 0x0002
  668. #define V4L2_TUNER_CAP_STEREO 0x0010
  669. #define V4L2_TUNER_CAP_LANG2 0x0020
  670. #define V4L2_TUNER_CAP_SAP 0x0020
  671. #define V4L2_TUNER_CAP_LANG1 0x0040
  672. /* Flags for the 'rxsubchans' field */
  673. #define V4L2_TUNER_SUB_MONO 0x0001
  674. #define V4L2_TUNER_SUB_STEREO 0x0002
  675. #define V4L2_TUNER_SUB_LANG2 0x0004
  676. #define V4L2_TUNER_SUB_SAP 0x0004
  677. #define V4L2_TUNER_SUB_LANG1 0x0008
  678. /* Values for the 'audmode' field */
  679. #define V4L2_TUNER_MODE_MONO 0x0000
  680. #define V4L2_TUNER_MODE_STEREO 0x0001
  681. #define V4L2_TUNER_MODE_LANG2 0x0002
  682. #define V4L2_TUNER_MODE_SAP 0x0002
  683. #define V4L2_TUNER_MODE_LANG1 0x0003
  684. struct v4l2_frequency
  685. {
  686. __u32 tuner;
  687. enum v4l2_tuner_type type;
  688. __u32 frequency;
  689. __u32 reserved[8];
  690. };
  691. /*
  692. * A U D I O
  693. */
  694. struct v4l2_audio
  695. {
  696. __u32 index;
  697. __u8 name[32];
  698. __u32 capability;
  699. __u32 mode;
  700. __u32 reserved[2];
  701. };
  702. /* Flags for the 'capability' field */
  703. #define V4L2_AUDCAP_STEREO 0x00001
  704. #define V4L2_AUDCAP_AVL 0x00002
  705. /* Flags for the 'mode' field */
  706. #define V4L2_AUDMODE_AVL 0x00001
  707. struct v4l2_audioout
  708. {
  709. __u32 index;
  710. __u8 name[32];
  711. __u32 capability;
  712. __u32 mode;
  713. __u32 reserved[2];
  714. };
  715. /*
  716. * D A T A S E R V I C E S ( V B I )
  717. *
  718. * Data services API by Michael Schimek
  719. */
  720. /* Raw VBI */
  721. struct v4l2_vbi_format
  722. {
  723. __u32 sampling_rate; /* in 1 Hz */
  724. __u32 offset;
  725. __u32 samples_per_line;
  726. __u32 sample_format; /* V4L2_PIX_FMT_* */
  727. __s32 start[2];
  728. __u32 count[2];
  729. __u32 flags; /* V4L2_VBI_* */
  730. __u32 reserved[2]; /* must be zero */
  731. };
  732. /* VBI flags */
  733. #define V4L2_VBI_UNSYNC (1<< 0)
  734. #define V4L2_VBI_INTERLACED (1<< 1)
  735. #if 1
  736. /* Sliced VBI
  737. *
  738. * This implements is a proposal V4L2 API to allow SLICED VBI
  739. * required for some hardware encoders. It should change without
  740. * notice in the definitive implementation.
  741. */
  742. struct v4l2_sliced_vbi_format
  743. {
  744. __u16 service_set;
  745. /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
  746. service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
  747. (equals frame lines 313-336 for 625 line video
  748. standards, 263-286 for 525 line standards) */
  749. __u16 service_lines[2][24];
  750. __u32 io_size;
  751. __u32 reserved[2]; /* must be zero */
  752. };
  753. #define V4L2_SLICED_TELETEXT_B (0x0001)
  754. #define V4L2_SLICED_VPS (0x0400)
  755. #define V4L2_SLICED_CAPTION_525 (0x1000)
  756. #define V4L2_SLICED_WSS_625 (0x4000)
  757. #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525)
  758. #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
  759. struct v4l2_sliced_vbi_cap
  760. {
  761. __u16 service_set;
  762. /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
  763. service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
  764. (equals frame lines 313-336 for 625 line video
  765. standards, 263-286 for 525 line standards) */
  766. __u16 service_lines[2][24];
  767. __u32 reserved[4]; /* must be 0 */
  768. };
  769. struct v4l2_sliced_vbi_data
  770. {
  771. __u32 id;
  772. __u32 field; /* 0: first field, 1: second field */
  773. __u32 line; /* 1-23 */
  774. __u32 reserved; /* must be 0 */
  775. __u8 data[48];
  776. };
  777. #endif
  778. /*
  779. * A G G R E G A T E S T R U C T U R E S
  780. */
  781. /* Stream data format
  782. */
  783. struct v4l2_format
  784. {
  785. enum v4l2_buf_type type;
  786. union
  787. {
  788. struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE
  789. struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY
  790. struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE
  791. #if 1
  792. struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE
  793. #endif
  794. __u8 raw_data[200]; // user-defined
  795. } fmt;
  796. };
  797. /* Stream type-dependent parameters
  798. */
  799. struct v4l2_streamparm
  800. {
  801. enum v4l2_buf_type type;
  802. union
  803. {
  804. struct v4l2_captureparm capture;
  805. struct v4l2_outputparm output;
  806. __u8 raw_data[200]; /* user-defined */
  807. } parm;
  808. };
  809. /*
  810. * 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
  811. *
  812. */
  813. #define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability)
  814. #define VIDIOC_RESERVED _IO ('V', 1)
  815. #define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
  816. #define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
  817. #define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
  818. #define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression)
  819. #define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression)
  820. #define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
  821. #define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
  822. #define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
  823. #define VIDIOC_S_FBUF _IOW ('V', 11, struct v4l2_framebuffer)
  824. #define VIDIOC_OVERLAY _IOW ('V', 14, int)
  825. #define VIDIOC_QBUF _IOWR ('V', 15, struct v4l2_buffer)
  826. #define VIDIOC_DQBUF _IOWR ('V', 17, struct v4l2_buffer)
  827. #define VIDIOC_STREAMON _IOW ('V', 18, int)
  828. #define VIDIOC_STREAMOFF _IOW ('V', 19, int)
  829. #define VIDIOC_G_PARM _IOWR ('V', 21, struct v4l2_streamparm)
  830. #define VIDIOC_S_PARM _IOWR ('V', 22, struct v4l2_streamparm)
  831. #define VIDIOC_G_STD _IOR ('V', 23, v4l2_std_id)
  832. #define VIDIOC_S_STD _IOW ('V', 24, v4l2_std_id)
  833. #define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_standard)
  834. #define VIDIOC_ENUMINPUT _IOWR ('V', 26, struct v4l2_input)
  835. #define VIDIOC_G_CTRL _IOWR ('V', 27, struct v4l2_control)
  836. #define VIDIOC_S_CTRL _IOWR ('V', 28, struct v4l2_control)
  837. #define VIDIOC_G_TUNER _IOWR ('V', 29, struct v4l2_tuner)
  838. #define VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner)
  839. #define VIDIOC_G_AUDIO _IOR ('V', 33, struct v4l2_audio)
  840. #define VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio)
  841. #define VIDIOC_QUERYCTRL _IOWR ('V', 36, struct v4l2_queryctrl)
  842. #define VIDIOC_QUERYMENU _IOWR ('V', 37, struct v4l2_querymenu)
  843. #define VIDIOC_G_INPUT _IOR ('V', 38, int)
  844. #define VIDIOC_S_INPUT _IOWR ('V', 39, int)
  845. #define VIDIOC_G_OUTPUT _IOR ('V', 46, int)
  846. #define VIDIOC_S_OUTPUT _IOWR ('V', 47, int)
  847. #define VIDIOC_ENUMOUTPUT _IOWR ('V', 48, struct v4l2_output)
  848. #define VIDIOC_G_AUDOUT _IOR ('V', 49, struct v4l2_audioout)
  849. #define VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout)
  850. #define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator)
  851. #define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator)
  852. #define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency)
  853. #define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency)
  854. #define VIDIOC_CROPCAP _IOWR ('V', 58, struct v4l2_cropcap)
  855. #define VIDIOC_G_CROP _IOWR ('V', 59, struct v4l2_crop)
  856. #define VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop)
  857. #define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression)
  858. #define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression)
  859. #define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id)
  860. #define VIDIOC_TRY_FMT _IOWR ('V', 64, struct v4l2_format)
  861. #define VIDIOC_ENUMAUDIO _IOWR ('V', 65, struct v4l2_audio)
  862. #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout)
  863. #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority)
  864. #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority)
  865. #if 1
  866. #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap)
  867. #endif
  868. /* for compatibility, will go away some day */
  869. #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int)
  870. #define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm)
  871. #define VIDIOC_S_CTRL_OLD _IOW ('V', 28, struct v4l2_control)
  872. #define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio)
  873. #define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout)
  874. #define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap)
  875. #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
  876. #ifdef __KERNEL__
  877. /*
  878. *
  879. * V 4 L 2 D R I V E R H E L P E R A P I
  880. *
  881. * Some commonly needed functions for drivers (v4l2-common.o module)
  882. */
  883. #include <linux/fs.h>
  884. /* Video standard functions */
  885. extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
  886. extern int v4l2_video_std_construct(struct v4l2_standard *vs,
  887. int id, char *name);
  888. /* prority handling */
  889. struct v4l2_prio_state {
  890. atomic_t prios[4];
  891. };
  892. int v4l2_prio_init(struct v4l2_prio_state *global);
  893. int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
  894. enum v4l2_priority new);
  895. int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);
  896. int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local);
  897. enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
  898. int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local);
  899. /* names for fancy debug output */
  900. extern char *v4l2_field_names[];
  901. extern char *v4l2_type_names[];
  902. extern char *v4l2_ioctl_names[];
  903. /* Compatibility layer interface -- v4l1-compat module */
  904. typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
  905. unsigned int cmd, void *arg);
  906. int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
  907. int cmd, void *arg, v4l2_kioctl driver_ioctl);
  908. #endif /* __KERNEL__ */
  909. #endif /* __LINUX_VIDEODEV2_H */
  910. /*
  911. * Local variables:
  912. * c-basic-offset: 8
  913. * End:
  914. */