1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI__LINUX_VIDEODEV2_H
20 #define _UAPI__LINUX_VIDEODEV2_H
21 #include <sys/time.h>
22 #include <linux/compiler.h>
23 #include <linux/ioctl.h>
24 #include <linux/types.h>
25 #include <linux/v4l2-common.h>
26 #include <linux/v4l2-controls.h>
27 #define VIDEO_MAX_FRAME 64
28 #define VIDEO_MAX_PLANES 8
29 #define v4l2_fourcc(a,b,c,d) ((__u32) (a) | ((__u32) (b) << 8) | ((__u32) (c) << 16) | ((__u32) (d) << 24))
30 #define v4l2_fourcc_be(a,b,c,d) (v4l2_fourcc(a, b, c, d) | (1U << 31))
31 enum v4l2_field {
32   V4L2_FIELD_ANY = 0,
33   V4L2_FIELD_NONE = 1,
34   V4L2_FIELD_TOP = 2,
35   V4L2_FIELD_BOTTOM = 3,
36   V4L2_FIELD_INTERLACED = 4,
37   V4L2_FIELD_SEQ_TB = 5,
38   V4L2_FIELD_SEQ_BT = 6,
39   V4L2_FIELD_ALTERNATE = 7,
40   V4L2_FIELD_INTERLACED_TB = 8,
41   V4L2_FIELD_INTERLACED_BT = 9,
42 };
43 #define V4L2_FIELD_HAS_TOP(field) ((field) == V4L2_FIELD_TOP || (field) == V4L2_FIELD_INTERLACED || (field) == V4L2_FIELD_INTERLACED_TB || (field) == V4L2_FIELD_INTERLACED_BT || (field) == V4L2_FIELD_SEQ_TB || (field) == V4L2_FIELD_SEQ_BT)
44 #define V4L2_FIELD_HAS_BOTTOM(field) ((field) == V4L2_FIELD_BOTTOM || (field) == V4L2_FIELD_INTERLACED || (field) == V4L2_FIELD_INTERLACED_TB || (field) == V4L2_FIELD_INTERLACED_BT || (field) == V4L2_FIELD_SEQ_TB || (field) == V4L2_FIELD_SEQ_BT)
45 #define V4L2_FIELD_HAS_BOTH(field) ((field) == V4L2_FIELD_INTERLACED || (field) == V4L2_FIELD_INTERLACED_TB || (field) == V4L2_FIELD_INTERLACED_BT || (field) == V4L2_FIELD_SEQ_TB || (field) == V4L2_FIELD_SEQ_BT)
46 #define V4L2_FIELD_HAS_T_OR_B(field) ((field) == V4L2_FIELD_BOTTOM || (field) == V4L2_FIELD_TOP || (field) == V4L2_FIELD_ALTERNATE)
47 #define V4L2_FIELD_IS_INTERLACED(field) ((field) == V4L2_FIELD_INTERLACED || (field) == V4L2_FIELD_INTERLACED_TB || (field) == V4L2_FIELD_INTERLACED_BT)
48 #define V4L2_FIELD_IS_SEQUENTIAL(field) ((field) == V4L2_FIELD_SEQ_TB || (field) == V4L2_FIELD_SEQ_BT)
49 enum v4l2_buf_type {
50   V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
51   V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
52   V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
53   V4L2_BUF_TYPE_VBI_CAPTURE = 4,
54   V4L2_BUF_TYPE_VBI_OUTPUT = 5,
55   V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
56   V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
57   V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
58   V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
59   V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,
60   V4L2_BUF_TYPE_SDR_CAPTURE = 11,
61   V4L2_BUF_TYPE_SDR_OUTPUT = 12,
62   V4L2_BUF_TYPE_META_CAPTURE = 13,
63   V4L2_BUF_TYPE_META_OUTPUT = 14,
64   V4L2_BUF_TYPE_PRIVATE = 0x80,
65 };
66 #define V4L2_TYPE_IS_MULTIPLANAR(type) ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
67 #define V4L2_TYPE_IS_OUTPUT(type) ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY || (type) == V4L2_BUF_TYPE_VBI_OUTPUT || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT || (type) == V4L2_BUF_TYPE_SDR_OUTPUT || (type) == V4L2_BUF_TYPE_META_OUTPUT)
68 enum v4l2_tuner_type {
69   V4L2_TUNER_RADIO = 1,
70   V4L2_TUNER_ANALOG_TV = 2,
71   V4L2_TUNER_DIGITAL_TV = 3,
72   V4L2_TUNER_SDR = 4,
73   V4L2_TUNER_RF = 5,
74 };
75 #define V4L2_TUNER_ADC V4L2_TUNER_SDR
76 enum v4l2_memory {
77   V4L2_MEMORY_MMAP = 1,
78   V4L2_MEMORY_USERPTR = 2,
79   V4L2_MEMORY_OVERLAY = 3,
80   V4L2_MEMORY_DMABUF = 4,
81 };
82 enum v4l2_colorspace {
83   V4L2_COLORSPACE_DEFAULT = 0,
84   V4L2_COLORSPACE_SMPTE170M = 1,
85   V4L2_COLORSPACE_SMPTE240M = 2,
86   V4L2_COLORSPACE_REC709 = 3,
87   V4L2_COLORSPACE_BT878 = 4,
88   V4L2_COLORSPACE_470_SYSTEM_M = 5,
89   V4L2_COLORSPACE_470_SYSTEM_BG = 6,
90   V4L2_COLORSPACE_JPEG = 7,
91   V4L2_COLORSPACE_SRGB = 8,
92   V4L2_COLORSPACE_OPRGB = 9,
93   V4L2_COLORSPACE_BT2020 = 10,
94   V4L2_COLORSPACE_RAW = 11,
95   V4L2_COLORSPACE_DCI_P3 = 12,
96 };
97 #define V4L2_MAP_COLORSPACE_DEFAULT(is_sdtv,is_hdtv) ((is_sdtv) ? V4L2_COLORSPACE_SMPTE170M : ((is_hdtv) ? V4L2_COLORSPACE_REC709 : V4L2_COLORSPACE_SRGB))
98 enum v4l2_xfer_func {
99   V4L2_XFER_FUNC_DEFAULT = 0,
100   V4L2_XFER_FUNC_709 = 1,
101   V4L2_XFER_FUNC_SRGB = 2,
102   V4L2_XFER_FUNC_OPRGB = 3,
103   V4L2_XFER_FUNC_SMPTE240M = 4,
104   V4L2_XFER_FUNC_NONE = 5,
105   V4L2_XFER_FUNC_DCI_P3 = 6,
106   V4L2_XFER_FUNC_SMPTE2084 = 7,
107 };
108 #define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) ((colsp) == V4L2_COLORSPACE_OPRGB ? V4L2_XFER_FUNC_OPRGB : ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : ((colsp) == V4L2_COLORSPACE_DCI_P3 ? V4L2_XFER_FUNC_DCI_P3 : ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : ((colsp) == V4L2_COLORSPACE_SRGB || (colsp) == V4L2_COLORSPACE_JPEG ? V4L2_XFER_FUNC_SRGB : V4L2_XFER_FUNC_709)))))
109 enum v4l2_ycbcr_encoding {
110   V4L2_YCBCR_ENC_DEFAULT = 0,
111   V4L2_YCBCR_ENC_601 = 1,
112   V4L2_YCBCR_ENC_709 = 2,
113   V4L2_YCBCR_ENC_XV601 = 3,
114   V4L2_YCBCR_ENC_XV709 = 4,
115   V4L2_YCBCR_ENC_SYCC = 5,
116   V4L2_YCBCR_ENC_BT2020 = 6,
117   V4L2_YCBCR_ENC_BT2020_CONST_LUM = 7,
118   V4L2_YCBCR_ENC_SMPTE240M = 8,
119 };
120 enum v4l2_hsv_encoding {
121   V4L2_HSV_ENC_180 = 128,
122   V4L2_HSV_ENC_256 = 129,
123 };
124 #define V4L2_MAP_YCBCR_ENC_DEFAULT(colsp) (((colsp) == V4L2_COLORSPACE_REC709 || (colsp) == V4L2_COLORSPACE_DCI_P3) ? V4L2_YCBCR_ENC_709 : ((colsp) == V4L2_COLORSPACE_BT2020 ? V4L2_YCBCR_ENC_BT2020 : ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_YCBCR_ENC_SMPTE240M : V4L2_YCBCR_ENC_601)))
125 enum v4l2_quantization {
126   V4L2_QUANTIZATION_DEFAULT = 0,
127   V4L2_QUANTIZATION_FULL_RANGE = 1,
128   V4L2_QUANTIZATION_LIM_RANGE = 2,
129 };
130 #define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb_or_hsv,colsp,ycbcr_enc) (((is_rgb_or_hsv) && (colsp) == V4L2_COLORSPACE_BT2020) ? V4L2_QUANTIZATION_LIM_RANGE : (((is_rgb_or_hsv) || (colsp) == V4L2_COLORSPACE_JPEG) ? V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))
131 #define V4L2_COLORSPACE_ADOBERGB V4L2_COLORSPACE_OPRGB
132 #define V4L2_XFER_FUNC_ADOBERGB V4L2_XFER_FUNC_OPRGB
133 enum v4l2_priority {
134   V4L2_PRIORITY_UNSET = 0,
135   V4L2_PRIORITY_BACKGROUND = 1,
136   V4L2_PRIORITY_INTERACTIVE = 2,
137   V4L2_PRIORITY_RECORD = 3,
138   V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE,
139 };
140 struct v4l2_rect {
141   __s32 left;
142   __s32 top;
143   __u32 width;
144   __u32 height;
145 };
146 struct v4l2_fract {
147   __u32 numerator;
148   __u32 denominator;
149 };
150 struct v4l2_area {
151   __u32 width;
152   __u32 height;
153 };
154 struct v4l2_capability {
155   __u8 driver[16];
156   __u8 card[32];
157   __u8 bus_info[32];
158   __u32 version;
159   __u32 capabilities;
160   __u32 device_caps;
161   __u32 reserved[3];
162 };
163 #define V4L2_CAP_VIDEO_CAPTURE 0x00000001
164 #define V4L2_CAP_VIDEO_OUTPUT 0x00000002
165 #define V4L2_CAP_VIDEO_OVERLAY 0x00000004
166 #define V4L2_CAP_VBI_CAPTURE 0x00000010
167 #define V4L2_CAP_VBI_OUTPUT 0x00000020
168 #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040
169 #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080
170 #define V4L2_CAP_RDS_CAPTURE 0x00000100
171 #define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200
172 #define V4L2_CAP_HW_FREQ_SEEK 0x00000400
173 #define V4L2_CAP_RDS_OUTPUT 0x00000800
174 #define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
175 #define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
176 #define V4L2_CAP_VIDEO_M2M_MPLANE 0x00004000
177 #define V4L2_CAP_VIDEO_M2M 0x00008000
178 #define V4L2_CAP_TUNER 0x00010000
179 #define V4L2_CAP_AUDIO 0x00020000
180 #define V4L2_CAP_RADIO 0x00040000
181 #define V4L2_CAP_MODULATOR 0x00080000
182 #define V4L2_CAP_SDR_CAPTURE 0x00100000
183 #define V4L2_CAP_EXT_PIX_FORMAT 0x00200000
184 #define V4L2_CAP_SDR_OUTPUT 0x00400000
185 #define V4L2_CAP_META_CAPTURE 0x00800000
186 #define V4L2_CAP_READWRITE 0x01000000
187 #define V4L2_CAP_ASYNCIO 0x02000000
188 #define V4L2_CAP_STREAMING 0x04000000
189 #define V4L2_CAP_META_OUTPUT 0x08000000
190 #define V4L2_CAP_TOUCH 0x10000000
191 #define V4L2_CAP_DEVICE_CAPS 0x80000000
192 struct v4l2_pix_format {
193   __u32 width;
194   __u32 height;
195   __u32 pixelformat;
196   __u32 field;
197   __u32 bytesperline;
198   __u32 sizeimage;
199   __u32 colorspace;
200   __u32 priv;
201   __u32 flags;
202   union {
203     __u32 ycbcr_enc;
204     __u32 hsv_enc;
205   };
206   __u32 quantization;
207   __u32 xfer_func;
208 };
209 #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1')
210 #define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4')
211 #define V4L2_PIX_FMT_ARGB444 v4l2_fourcc('A', 'R', '1', '2')
212 #define V4L2_PIX_FMT_XRGB444 v4l2_fourcc('X', 'R', '1', '2')
213 #define V4L2_PIX_FMT_RGBA444 v4l2_fourcc('R', 'A', '1', '2')
214 #define V4L2_PIX_FMT_RGBX444 v4l2_fourcc('R', 'X', '1', '2')
215 #define V4L2_PIX_FMT_ABGR444 v4l2_fourcc('A', 'B', '1', '2')
216 #define V4L2_PIX_FMT_XBGR444 v4l2_fourcc('X', 'B', '1', '2')
217 #define V4L2_PIX_FMT_BGRA444 v4l2_fourcc('G', 'A', '1', '2')
218 #define V4L2_PIX_FMT_BGRX444 v4l2_fourcc('B', 'X', '1', '2')
219 #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O')
220 #define V4L2_PIX_FMT_ARGB555 v4l2_fourcc('A', 'R', '1', '5')
221 #define V4L2_PIX_FMT_XRGB555 v4l2_fourcc('X', 'R', '1', '5')
222 #define V4L2_PIX_FMT_RGBA555 v4l2_fourcc('R', 'A', '1', '5')
223 #define V4L2_PIX_FMT_RGBX555 v4l2_fourcc('R', 'X', '1', '5')
224 #define V4L2_PIX_FMT_ABGR555 v4l2_fourcc('A', 'B', '1', '5')
225 #define V4L2_PIX_FMT_XBGR555 v4l2_fourcc('X', 'B', '1', '5')
226 #define V4L2_PIX_FMT_BGRA555 v4l2_fourcc('B', 'A', '1', '5')
227 #define V4L2_PIX_FMT_BGRX555 v4l2_fourcc('B', 'X', '1', '5')
228 #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P')
229 #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q')
230 #define V4L2_PIX_FMT_ARGB555X v4l2_fourcc_be('A', 'R', '1', '5')
231 #define V4L2_PIX_FMT_XRGB555X v4l2_fourcc_be('X', 'R', '1', '5')
232 #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R')
233 #define V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H')
234 #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3')
235 #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3')
236 #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4')
237 #define V4L2_PIX_FMT_ABGR32 v4l2_fourcc('A', 'R', '2', '4')
238 #define V4L2_PIX_FMT_XBGR32 v4l2_fourcc('X', 'R', '2', '4')
239 #define V4L2_PIX_FMT_BGRA32 v4l2_fourcc('R', 'A', '2', '4')
240 #define V4L2_PIX_FMT_BGRX32 v4l2_fourcc('R', 'X', '2', '4')
241 #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4')
242 #define V4L2_PIX_FMT_RGBA32 v4l2_fourcc('A', 'B', '2', '4')
243 #define V4L2_PIX_FMT_RGBX32 v4l2_fourcc('X', 'B', '2', '4')
244 #define V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4')
245 #define V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4')
246 #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y')
247 #define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ')
248 #define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ')
249 #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ')
250 #define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ')
251 #define V4L2_PIX_FMT_Y14 v4l2_fourcc('Y', '1', '4', ' ')
252 #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ')
253 #define V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ')
254 #define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B')
255 #define V4L2_PIX_FMT_Y10P v4l2_fourcc('Y', '1', '0', 'P')
256 #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8')
257 #define V4L2_PIX_FMT_UV8 v4l2_fourcc('U', 'V', '8', ' ')
258 #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V')
259 #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V')
260 #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U')
261 #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y')
262 #define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y')
263 #define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P')
264 #define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4')
265 #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O')
266 #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P')
267 #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4')
268 #define V4L2_PIX_FMT_AYUV32 v4l2_fourcc('A', 'Y', 'U', 'V')
269 #define V4L2_PIX_FMT_XYUV32 v4l2_fourcc('X', 'Y', 'U', 'V')
270 #define V4L2_PIX_FMT_VUYA32 v4l2_fourcc('V', 'U', 'Y', 'A')
271 #define V4L2_PIX_FMT_VUYX32 v4l2_fourcc('V', 'U', 'Y', 'X')
272 #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4')
273 #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2')
274 #define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0')
275 #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2')
276 #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1')
277 #define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6')
278 #define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1')
279 #define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4')
280 #define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2')
281 #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2')
282 #define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1')
283 #define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6')
284 #define V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1')
285 #define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2')
286 #define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2')
287 #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9')
288 #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9')
289 #define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P')
290 #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2')
291 #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2')
292 #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P')
293 #define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2')
294 #define V4L2_PIX_FMT_YVU420M v4l2_fourcc('Y', 'M', '2', '1')
295 #define V4L2_PIX_FMT_YUV422M v4l2_fourcc('Y', 'M', '1', '6')
296 #define V4L2_PIX_FMT_YVU422M v4l2_fourcc('Y', 'M', '6', '1')
297 #define V4L2_PIX_FMT_YUV444M v4l2_fourcc('Y', 'M', '2', '4')
298 #define V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2')
299 #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1')
300 #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G')
301 #define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G')
302 #define V4L2_PIX_FMT_SRGGB8 v4l2_fourcc('R', 'G', 'G', 'B')
303 #define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0')
304 #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0')
305 #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0')
306 #define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0')
307 #define V4L2_PIX_FMT_SBGGR10P v4l2_fourcc('p', 'B', 'A', 'A')
308 #define V4L2_PIX_FMT_SGBRG10P v4l2_fourcc('p', 'G', 'A', 'A')
309 #define V4L2_PIX_FMT_SGRBG10P v4l2_fourcc('p', 'g', 'A', 'A')
310 #define V4L2_PIX_FMT_SRGGB10P v4l2_fourcc('p', 'R', 'A', 'A')
311 #define V4L2_PIX_FMT_SBGGR10ALAW8 v4l2_fourcc('a', 'B', 'A', '8')
312 #define V4L2_PIX_FMT_SGBRG10ALAW8 v4l2_fourcc('a', 'G', 'A', '8')
313 #define V4L2_PIX_FMT_SGRBG10ALAW8 v4l2_fourcc('a', 'g', 'A', '8')
314 #define V4L2_PIX_FMT_SRGGB10ALAW8 v4l2_fourcc('a', 'R', 'A', '8')
315 #define V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8')
316 #define V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8')
317 #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
318 #define V4L2_PIX_FMT_SRGGB10DPCM8 v4l2_fourcc('b', 'R', 'A', '8')
319 #define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2')
320 #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2')
321 #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2')
322 #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2')
323 #define V4L2_PIX_FMT_SBGGR12P v4l2_fourcc('p', 'B', 'C', 'C')
324 #define V4L2_PIX_FMT_SGBRG12P v4l2_fourcc('p', 'G', 'C', 'C')
325 #define V4L2_PIX_FMT_SGRBG12P v4l2_fourcc('p', 'g', 'C', 'C')
326 #define V4L2_PIX_FMT_SRGGB12P v4l2_fourcc('p', 'R', 'C', 'C')
327 #define V4L2_PIX_FMT_SBGGR14 v4l2_fourcc('B', 'G', '1', '4')
328 #define V4L2_PIX_FMT_SGBRG14 v4l2_fourcc('G', 'B', '1', '4')
329 #define V4L2_PIX_FMT_SGRBG14 v4l2_fourcc('G', 'R', '1', '4')
330 #define V4L2_PIX_FMT_SRGGB14 v4l2_fourcc('R', 'G', '1', '4')
331 #define V4L2_PIX_FMT_SBGGR14P v4l2_fourcc('p', 'B', 'E', 'E')
332 #define V4L2_PIX_FMT_SGBRG14P v4l2_fourcc('p', 'G', 'E', 'E')
333 #define V4L2_PIX_FMT_SGRBG14P v4l2_fourcc('p', 'g', 'E', 'E')
334 #define V4L2_PIX_FMT_SRGGB14P v4l2_fourcc('p', 'R', 'E', 'E')
335 #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2')
336 #define V4L2_PIX_FMT_SGBRG16 v4l2_fourcc('G', 'B', '1', '6')
337 #define V4L2_PIX_FMT_SGRBG16 v4l2_fourcc('G', 'R', '1', '6')
338 #define V4L2_PIX_FMT_SRGGB16 v4l2_fourcc('R', 'G', '1', '6')
339 #define V4L2_PIX_FMT_HSV24 v4l2_fourcc('H', 'S', 'V', '3')
340 #define V4L2_PIX_FMT_HSV32 v4l2_fourcc('H', 'S', 'V', '4')
341 #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G')
342 #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G')
343 #define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd')
344 #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G')
345 #define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4')
346 #define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1')
347 #define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4')
348 #define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3')
349 #define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1')
350 #define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2')
351 #define V4L2_PIX_FMT_MPEG2_SLICE v4l2_fourcc('M', 'G', '2', 'S')
352 #define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4')
353 #define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D')
354 #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G')
355 #define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L')
356 #define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0')
357 #define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0')
358 #define V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C')
359 #define V4L2_PIX_FMT_FWHT v4l2_fourcc('F', 'W', 'H', 'T')
360 #define V4L2_PIX_FMT_FWHT_STATELESS v4l2_fourcc('S', 'F', 'W', 'H')
361 #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A')
362 #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A')
363 #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0')
364 #define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0')
365 #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1')
366 #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2')
367 #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5')
368 #define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1')
369 #define V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5')
370 #define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8')
371 #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1')
372 #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7')
373 #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0')
374 #define V4L2_PIX_FMT_JL2005BCD v4l2_fourcc('J', 'L', '2', '0')
375 #define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X')
376 #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C')
377 #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G')
378 #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1')
379 #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8')
380 #define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0')
381 #define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0')
382 #define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V')
383 #define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I')
384 #define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L')
385 #define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1')
386 #define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I')
387 #define V4L2_PIX_FMT_Y8I v4l2_fourcc('Y', '8', 'I', ' ')
388 #define V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I')
389 #define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ')
390 #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1')
391 #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I')
392 #define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2')
393 #define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4')
394 #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b')
395 #define V4L2_PIX_FMT_IPU3_SGBRG10 v4l2_fourcc('i', 'p', '3', 'g')
396 #define V4L2_PIX_FMT_IPU3_SGRBG10 v4l2_fourcc('i', 'p', '3', 'G')
397 #define V4L2_PIX_FMT_IPU3_SRGGB10 v4l2_fourcc('i', 'p', '3', 'r')
398 #define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8')
399 #define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6')
400 #define V4L2_SDR_FMT_CS8 v4l2_fourcc('C', 'S', '0', '8')
401 #define V4L2_SDR_FMT_CS14LE v4l2_fourcc('C', 'S', '1', '4')
402 #define V4L2_SDR_FMT_RU12LE v4l2_fourcc('R', 'U', '1', '2')
403 #define V4L2_SDR_FMT_PCU16BE v4l2_fourcc('P', 'C', '1', '6')
404 #define V4L2_SDR_FMT_PCU18BE v4l2_fourcc('P', 'C', '1', '8')
405 #define V4L2_SDR_FMT_PCU20BE v4l2_fourcc('P', 'C', '2', '0')
406 #define V4L2_TCH_FMT_DELTA_TD16 v4l2_fourcc('T', 'D', '1', '6')
407 #define V4L2_TCH_FMT_DELTA_TD08 v4l2_fourcc('T', 'D', '0', '8')
408 #define V4L2_TCH_FMT_TU16 v4l2_fourcc('T', 'U', '1', '6')
409 #define V4L2_TCH_FMT_TU08 v4l2_fourcc('T', 'U', '0', '8')
410 #define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H')
411 #define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T')
412 #define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H')
413 #define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X')
414 #define V4L2_META_FMT_VIVID v4l2_fourcc('V', 'I', 'V', 'D')
415 #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe
416 #define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA 0x00000001
417 struct v4l2_fmtdesc {
418   __u32 index;
419   __u32 type;
420   __u32 flags;
421   __u8 description[32];
422   __u32 pixelformat;
423   __u32 reserved[4];
424 };
425 #define V4L2_FMT_FLAG_COMPRESSED 0x0001
426 #define V4L2_FMT_FLAG_EMULATED 0x0002
427 #define V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM 0x0004
428 #define V4L2_FMT_FLAG_DYN_RESOLUTION 0x0008
429 enum v4l2_frmsizetypes {
430   V4L2_FRMSIZE_TYPE_DISCRETE = 1,
431   V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
432   V4L2_FRMSIZE_TYPE_STEPWISE = 3,
433 };
434 struct v4l2_frmsize_discrete {
435   __u32 width;
436   __u32 height;
437 };
438 struct v4l2_frmsize_stepwise {
439   __u32 min_width;
440   __u32 max_width;
441   __u32 step_width;
442   __u32 min_height;
443   __u32 max_height;
444   __u32 step_height;
445 };
446 struct v4l2_frmsizeenum {
447   __u32 index;
448   __u32 pixel_format;
449   __u32 type;
450   union {
451     struct v4l2_frmsize_discrete discrete;
452     struct v4l2_frmsize_stepwise stepwise;
453   };
454   __u32 reserved[2];
455 };
456 enum v4l2_frmivaltypes {
457   V4L2_FRMIVAL_TYPE_DISCRETE = 1,
458   V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
459   V4L2_FRMIVAL_TYPE_STEPWISE = 3,
460 };
461 struct v4l2_frmival_stepwise {
462   struct v4l2_fract min;
463   struct v4l2_fract max;
464   struct v4l2_fract step;
465 };
466 struct v4l2_frmivalenum {
467   __u32 index;
468   __u32 pixel_format;
469   __u32 width;
470   __u32 height;
471   __u32 type;
472   union {
473     struct v4l2_fract discrete;
474     struct v4l2_frmival_stepwise stepwise;
475   };
476   __u32 reserved[2];
477 };
478 struct v4l2_timecode {
479   __u32 type;
480   __u32 flags;
481   __u8 frames;
482   __u8 seconds;
483   __u8 minutes;
484   __u8 hours;
485   __u8 userbits[4];
486 };
487 #define V4L2_TC_TYPE_24FPS 1
488 #define V4L2_TC_TYPE_25FPS 2
489 #define V4L2_TC_TYPE_30FPS 3
490 #define V4L2_TC_TYPE_50FPS 4
491 #define V4L2_TC_TYPE_60FPS 5
492 #define V4L2_TC_FLAG_DROPFRAME 0x0001
493 #define V4L2_TC_FLAG_COLORFRAME 0x0002
494 #define V4L2_TC_USERBITS_field 0x000C
495 #define V4L2_TC_USERBITS_USERDEFINED 0x0000
496 #define V4L2_TC_USERBITS_8BITCHARS 0x0008
497 struct v4l2_jpegcompression {
498   int quality;
499   int APPn;
500   int APP_len;
501   char APP_data[60];
502   int COM_len;
503   char COM_data[60];
504   __u32 jpeg_markers;
505 #define V4L2_JPEG_MARKER_DHT (1 << 3)
506 #define V4L2_JPEG_MARKER_DQT (1 << 4)
507 #define V4L2_JPEG_MARKER_DRI (1 << 5)
508 #define V4L2_JPEG_MARKER_COM (1 << 6)
509 #define V4L2_JPEG_MARKER_APP (1 << 7)
510 };
511 struct v4l2_requestbuffers {
512   __u32 count;
513   __u32 type;
514   __u32 memory;
515   __u32 capabilities;
516   __u32 reserved[1];
517 };
518 #define V4L2_BUF_CAP_SUPPORTS_MMAP (1 << 0)
519 #define V4L2_BUF_CAP_SUPPORTS_USERPTR (1 << 1)
520 #define V4L2_BUF_CAP_SUPPORTS_DMABUF (1 << 2)
521 #define V4L2_BUF_CAP_SUPPORTS_REQUESTS (1 << 3)
522 #define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4)
523 #define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF (1 << 5)
524 struct v4l2_plane {
525   __u32 bytesused;
526   __u32 length;
527   union {
528     __u32 mem_offset;
529     unsigned long userptr;
530     __s32 fd;
531   } m;
532   __u32 data_offset;
533   __u32 reserved[11];
534 };
535 struct v4l2_buffer {
536   __u32 index;
537   __u32 type;
538   __u32 bytesused;
539   __u32 flags;
540   __u32 field;
541   struct timeval timestamp;
542   struct v4l2_timecode timecode;
543   __u32 sequence;
544   __u32 memory;
545   union {
546     __u32 offset;
547     unsigned long userptr;
548     struct v4l2_plane * planes;
549     __s32 fd;
550   } m;
551   __u32 length;
552   __u32 reserved2;
553   union {
554     __s32 request_fd;
555     __u32 reserved;
556   };
557 };
558 #define V4L2_BUF_FLAG_MAPPED 0x00000001
559 #define V4L2_BUF_FLAG_QUEUED 0x00000002
560 #define V4L2_BUF_FLAG_DONE 0x00000004
561 #define V4L2_BUF_FLAG_KEYFRAME 0x00000008
562 #define V4L2_BUF_FLAG_PFRAME 0x00000010
563 #define V4L2_BUF_FLAG_BFRAME 0x00000020
564 #define V4L2_BUF_FLAG_ERROR 0x00000040
565 #define V4L2_BUF_FLAG_IN_REQUEST 0x00000080
566 #define V4L2_BUF_FLAG_TIMECODE 0x00000100
567 #define V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF 0x00000200
568 #define V4L2_BUF_FLAG_PREPARED 0x00000400
569 #define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x00000800
570 #define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x00001000
571 #define V4L2_BUF_FLAG_TIMESTAMP_MASK 0x0000e000
572 #define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN 0x00000000
573 #define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x00002000
574 #define V4L2_BUF_FLAG_TIMESTAMP_COPY 0x00004000
575 #define V4L2_BUF_FLAG_TSTAMP_SRC_MASK 0x00070000
576 #define V4L2_BUF_FLAG_TSTAMP_SRC_EOF 0x00000000
577 #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000
578 #define V4L2_BUF_FLAG_LAST 0x00100000
579 #define V4L2_BUF_FLAG_REQUEST_FD 0x00800000
580 struct v4l2_exportbuffer {
581   __u32 type;
582   __u32 index;
583   __u32 plane;
584   __u32 flags;
585   __s32 fd;
586   __u32 reserved[11];
587 };
588 struct v4l2_framebuffer {
589   __u32 capability;
590   __u32 flags;
591   void * base;
592   struct {
593     __u32 width;
594     __u32 height;
595     __u32 pixelformat;
596     __u32 field;
597     __u32 bytesperline;
598     __u32 sizeimage;
599     __u32 colorspace;
600     __u32 priv;
601   } fmt;
602 };
603 #define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
604 #define V4L2_FBUF_CAP_CHROMAKEY 0x0002
605 #define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
606 #define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
607 #define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
608 #define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
609 #define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
610 #define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080
611 #define V4L2_FBUF_FLAG_PRIMARY 0x0001
612 #define V4L2_FBUF_FLAG_OVERLAY 0x0002
613 #define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
614 #define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
615 #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
616 #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
617 #define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040
618 struct v4l2_clip {
619   struct v4l2_rect c;
620   struct v4l2_clip __user * next;
621 };
622 struct v4l2_window {
623   struct v4l2_rect w;
624   __u32 field;
625   __u32 chromakey;
626   struct v4l2_clip __user * clips;
627   __u32 clipcount;
628   void __user * bitmap;
629   __u8 global_alpha;
630 };
631 struct v4l2_captureparm {
632   __u32 capability;
633   __u32 capturemode;
634   struct v4l2_fract timeperframe;
635   __u32 extendedmode;
636   __u32 readbuffers;
637   __u32 reserved[4];
638 };
639 #define V4L2_MODE_HIGHQUALITY 0x0001
640 #define V4L2_CAP_TIMEPERFRAME 0x1000
641 struct v4l2_outputparm {
642   __u32 capability;
643   __u32 outputmode;
644   struct v4l2_fract timeperframe;
645   __u32 extendedmode;
646   __u32 writebuffers;
647   __u32 reserved[4];
648 };
649 struct v4l2_cropcap {
650   __u32 type;
651   struct v4l2_rect bounds;
652   struct v4l2_rect defrect;
653   struct v4l2_fract pixelaspect;
654 };
655 struct v4l2_crop {
656   __u32 type;
657   struct v4l2_rect c;
658 };
659 struct v4l2_selection {
660   __u32 type;
661   __u32 target;
662   __u32 flags;
663   struct v4l2_rect r;
664   __u32 reserved[9];
665 };
666 typedef __u64 v4l2_std_id;
667 #define V4L2_STD_PAL_B ((v4l2_std_id) 0x00000001)
668 #define V4L2_STD_PAL_B1 ((v4l2_std_id) 0x00000002)
669 #define V4L2_STD_PAL_G ((v4l2_std_id) 0x00000004)
670 #define V4L2_STD_PAL_H ((v4l2_std_id) 0x00000008)
671 #define V4L2_STD_PAL_I ((v4l2_std_id) 0x00000010)
672 #define V4L2_STD_PAL_D ((v4l2_std_id) 0x00000020)
673 #define V4L2_STD_PAL_D1 ((v4l2_std_id) 0x00000040)
674 #define V4L2_STD_PAL_K ((v4l2_std_id) 0x00000080)
675 #define V4L2_STD_PAL_M ((v4l2_std_id) 0x00000100)
676 #define V4L2_STD_PAL_N ((v4l2_std_id) 0x00000200)
677 #define V4L2_STD_PAL_Nc ((v4l2_std_id) 0x00000400)
678 #define V4L2_STD_PAL_60 ((v4l2_std_id) 0x00000800)
679 #define V4L2_STD_NTSC_M ((v4l2_std_id) 0x00001000)
680 #define V4L2_STD_NTSC_M_JP ((v4l2_std_id) 0x00002000)
681 #define V4L2_STD_NTSC_443 ((v4l2_std_id) 0x00004000)
682 #define V4L2_STD_NTSC_M_KR ((v4l2_std_id) 0x00008000)
683 #define V4L2_STD_SECAM_B ((v4l2_std_id) 0x00010000)
684 #define V4L2_STD_SECAM_D ((v4l2_std_id) 0x00020000)
685 #define V4L2_STD_SECAM_G ((v4l2_std_id) 0x00040000)
686 #define V4L2_STD_SECAM_H ((v4l2_std_id) 0x00080000)
687 #define V4L2_STD_SECAM_K ((v4l2_std_id) 0x00100000)
688 #define V4L2_STD_SECAM_K1 ((v4l2_std_id) 0x00200000)
689 #define V4L2_STD_SECAM_L ((v4l2_std_id) 0x00400000)
690 #define V4L2_STD_SECAM_LC ((v4l2_std_id) 0x00800000)
691 #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id) 0x01000000)
692 #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id) 0x02000000)
693 #define V4L2_STD_NTSC (V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_M_KR)
694 #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D | V4L2_STD_SECAM_K | V4L2_STD_SECAM_K1)
695 #define V4L2_STD_SECAM (V4L2_STD_SECAM_B | V4L2_STD_SECAM_G | V4L2_STD_SECAM_H | V4L2_STD_SECAM_DK | V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)
696 #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B | V4L2_STD_PAL_B1 | V4L2_STD_PAL_G)
697 #define V4L2_STD_PAL_DK (V4L2_STD_PAL_D | V4L2_STD_PAL_D1 | V4L2_STD_PAL_K)
698 #define V4L2_STD_PAL (V4L2_STD_PAL_BG | V4L2_STD_PAL_DK | V4L2_STD_PAL_H | V4L2_STD_PAL_I)
699 #define V4L2_STD_B (V4L2_STD_PAL_B | V4L2_STD_PAL_B1 | V4L2_STD_SECAM_B)
700 #define V4L2_STD_G (V4L2_STD_PAL_G | V4L2_STD_SECAM_G)
701 #define V4L2_STD_H (V4L2_STD_PAL_H | V4L2_STD_SECAM_H)
702 #define V4L2_STD_L (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)
703 #define V4L2_STD_GH (V4L2_STD_G | V4L2_STD_H)
704 #define V4L2_STD_DK (V4L2_STD_PAL_DK | V4L2_STD_SECAM_DK)
705 #define V4L2_STD_BG (V4L2_STD_B | V4L2_STD_G)
706 #define V4L2_STD_MN (V4L2_STD_PAL_M | V4L2_STD_PAL_N | V4L2_STD_PAL_Nc | V4L2_STD_NTSC)
707 #define V4L2_STD_MTS (V4L2_STD_NTSC_M | V4L2_STD_PAL_M | V4L2_STD_PAL_N | V4L2_STD_PAL_Nc)
708 #define V4L2_STD_525_60 (V4L2_STD_PAL_M | V4L2_STD_PAL_60 | V4L2_STD_NTSC | V4L2_STD_NTSC_443)
709 #define V4L2_STD_625_50 (V4L2_STD_PAL | V4L2_STD_PAL_N | V4L2_STD_PAL_Nc | V4L2_STD_SECAM)
710 #define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB | V4L2_STD_ATSC_16_VSB)
711 #define V4L2_STD_UNKNOWN 0
712 #define V4L2_STD_ALL (V4L2_STD_525_60 | V4L2_STD_625_50)
713 struct v4l2_standard {
714   __u32 index;
715   v4l2_std_id id;
716   __u8 name[24];
717   struct v4l2_fract frameperiod;
718   __u32 framelines;
719   __u32 reserved[4];
720 };
721 struct v4l2_bt_timings {
722   __u32 width;
723   __u32 height;
724   __u32 interlaced;
725   __u32 polarities;
726   __u64 pixelclock;
727   __u32 hfrontporch;
728   __u32 hsync;
729   __u32 hbackporch;
730   __u32 vfrontporch;
731   __u32 vsync;
732   __u32 vbackporch;
733   __u32 il_vfrontporch;
734   __u32 il_vsync;
735   __u32 il_vbackporch;
736   __u32 standards;
737   __u32 flags;
738   struct v4l2_fract picture_aspect;
739   __u8 cea861_vic;
740   __u8 hdmi_vic;
741   __u8 reserved[46];
742 } __attribute__((packed));
743 #define V4L2_DV_PROGRESSIVE 0
744 #define V4L2_DV_INTERLACED 1
745 #define V4L2_DV_VSYNC_POS_POL 0x00000001
746 #define V4L2_DV_HSYNC_POS_POL 0x00000002
747 #define V4L2_DV_BT_STD_CEA861 (1 << 0)
748 #define V4L2_DV_BT_STD_DMT (1 << 1)
749 #define V4L2_DV_BT_STD_CVT (1 << 2)
750 #define V4L2_DV_BT_STD_GTF (1 << 3)
751 #define V4L2_DV_BT_STD_SDI (1 << 4)
752 #define V4L2_DV_FL_REDUCED_BLANKING (1 << 0)
753 #define V4L2_DV_FL_CAN_REDUCE_FPS (1 << 1)
754 #define V4L2_DV_FL_REDUCED_FPS (1 << 2)
755 #define V4L2_DV_FL_HALF_LINE (1 << 3)
756 #define V4L2_DV_FL_IS_CE_VIDEO (1 << 4)
757 #define V4L2_DV_FL_FIRST_FIELD_EXTRA_LINE (1 << 5)
758 #define V4L2_DV_FL_HAS_PICTURE_ASPECT (1 << 6)
759 #define V4L2_DV_FL_HAS_CEA861_VIC (1 << 7)
760 #define V4L2_DV_FL_HAS_HDMI_VIC (1 << 8)
761 #define V4L2_DV_FL_CAN_DETECT_REDUCED_FPS (1 << 9)
762 #define V4L2_DV_BT_BLANKING_WIDTH(bt) ((bt)->hfrontporch + (bt)->hsync + (bt)->hbackporch)
763 #define V4L2_DV_BT_FRAME_WIDTH(bt) ((bt)->width + V4L2_DV_BT_BLANKING_WIDTH(bt))
764 #define V4L2_DV_BT_BLANKING_HEIGHT(bt) ((bt)->vfrontporch + (bt)->vsync + (bt)->vbackporch + (bt)->il_vfrontporch + (bt)->il_vsync + (bt)->il_vbackporch)
765 #define V4L2_DV_BT_FRAME_HEIGHT(bt) ((bt)->height + V4L2_DV_BT_BLANKING_HEIGHT(bt))
766 struct v4l2_dv_timings {
767   __u32 type;
768   union {
769     struct v4l2_bt_timings bt;
770     __u32 reserved[32];
771   };
772 } __attribute__((packed));
773 #define V4L2_DV_BT_656_1120 0
774 struct v4l2_enum_dv_timings {
775   __u32 index;
776   __u32 pad;
777   __u32 reserved[2];
778   struct v4l2_dv_timings timings;
779 };
780 struct v4l2_bt_timings_cap {
781   __u32 min_width;
782   __u32 max_width;
783   __u32 min_height;
784   __u32 max_height;
785   __u64 min_pixelclock;
786   __u64 max_pixelclock;
787   __u32 standards;
788   __u32 capabilities;
789   __u32 reserved[16];
790 } __attribute__((packed));
791 #define V4L2_DV_BT_CAP_INTERLACED (1 << 0)
792 #define V4L2_DV_BT_CAP_PROGRESSIVE (1 << 1)
793 #define V4L2_DV_BT_CAP_REDUCED_BLANKING (1 << 2)
794 #define V4L2_DV_BT_CAP_CUSTOM (1 << 3)
795 struct v4l2_dv_timings_cap {
796   __u32 type;
797   __u32 pad;
798   __u32 reserved[2];
799   union {
800     struct v4l2_bt_timings_cap bt;
801     __u32 raw_data[32];
802   };
803 };
804 struct v4l2_input {
805   __u32 index;
806   __u8 name[32];
807   __u32 type;
808   __u32 audioset;
809   __u32 tuner;
810   v4l2_std_id std;
811   __u32 status;
812   __u32 capabilities;
813   __u32 reserved[3];
814 };
815 #define V4L2_INPUT_TYPE_TUNER 1
816 #define V4L2_INPUT_TYPE_CAMERA 2
817 #define V4L2_INPUT_TYPE_TOUCH 3
818 #define V4L2_IN_ST_NO_POWER 0x00000001
819 #define V4L2_IN_ST_NO_SIGNAL 0x00000002
820 #define V4L2_IN_ST_NO_COLOR 0x00000004
821 #define V4L2_IN_ST_HFLIP 0x00000010
822 #define V4L2_IN_ST_VFLIP 0x00000020
823 #define V4L2_IN_ST_NO_H_LOCK 0x00000100
824 #define V4L2_IN_ST_COLOR_KILL 0x00000200
825 #define V4L2_IN_ST_NO_V_LOCK 0x00000400
826 #define V4L2_IN_ST_NO_STD_LOCK 0x00000800
827 #define V4L2_IN_ST_NO_SYNC 0x00010000
828 #define V4L2_IN_ST_NO_EQU 0x00020000
829 #define V4L2_IN_ST_NO_CARRIER 0x00040000
830 #define V4L2_IN_ST_MACROVISION 0x01000000
831 #define V4L2_IN_ST_NO_ACCESS 0x02000000
832 #define V4L2_IN_ST_VTR 0x04000000
833 #define V4L2_IN_CAP_DV_TIMINGS 0x00000002
834 #define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS
835 #define V4L2_IN_CAP_STD 0x00000004
836 #define V4L2_IN_CAP_NATIVE_SIZE 0x00000008
837 struct v4l2_output {
838   __u32 index;
839   __u8 name[32];
840   __u32 type;
841   __u32 audioset;
842   __u32 modulator;
843   v4l2_std_id std;
844   __u32 capabilities;
845   __u32 reserved[3];
846 };
847 #define V4L2_OUTPUT_TYPE_MODULATOR 1
848 #define V4L2_OUTPUT_TYPE_ANALOG 2
849 #define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
850 #define V4L2_OUT_CAP_DV_TIMINGS 0x00000002
851 #define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS
852 #define V4L2_OUT_CAP_STD 0x00000004
853 #define V4L2_OUT_CAP_NATIVE_SIZE 0x00000008
854 struct v4l2_control {
855   __u32 id;
856   __s32 value;
857 };
858 struct v4l2_ext_control {
859   __u32 id;
860   __u32 size;
861   __u32 reserved2[1];
862   union {
863     __s32 value;
864     __s64 value64;
865     char __user * string;
866     __u8 __user * p_u8;
867     __u16 __user * p_u16;
868     __u32 __user * p_u32;
869     struct v4l2_area __user * p_area;
870     void __user * ptr;
871   };
872 } __attribute__((packed));
873 struct v4l2_ext_controls {
874   union {
875     __u32 ctrl_class;
876     __u32 which;
877   };
878   __u32 count;
879   __u32 error_idx;
880   __s32 request_fd;
881   __u32 reserved[1];
882   struct v4l2_ext_control * controls;
883 };
884 #define V4L2_CTRL_ID_MASK (0x0fffffff)
885 #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
886 #define V4L2_CTRL_ID2WHICH(id) ((id) & 0x0fff0000UL)
887 #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
888 #define V4L2_CTRL_MAX_DIMS (4)
889 #define V4L2_CTRL_WHICH_CUR_VAL 0
890 #define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000
891 #define V4L2_CTRL_WHICH_REQUEST_VAL 0x0f010000
892 enum v4l2_ctrl_type {
893   V4L2_CTRL_TYPE_INTEGER = 1,
894   V4L2_CTRL_TYPE_BOOLEAN = 2,
895   V4L2_CTRL_TYPE_MENU = 3,
896   V4L2_CTRL_TYPE_BUTTON = 4,
897   V4L2_CTRL_TYPE_INTEGER64 = 5,
898   V4L2_CTRL_TYPE_CTRL_CLASS = 6,
899   V4L2_CTRL_TYPE_STRING = 7,
900   V4L2_CTRL_TYPE_BITMASK = 8,
901   V4L2_CTRL_TYPE_INTEGER_MENU = 9,
902   V4L2_CTRL_COMPOUND_TYPES = 0x0100,
903   V4L2_CTRL_TYPE_U8 = 0x0100,
904   V4L2_CTRL_TYPE_U16 = 0x0101,
905   V4L2_CTRL_TYPE_U32 = 0x0102,
906   V4L2_CTRL_TYPE_AREA = 0x0106,
907 };
908 struct v4l2_queryctrl {
909   __u32 id;
910   __u32 type;
911   __u8 name[32];
912   __s32 minimum;
913   __s32 maximum;
914   __s32 step;
915   __s32 default_value;
916   __u32 flags;
917   __u32 reserved[2];
918 };
919 struct v4l2_query_ext_ctrl {
920   __u32 id;
921   __u32 type;
922   char name[32];
923   __s64 minimum;
924   __s64 maximum;
925   __u64 step;
926   __s64 default_value;
927   __u32 flags;
928   __u32 elem_size;
929   __u32 elems;
930   __u32 nr_of_dims;
931   __u32 dims[V4L2_CTRL_MAX_DIMS];
932   __u32 reserved[32];
933 };
934 struct v4l2_querymenu {
935   __u32 id;
936   __u32 index;
937   union {
938     __u8 name[32];
939     __s64 value;
940   };
941   __u32 reserved;
942 } __attribute__((packed));
943 #define V4L2_CTRL_FLAG_DISABLED 0x0001
944 #define V4L2_CTRL_FLAG_GRABBED 0x0002
945 #define V4L2_CTRL_FLAG_READ_ONLY 0x0004
946 #define V4L2_CTRL_FLAG_UPDATE 0x0008
947 #define V4L2_CTRL_FLAG_INACTIVE 0x0010
948 #define V4L2_CTRL_FLAG_SLIDER 0x0020
949 #define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040
950 #define V4L2_CTRL_FLAG_VOLATILE 0x0080
951 #define V4L2_CTRL_FLAG_HAS_PAYLOAD 0x0100
952 #define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x0200
953 #define V4L2_CTRL_FLAG_MODIFY_LAYOUT 0x0400
954 #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
955 #define V4L2_CTRL_FLAG_NEXT_COMPOUND 0x40000000
956 #define V4L2_CID_MAX_CTRLS 1024
957 #define V4L2_CID_PRIVATE_BASE 0x08000000
958 struct v4l2_tuner {
959   __u32 index;
960   __u8 name[32];
961   __u32 type;
962   __u32 capability;
963   __u32 rangelow;
964   __u32 rangehigh;
965   __u32 rxsubchans;
966   __u32 audmode;
967   __s32 signal;
968   __s32 afc;
969   __u32 reserved[4];
970 };
971 struct v4l2_modulator {
972   __u32 index;
973   __u8 name[32];
974   __u32 capability;
975   __u32 rangelow;
976   __u32 rangehigh;
977   __u32 txsubchans;
978   __u32 type;
979   __u32 reserved[3];
980 };
981 #define V4L2_TUNER_CAP_LOW 0x0001
982 #define V4L2_TUNER_CAP_NORM 0x0002
983 #define V4L2_TUNER_CAP_HWSEEK_BOUNDED 0x0004
984 #define V4L2_TUNER_CAP_HWSEEK_WRAP 0x0008
985 #define V4L2_TUNER_CAP_STEREO 0x0010
986 #define V4L2_TUNER_CAP_LANG2 0x0020
987 #define V4L2_TUNER_CAP_SAP 0x0020
988 #define V4L2_TUNER_CAP_LANG1 0x0040
989 #define V4L2_TUNER_CAP_RDS 0x0080
990 #define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
991 #define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
992 #define V4L2_TUNER_CAP_FREQ_BANDS 0x0400
993 #define V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800
994 #define V4L2_TUNER_CAP_1HZ 0x1000
995 #define V4L2_TUNER_SUB_MONO 0x0001
996 #define V4L2_TUNER_SUB_STEREO 0x0002
997 #define V4L2_TUNER_SUB_LANG2 0x0004
998 #define V4L2_TUNER_SUB_SAP 0x0004
999 #define V4L2_TUNER_SUB_LANG1 0x0008
1000 #define V4L2_TUNER_SUB_RDS 0x0010
1001 #define V4L2_TUNER_MODE_MONO 0x0000
1002 #define V4L2_TUNER_MODE_STEREO 0x0001
1003 #define V4L2_TUNER_MODE_LANG2 0x0002
1004 #define V4L2_TUNER_MODE_SAP 0x0002
1005 #define V4L2_TUNER_MODE_LANG1 0x0003
1006 #define V4L2_TUNER_MODE_LANG1_LANG2 0x0004
1007 struct v4l2_frequency {
1008   __u32 tuner;
1009   __u32 type;
1010   __u32 frequency;
1011   __u32 reserved[8];
1012 };
1013 #define V4L2_BAND_MODULATION_VSB (1 << 1)
1014 #define V4L2_BAND_MODULATION_FM (1 << 2)
1015 #define V4L2_BAND_MODULATION_AM (1 << 3)
1016 struct v4l2_frequency_band {
1017   __u32 tuner;
1018   __u32 type;
1019   __u32 index;
1020   __u32 capability;
1021   __u32 rangelow;
1022   __u32 rangehigh;
1023   __u32 modulation;
1024   __u32 reserved[9];
1025 };
1026 struct v4l2_hw_freq_seek {
1027   __u32 tuner;
1028   __u32 type;
1029   __u32 seek_upward;
1030   __u32 wrap_around;
1031   __u32 spacing;
1032   __u32 rangelow;
1033   __u32 rangehigh;
1034   __u32 reserved[5];
1035 };
1036 struct v4l2_rds_data {
1037   __u8 lsb;
1038   __u8 msb;
1039   __u8 block;
1040 } __attribute__((packed));
1041 #define V4L2_RDS_BLOCK_MSK 0x7
1042 #define V4L2_RDS_BLOCK_A 0
1043 #define V4L2_RDS_BLOCK_B 1
1044 #define V4L2_RDS_BLOCK_C 2
1045 #define V4L2_RDS_BLOCK_D 3
1046 #define V4L2_RDS_BLOCK_C_ALT 4
1047 #define V4L2_RDS_BLOCK_INVALID 7
1048 #define V4L2_RDS_BLOCK_CORRECTED 0x40
1049 #define V4L2_RDS_BLOCK_ERROR 0x80
1050 struct v4l2_audio {
1051   __u32 index;
1052   __u8 name[32];
1053   __u32 capability;
1054   __u32 mode;
1055   __u32 reserved[2];
1056 };
1057 #define V4L2_AUDCAP_STEREO 0x00001
1058 #define V4L2_AUDCAP_AVL 0x00002
1059 #define V4L2_AUDMODE_AVL 0x00001
1060 struct v4l2_audioout {
1061   __u32 index;
1062   __u8 name[32];
1063   __u32 capability;
1064   __u32 mode;
1065   __u32 reserved[2];
1066 };
1067 #define V4L2_ENC_IDX_FRAME_I (0)
1068 #define V4L2_ENC_IDX_FRAME_P (1)
1069 #define V4L2_ENC_IDX_FRAME_B (2)
1070 #define V4L2_ENC_IDX_FRAME_MASK (0xf)
1071 struct v4l2_enc_idx_entry {
1072   __u64 offset;
1073   __u64 pts;
1074   __u32 length;
1075   __u32 flags;
1076   __u32 reserved[2];
1077 };
1078 #define V4L2_ENC_IDX_ENTRIES (64)
1079 struct v4l2_enc_idx {
1080   __u32 entries;
1081   __u32 entries_cap;
1082   __u32 reserved[4];
1083   struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES];
1084 };
1085 #define V4L2_ENC_CMD_START (0)
1086 #define V4L2_ENC_CMD_STOP (1)
1087 #define V4L2_ENC_CMD_PAUSE (2)
1088 #define V4L2_ENC_CMD_RESUME (3)
1089 #define V4L2_ENC_CMD_STOP_AT_GOP_END (1 << 0)
1090 struct v4l2_encoder_cmd {
1091   __u32 cmd;
1092   __u32 flags;
1093   union {
1094     struct {
1095       __u32 data[8];
1096     } raw;
1097   };
1098 };
1099 #define V4L2_DEC_CMD_START (0)
1100 #define V4L2_DEC_CMD_STOP (1)
1101 #define V4L2_DEC_CMD_PAUSE (2)
1102 #define V4L2_DEC_CMD_RESUME (3)
1103 #define V4L2_DEC_CMD_FLUSH (4)
1104 #define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0)
1105 #define V4L2_DEC_CMD_PAUSE_TO_BLACK (1 << 0)
1106 #define V4L2_DEC_CMD_STOP_TO_BLACK (1 << 0)
1107 #define V4L2_DEC_CMD_STOP_IMMEDIATELY (1 << 1)
1108 #define V4L2_DEC_START_FMT_NONE (0)
1109 #define V4L2_DEC_START_FMT_GOP (1)
1110 struct v4l2_decoder_cmd {
1111   __u32 cmd;
1112   __u32 flags;
1113   union {
1114     struct {
1115       __u64 pts;
1116     } stop;
1117     struct {
1118       __s32 speed;
1119       __u32 format;
1120     } start;
1121     struct {
1122       __u32 data[16];
1123     } raw;
1124   };
1125 };
1126 struct v4l2_vbi_format {
1127   __u32 sampling_rate;
1128   __u32 offset;
1129   __u32 samples_per_line;
1130   __u32 sample_format;
1131   __s32 start[2];
1132   __u32 count[2];
1133   __u32 flags;
1134   __u32 reserved[2];
1135 };
1136 #define V4L2_VBI_UNSYNC (1 << 0)
1137 #define V4L2_VBI_INTERLACED (1 << 1)
1138 #define V4L2_VBI_ITU_525_F1_START (1)
1139 #define V4L2_VBI_ITU_525_F2_START (264)
1140 #define V4L2_VBI_ITU_625_F1_START (1)
1141 #define V4L2_VBI_ITU_625_F2_START (314)
1142 struct v4l2_sliced_vbi_format {
1143   __u16 service_set;
1144   __u16 service_lines[2][24];
1145   __u32 io_size;
1146   __u32 reserved[2];
1147 };
1148 #define V4L2_SLICED_TELETEXT_B (0x0001)
1149 #define V4L2_SLICED_VPS (0x0400)
1150 #define V4L2_SLICED_CAPTION_525 (0x1000)
1151 #define V4L2_SLICED_WSS_625 (0x4000)
1152 #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525)
1153 #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
1154 struct v4l2_sliced_vbi_cap {
1155   __u16 service_set;
1156   __u16 service_lines[2][24];
1157   __u32 type;
1158   __u32 reserved[3];
1159 };
1160 struct v4l2_sliced_vbi_data {
1161   __u32 id;
1162   __u32 field;
1163   __u32 line;
1164   __u32 reserved;
1165   __u8 data[48];
1166 };
1167 #define V4L2_MPEG_VBI_IVTV_TELETEXT_B (1)
1168 #define V4L2_MPEG_VBI_IVTV_CAPTION_525 (4)
1169 #define V4L2_MPEG_VBI_IVTV_WSS_625 (5)
1170 #define V4L2_MPEG_VBI_IVTV_VPS (7)
1171 struct v4l2_mpeg_vbi_itv0_line {
1172   __u8 id;
1173   __u8 data[42];
1174 } __attribute__((packed));
1175 struct v4l2_mpeg_vbi_itv0 {
1176   __le32 linemask[2];
1177   struct v4l2_mpeg_vbi_itv0_line line[35];
1178 } __attribute__((packed));
1179 struct v4l2_mpeg_vbi_ITV0 {
1180   struct v4l2_mpeg_vbi_itv0_line line[36];
1181 } __attribute__((packed));
1182 #define V4L2_MPEG_VBI_IVTV_MAGIC0 "itv0"
1183 #define V4L2_MPEG_VBI_IVTV_MAGIC1 "ITV0"
1184 struct v4l2_mpeg_vbi_fmt_ivtv {
1185   __u8 magic[4];
1186   union {
1187     struct v4l2_mpeg_vbi_itv0 itv0;
1188     struct v4l2_mpeg_vbi_ITV0 ITV0;
1189   };
1190 } __attribute__((packed));
1191 struct v4l2_plane_pix_format {
1192   __u32 sizeimage;
1193   __u32 bytesperline;
1194   __u16 reserved[6];
1195 } __attribute__((packed));
1196 struct v4l2_pix_format_mplane {
1197   __u32 width;
1198   __u32 height;
1199   __u32 pixelformat;
1200   __u32 field;
1201   __u32 colorspace;
1202   struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
1203   __u8 num_planes;
1204   __u8 flags;
1205   union {
1206     __u8 ycbcr_enc;
1207     __u8 hsv_enc;
1208   };
1209   __u8 quantization;
1210   __u8 xfer_func;
1211   __u8 reserved[7];
1212 } __attribute__((packed));
1213 struct v4l2_sdr_format {
1214   __u32 pixelformat;
1215   __u32 buffersize;
1216   __u8 reserved[24];
1217 } __attribute__((packed));
1218 struct v4l2_meta_format {
1219   __u32 dataformat;
1220   __u32 buffersize;
1221 } __attribute__((packed));
1222 struct v4l2_format {
1223   __u32 type;
1224   union {
1225     struct v4l2_pix_format pix;
1226     struct v4l2_pix_format_mplane pix_mp;
1227     struct v4l2_window win;
1228     struct v4l2_vbi_format vbi;
1229     struct v4l2_sliced_vbi_format sliced;
1230     struct v4l2_sdr_format sdr;
1231     struct v4l2_meta_format meta;
1232     __u8 raw_data[200];
1233   } fmt;
1234 };
1235 struct v4l2_streamparm {
1236   __u32 type;
1237   union {
1238     struct v4l2_captureparm capture;
1239     struct v4l2_outputparm output;
1240     __u8 raw_data[200];
1241   } parm;
1242 };
1243 #define V4L2_EVENT_ALL 0
1244 #define V4L2_EVENT_VSYNC 1
1245 #define V4L2_EVENT_EOS 2
1246 #define V4L2_EVENT_CTRL 3
1247 #define V4L2_EVENT_FRAME_SYNC 4
1248 #define V4L2_EVENT_SOURCE_CHANGE 5
1249 #define V4L2_EVENT_MOTION_DET 6
1250 #define V4L2_EVENT_PRIVATE_START 0x08000000
1251 struct v4l2_event_vsync {
1252   __u8 field;
1253 } __attribute__((packed));
1254 #define V4L2_EVENT_CTRL_CH_VALUE (1 << 0)
1255 #define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1)
1256 #define V4L2_EVENT_CTRL_CH_RANGE (1 << 2)
1257 struct v4l2_event_ctrl {
1258   __u32 changes;
1259   __u32 type;
1260   union {
1261     __s32 value;
1262     __s64 value64;
1263   };
1264   __u32 flags;
1265   __s32 minimum;
1266   __s32 maximum;
1267   __s32 step;
1268   __s32 default_value;
1269 };
1270 struct v4l2_event_frame_sync {
1271   __u32 frame_sequence;
1272 };
1273 #define V4L2_EVENT_SRC_CH_RESOLUTION (1 << 0)
1274 struct v4l2_event_src_change {
1275   __u32 changes;
1276 };
1277 #define V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ (1 << 0)
1278 struct v4l2_event_motion_det {
1279   __u32 flags;
1280   __u32 frame_sequence;
1281   __u32 region_mask;
1282 };
1283 struct v4l2_event {
1284   __u32 type;
1285   union {
1286     struct v4l2_event_vsync vsync;
1287     struct v4l2_event_ctrl ctrl;
1288     struct v4l2_event_frame_sync frame_sync;
1289     struct v4l2_event_src_change src_change;
1290     struct v4l2_event_motion_det motion_det;
1291     __u8 data[64];
1292   } u;
1293   __u32 pending;
1294   __u32 sequence;
1295   struct timespec timestamp;
1296   __u32 id;
1297   __u32 reserved[8];
1298 };
1299 #define V4L2_EVENT_SUB_FL_SEND_INITIAL (1 << 0)
1300 #define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK (1 << 1)
1301 struct v4l2_event_subscription {
1302   __u32 type;
1303   __u32 id;
1304   __u32 flags;
1305   __u32 reserved[5];
1306 };
1307 #define V4L2_CHIP_MATCH_BRIDGE 0
1308 #define V4L2_CHIP_MATCH_SUBDEV 4
1309 #define V4L2_CHIP_MATCH_HOST V4L2_CHIP_MATCH_BRIDGE
1310 #define V4L2_CHIP_MATCH_I2C_DRIVER 1
1311 #define V4L2_CHIP_MATCH_I2C_ADDR 2
1312 #define V4L2_CHIP_MATCH_AC97 3
1313 struct v4l2_dbg_match {
1314   __u32 type;
1315   union {
1316     __u32 addr;
1317     char name[32];
1318   };
1319 } __attribute__((packed));
1320 struct v4l2_dbg_register {
1321   struct v4l2_dbg_match match;
1322   __u32 size;
1323   __u64 reg;
1324   __u64 val;
1325 } __attribute__((packed));
1326 #define V4L2_CHIP_FL_READABLE (1 << 0)
1327 #define V4L2_CHIP_FL_WRITABLE (1 << 1)
1328 struct v4l2_dbg_chip_info {
1329   struct v4l2_dbg_match match;
1330   char name[32];
1331   __u32 flags;
1332   __u32 reserved[32];
1333 } __attribute__((packed));
1334 struct v4l2_create_buffers {
1335   __u32 index;
1336   __u32 count;
1337   __u32 memory;
1338   struct v4l2_format format;
1339   __u32 capabilities;
1340   __u32 reserved[7];
1341 };
1342 #define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability)
1343 #define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc)
1344 #define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format)
1345 #define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format)
1346 #define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers)
1347 #define VIDIOC_QUERYBUF _IOWR('V', 9, struct v4l2_buffer)
1348 #define VIDIOC_G_FBUF _IOR('V', 10, struct v4l2_framebuffer)
1349 #define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer)
1350 #define VIDIOC_OVERLAY _IOW('V', 14, int)
1351 #define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer)
1352 #define VIDIOC_EXPBUF _IOWR('V', 16, struct v4l2_exportbuffer)
1353 #define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer)
1354 #define VIDIOC_STREAMON _IOW('V', 18, int)
1355 #define VIDIOC_STREAMOFF _IOW('V', 19, int)
1356 #define VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm)
1357 #define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm)
1358 #define VIDIOC_G_STD _IOR('V', 23, v4l2_std_id)
1359 #define VIDIOC_S_STD _IOW('V', 24, v4l2_std_id)
1360 #define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard)
1361 #define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input)
1362 #define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control)
1363 #define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control)
1364 #define VIDIOC_G_TUNER _IOWR('V', 29, struct v4l2_tuner)
1365 #define VIDIOC_S_TUNER _IOW('V', 30, struct v4l2_tuner)
1366 #define VIDIOC_G_AUDIO _IOR('V', 33, struct v4l2_audio)
1367 #define VIDIOC_S_AUDIO _IOW('V', 34, struct v4l2_audio)
1368 #define VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl)
1369 #define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu)
1370 #define VIDIOC_G_INPUT _IOR('V', 38, int)
1371 #define VIDIOC_S_INPUT _IOWR('V', 39, int)
1372 #define VIDIOC_G_EDID _IOWR('V', 40, struct v4l2_edid)
1373 #define VIDIOC_S_EDID _IOWR('V', 41, struct v4l2_edid)
1374 #define VIDIOC_G_OUTPUT _IOR('V', 46, int)
1375 #define VIDIOC_S_OUTPUT _IOWR('V', 47, int)
1376 #define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output)
1377 #define VIDIOC_G_AUDOUT _IOR('V', 49, struct v4l2_audioout)
1378 #define VIDIOC_S_AUDOUT _IOW('V', 50, struct v4l2_audioout)
1379 #define VIDIOC_G_MODULATOR _IOWR('V', 54, struct v4l2_modulator)
1380 #define VIDIOC_S_MODULATOR _IOW('V', 55, struct v4l2_modulator)
1381 #define VIDIOC_G_FREQUENCY _IOWR('V', 56, struct v4l2_frequency)
1382 #define VIDIOC_S_FREQUENCY _IOW('V', 57, struct v4l2_frequency)
1383 #define VIDIOC_CROPCAP _IOWR('V', 58, struct v4l2_cropcap)
1384 #define VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop)
1385 #define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop)
1386 #define VIDIOC_G_JPEGCOMP _IOR('V', 61, struct v4l2_jpegcompression)
1387 #define VIDIOC_S_JPEGCOMP _IOW('V', 62, struct v4l2_jpegcompression)
1388 #define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id)
1389 #define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format)
1390 #define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio)
1391 #define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout)
1392 #define VIDIOC_G_PRIORITY _IOR('V', 67, __u32)
1393 #define VIDIOC_S_PRIORITY _IOW('V', 68, __u32)
1394 #define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap)
1395 #define VIDIOC_LOG_STATUS _IO('V', 70)
1396 #define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls)
1397 #define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls)
1398 #define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls)
1399 #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)
1400 #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
1401 #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx)
1402 #define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd)
1403 #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd)
1404 #define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
1405 #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
1406 #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
1407 #define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
1408 #define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
1409 #define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
1410 #define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
1411 #define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
1412 #define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
1413 #define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer)
1414 #define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection)
1415 #define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection)
1416 #define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd)
1417 #define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd)
1418 #define VIDIOC_ENUM_DV_TIMINGS _IOWR('V', 98, struct v4l2_enum_dv_timings)
1419 #define VIDIOC_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings)
1420 #define VIDIOC_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap)
1421 #define VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band)
1422 #define VIDIOC_DBG_G_CHIP_INFO _IOWR('V', 102, struct v4l2_dbg_chip_info)
1423 #define VIDIOC_QUERY_EXT_CTRL _IOWR('V', 103, struct v4l2_query_ext_ctrl)
1424 #define BASE_VIDIOC_PRIVATE 192
1425 #endif
1426