videodev2.h 33 KB

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