xref: /freebsd/sys/dev/usb/video/uvideo_v4l2.h (revision 8bc06ffbbd80533eda0784d2a6f5a1476f9d550c)
1 /*-
2  * SPDX-License-Identifier: BSD-3-Clause
3  *
4  *  Video for Linux Two header file
5  *
6  *  Copyright (C) 1999-2012 the contributors
7  *  Copyright (C) 2012 Nokia Corporation
8  *  Contact: Sakari Ailus <sakari.ailus@iki.fi>
9  *
10  *  Redistribution and use in source and binary forms, with or without
11  *  modification, are permitted provided that the following conditions
12  *  are met:
13  *  1. Redistributions of source code must retain the above copyright
14  *     notice, this list of conditions and the following disclaimer.
15  *  2. Redistributions in binary form must reproduce the above copyright
16  *     notice, this list of conditions and the following disclaimer in
17  *     the documentation and/or other materials provided with the
18  *     distribution.
19  *  3. The names of its contributors may not be used to endorse or promote
20  *     products derived from this software without specific prior written
21  *     permission.
22  *
23  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29  *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30  *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31  *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35  *  Minimal V4L2 definitions for the FreeBSD UVC driver.
36  *  Extracted from OpenBSD sys/videoio.h.
37  */
38 
39 #ifndef _UVIDEO_V4L2_H_
40 #define _UVIDEO_V4L2_H_
41 
42 #include <sys/types.h>
43 #include <sys/ioccom.h>
44 #include <sys/time.h>
45 
46 /*
47  *  Four-character-code (FOURCC)
48  */
49 #define v4l2_fourcc(a, b, c, d)	\
50 	((u_int32_t)(a) | ((u_int32_t)(b) << 8) | \
51 	 ((u_int32_t)(c) << 16) | ((u_int32_t)(d) << 24))
52 
53 /*
54  *  Enums
55  */
56 enum v4l2_field {
57 	V4L2_FIELD_ANY           = 0,
58 	V4L2_FIELD_NONE          = 1,
59 	V4L2_FIELD_TOP           = 2,
60 	V4L2_FIELD_BOTTOM        = 3,
61 	V4L2_FIELD_INTERLACED    = 4,
62 	V4L2_FIELD_SEQ_TB        = 5,
63 	V4L2_FIELD_SEQ_BT        = 6,
64 	V4L2_FIELD_ALTERNATE     = 7,
65 	V4L2_FIELD_INTERLACED_TB = 8,
66 	V4L2_FIELD_INTERLACED_BT = 9,
67 };
68 
69 enum v4l2_buf_type {
70 	V4L2_BUF_TYPE_VIDEO_CAPTURE        = 1,
71 	V4L2_BUF_TYPE_VIDEO_OUTPUT         = 2,
72 	V4L2_BUF_TYPE_VIDEO_OVERLAY        = 3,
73 	V4L2_BUF_TYPE_VBI_CAPTURE          = 4,
74 	V4L2_BUF_TYPE_VBI_OUTPUT           = 5,
75 	V4L2_BUF_TYPE_SLICED_VBI_CAPTURE   = 6,
76 	V4L2_BUF_TYPE_SLICED_VBI_OUTPUT    = 7,
77 	V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
78 	V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
79 	V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE  = 10,
80 	V4L2_BUF_TYPE_SDR_CAPTURE          = 11,
81 	V4L2_BUF_TYPE_SDR_OUTPUT           = 12,
82 	V4L2_BUF_TYPE_META_CAPTURE         = 13,
83 	V4L2_BUF_TYPE_META_OUTPUT          = 14,
84 	/* Deprecated, do not use */
85 	V4L2_BUF_TYPE_PRIVATE              = 0x80,
86 };
87 
88 enum v4l2_memory {
89 	V4L2_MEMORY_MMAP             = 1,
90 	V4L2_MEMORY_USERPTR          = 2,
91 	V4L2_MEMORY_OVERLAY          = 3,
92 	V4L2_MEMORY_DMABUF           = 4,
93 };
94 
95 enum v4l2_colorspace {
96 	V4L2_COLORSPACE_DEFAULT       = 0,
97 	V4L2_COLORSPACE_SMPTE170M     = 1,
98 	V4L2_COLORSPACE_SMPTE240M     = 2,
99 	V4L2_COLORSPACE_REC709        = 3,
100 	V4L2_COLORSPACE_BT878         = 4,
101 	V4L2_COLORSPACE_470_SYSTEM_M  = 5,
102 	V4L2_COLORSPACE_470_SYSTEM_BG = 6,
103 	V4L2_COLORSPACE_JPEG          = 7,
104 	V4L2_COLORSPACE_SRGB          = 8,
105 	V4L2_COLORSPACE_OPRGB         = 9,
106 	V4L2_COLORSPACE_BT2020        = 10,
107 	V4L2_COLORSPACE_RAW           = 11,
108 	V4L2_COLORSPACE_DCI_P3        = 12,
109 };
110 
111 enum v4l2_xfer_func {
112 	V4L2_XFER_FUNC_DEFAULT     = 0,
113 	V4L2_XFER_FUNC_709         = 1,
114 	V4L2_XFER_FUNC_SRGB        = 2,
115 	V4L2_XFER_FUNC_OPRGB       = 3,
116 	V4L2_XFER_FUNC_SMPTE240M   = 4,
117 	V4L2_XFER_FUNC_NONE        = 5,
118 	V4L2_XFER_FUNC_DCI_P3      = 6,
119 	V4L2_XFER_FUNC_SMPTE2084   = 7,
120 };
121 
122 enum v4l2_ycbcr_encoding {
123 	V4L2_YCBCR_ENC_DEFAULT        = 0,
124 	V4L2_YCBCR_ENC_601            = 1,
125 	V4L2_YCBCR_ENC_709            = 2,
126 	V4L2_YCBCR_ENC_XV601          = 3,
127 	V4L2_YCBCR_ENC_XV709          = 4,
128 	V4L2_YCBCR_ENC_SYCC           = 5,
129 	V4L2_YCBCR_ENC_BT2020         = 6,
130 	V4L2_YCBCR_ENC_BT2020_CONST_LUM = 7,
131 	V4L2_YCBCR_ENC_SMPTE240M      = 8,
132 };
133 
134 enum v4l2_ctrl_type {
135 	V4L2_CTRL_TYPE_INTEGER       = 1,
136 	V4L2_CTRL_TYPE_BOOLEAN       = 2,
137 	V4L2_CTRL_TYPE_MENU          = 3,
138 	V4L2_CTRL_TYPE_BUTTON        = 4,
139 	V4L2_CTRL_TYPE_INTEGER64     = 5,
140 	V4L2_CTRL_TYPE_CTRL_CLASS    = 6,
141 	V4L2_CTRL_TYPE_STRING        = 7,
142 	V4L2_CTRL_TYPE_BITMASK       = 8,
143 	V4L2_CTRL_TYPE_INTEGER_MENU  = 9,
144 };
145 
146 enum v4l2_frmsizetypes {
147 	V4L2_FRMSIZE_TYPE_DISCRETE   = 1,
148 	V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
149 	V4L2_FRMSIZE_TYPE_STEPWISE   = 3,
150 };
151 
152 enum v4l2_frmivaltypes {
153 	V4L2_FRMIVAL_TYPE_DISCRETE   = 1,
154 	V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
155 	V4L2_FRMIVAL_TYPE_STEPWISE   = 3,
156 };
157 
158 /*
159  *  Structures
160  */
161 struct v4l2_fract {
162 	u_int32_t   numerator;
163 	u_int32_t   denominator;
164 };
165 
166 struct v4l2_capability {
167 	u_int8_t	driver[16];
168 	u_int8_t	card[32];
169 	u_int8_t	bus_info[32];
170 	u_int32_t	version;
171 	u_int32_t	capabilities;
172 	u_int32_t	device_caps;
173 	u_int32_t	reserved[3];
174 };
175 
176 struct v4l2_pix_format {
177 	u_int32_t		width;
178 	u_int32_t		height;
179 	u_int32_t		pixelformat;
180 	u_int32_t		field;		/* enum v4l2_field */
181 	u_int32_t		bytesperline;	/* for padding, zero if unused */
182 	u_int32_t		sizeimage;
183 	u_int32_t		colorspace;	/* enum v4l2_colorspace */
184 	u_int32_t		priv;		/* private data, depends on pixelformat */
185 	u_int32_t		flags;		/* format flags (V4L2_PIX_FMT_FLAG_*) */
186 	union {
187 		/* enum v4l2_ycbcr_encoding */
188 		u_int32_t	ycbcr_enc;
189 		/* enum v4l2_hsv_encoding */
190 		u_int32_t	hsv_enc;
191 	};
192 	u_int32_t		quantization;	/* enum v4l2_quantization */
193 	u_int32_t		xfer_func;	/* enum v4l2_xfer_func */
194 };
195 
196 /*
197  * v4l2_format: the system header (v4l_compat) includes struct v4l2_window
198  * (which contains a pointer) in the fmt union, forcing 8-byte alignment.
199  * This creates 4 bytes of implicit padding after 'type' on LP64.
200  * We must match this layout for ioctl ABI compatibility.
201  * Total size: 4 (type) + 4 (pad) + 200 (union) = 208.
202  */
203 struct v4l2_format {
204 	u_int32_t	type;
205 	u_int32_t	_pad;
206 	union {
207 		struct v4l2_pix_format	pix;
208 		u_int8_t		raw_data[200];
209 	} fmt;
210 };
211 
212 struct v4l2_fmtdesc {
213 	u_int32_t		index;		/* Format number      */
214 	u_int32_t		type;		/* enum v4l2_buf_type */
215 	u_int32_t		flags;
216 	u_int8_t		description[32]; /* Description string */
217 	u_int32_t		pixelformat;	/* Format fourcc      */
218 	u_int32_t		mbus_code;	/* Media bus code    */
219 	u_int32_t		reserved[3];
220 };
221 
222 struct v4l2_timecode {
223 	u_int32_t	type;
224 	u_int32_t	flags;
225 	u_int8_t	frames;
226 	u_int8_t	seconds;
227 	u_int8_t	minutes;
228 	u_int8_t	hours;
229 	u_int8_t	userbits[4];
230 };
231 
232 struct v4l2_buffer {
233 	u_int32_t			index;
234 	u_int32_t			type;
235 	u_int32_t			bytesused;
236 	u_int32_t			flags;
237 	u_int32_t			field;
238 	struct timeval			timestamp;
239 	struct v4l2_timecode		timecode;
240 	u_int32_t			sequence;
241 
242 	/* memory location */
243 	u_int32_t			memory;
244 	union {
245 		u_int32_t		offset;
246 		unsigned long		userptr;
247 		int32_t			fd;
248 	} m;
249 	u_int32_t			length;
250 	u_int32_t			reserved2;
251 	union {
252 		int32_t			request_fd;
253 		u_int32_t		reserved;
254 	};
255 };
256 
257 struct v4l2_requestbuffers {
258 	u_int32_t		count;
259 	u_int32_t		type;		/* enum v4l2_buf_type */
260 	u_int32_t		memory;		/* enum v4l2_memory */
261 	u_int32_t		capabilities;
262 	u_int8_t		flags;
263 	u_int8_t		reserved[3];
264 };
265 
266 struct v4l2_captureparm {
267 	u_int32_t		capability;	/*  Supported modes */
268 	u_int32_t		capturemode;	/*  Current mode */
269 	struct v4l2_fract	timeperframe;	/*  Time per frame in seconds */
270 	u_int32_t		extendedmode;	/*  Driver-specific extensions */
271 	u_int32_t		readbuffers;	/*  # of buffers for read */
272 	u_int32_t		reserved[4];
273 };
274 
275 /* Simplified v4l2_streamparm: only the capture member is included */
276 struct v4l2_streamparm {
277 	u_int32_t	type;			/* enum v4l2_buf_type */
278 	union {
279 		struct v4l2_captureparm	capture;
280 		u_int8_t		raw_data[200];
281 	} parm;
282 };
283 
284 struct v4l2_input {
285 	u_int32_t	index;		/*  Which input */
286 	u_int8_t	name[32];	/*  Label */
287 	u_int32_t	type;		/*  Type of input */
288 	u_int32_t	audioset;	/*  Associated audios (bitfield) */
289 	u_int32_t	tuner;		/*  Tuner index */
290 	u_int64_t	std;
291 	u_int32_t	status;
292 	u_int32_t	capabilities;
293 	u_int32_t	reserved[3];
294 };
295 
296 struct v4l2_control {
297 	u_int32_t	id;
298 	int32_t		value;
299 };
300 
301 struct v4l2_queryctrl {
302 	u_int32_t	id;
303 	u_int32_t	type;		/* enum v4l2_ctrl_type */
304 	u_int8_t	name[32];	/* Whatever */
305 	int32_t		minimum;	/* Note signedness */
306 	int32_t		maximum;
307 	int32_t		step;
308 	int32_t		default_value;
309 	u_int32_t	flags;
310 	u_int32_t	reserved[2];
311 };
312 
313 struct v4l2_frmsize_discrete {
314 	u_int32_t	width;		/* Frame width [pixel] */
315 	u_int32_t	height;		/* Frame height [pixel] */
316 };
317 
318 struct v4l2_frmsize_stepwise {
319 	u_int32_t	min_width;	/* Minimum frame width [pixel] */
320 	u_int32_t	max_width;	/* Maximum frame width [pixel] */
321 	u_int32_t	step_width;	/* Frame width step size [pixel] */
322 	u_int32_t	min_height;	/* Minimum frame height [pixel] */
323 	u_int32_t	max_height;	/* Maximum frame height [pixel] */
324 	u_int32_t	step_height;	/* Frame height step size [pixel] */
325 };
326 
327 struct v4l2_frmsizeenum {
328 	u_int32_t	index;		/* Frame size number */
329 	u_int32_t	pixel_format;	/* Pixel format */
330 	u_int32_t	type;		/* Frame size type the device supports. */
331 
332 	union {				/* Frame size */
333 		struct v4l2_frmsize_discrete	discrete;
334 		struct v4l2_frmsize_stepwise	stepwise;
335 	};
336 
337 	u_int32_t	reserved[2];	/* Reserved space for future use */
338 };
339 
340 struct v4l2_frmival_stepwise {
341 	struct v4l2_fract	min;	/* Minimum frame interval [s] */
342 	struct v4l2_fract	max;	/* Maximum frame interval [s] */
343 	struct v4l2_fract	step;	/* Frame interval step size [s] */
344 };
345 
346 struct v4l2_frmivalenum {
347 	u_int32_t	index;		/* Frame format index */
348 	u_int32_t	pixel_format;	/* Pixel format */
349 	u_int32_t	width;		/* Frame width */
350 	u_int32_t	height;		/* Frame height */
351 	u_int32_t	type;		/* Frame interval type the device supports. */
352 
353 	union {				/* Frame interval */
354 		struct v4l2_fract		discrete;
355 		struct v4l2_frmival_stepwise	stepwise;
356 	};
357 
358 	u_int32_t	reserved[2];	/* Reserved space for future use */
359 };
360 
361 /*
362  *  Pixel formats
363  */
364 
365 /* Luminance+Chrominance formats */
366 #define V4L2_PIX_FMT_YUYV	v4l2_fourcc('Y', 'U', 'Y', 'V')
367 #define V4L2_PIX_FMT_UYVY	v4l2_fourcc('U', 'Y', 'V', 'Y')
368 #define V4L2_PIX_FMT_NV12	v4l2_fourcc('N', 'V', '1', '2')
369 #define V4L2_PIX_FMT_NV21	v4l2_fourcc('N', 'V', '2', '1')
370 #define V4L2_PIX_FMT_M420	v4l2_fourcc('M', '4', '2', '0')
371 #define V4L2_PIX_FMT_YVU420	v4l2_fourcc('Y', 'V', '1', '2')
372 #define V4L2_PIX_FMT_YUV420	v4l2_fourcc('Y', 'U', '1', '2')
373 
374 /* Compressed formats */
375 #define V4L2_PIX_FMT_MJPEG	v4l2_fourcc('M', 'J', 'P', 'G')
376 #define V4L2_PIX_FMT_H264	v4l2_fourcc('H', '2', '6', '4')
377 #define V4L2_PIX_FMT_HEVC	v4l2_fourcc('H', 'E', 'V', 'C')
378 
379 /* Grey formats */
380 #define V4L2_PIX_FMT_GREY	v4l2_fourcc('G', 'R', 'E', 'Y')
381 #define V4L2_PIX_FMT_Y10	v4l2_fourcc('Y', '1', '0', ' ')
382 #define V4L2_PIX_FMT_Y12	v4l2_fourcc('Y', '1', '2', ' ')
383 #define V4L2_PIX_FMT_Y16	v4l2_fourcc('Y', '1', '6', ' ')
384 
385 /* RGB formats */
386 #define V4L2_PIX_FMT_RGB565	v4l2_fourcc('R', 'G', 'B', 'P')
387 #define V4L2_PIX_FMT_BGR24	v4l2_fourcc('B', 'G', 'R', '3')
388 #define V4L2_PIX_FMT_XBGR32	v4l2_fourcc('X', 'R', '2', '4')
389 
390 /* Bayer formats */
391 #define V4L2_PIX_FMT_SBGGR8	v4l2_fourcc('B', 'A', '8', '1')
392 #define V4L2_PIX_FMT_SGBRG8	v4l2_fourcc('G', 'B', 'R', 'G')
393 #define V4L2_PIX_FMT_SGRBG8	v4l2_fourcc('G', 'R', 'B', 'G')
394 #define V4L2_PIX_FMT_SRGGB8	v4l2_fourcc('R', 'G', 'G', 'B')
395 #define V4L2_PIX_FMT_SBGGR16	v4l2_fourcc('B', 'Y', 'R', '2')
396 #define V4L2_PIX_FMT_SGBRG16	v4l2_fourcc('G', 'B', '1', '6')
397 #define V4L2_PIX_FMT_SRGGB16	v4l2_fourcc('R', 'G', '1', '6')
398 #define V4L2_PIX_FMT_SGRBG16	v4l2_fourcc('G', 'R', '1', '6')
399 #define V4L2_PIX_FMT_SRGGB10P	v4l2_fourcc('p', 'R', 'A', 'A')
400 
401 /* Depth format */
402 #define V4L2_PIX_FMT_Z16	v4l2_fourcc('Z', '1', '6', ' ')
403 
404 /*
405  *  Capability flags
406  */
407 #define V4L2_CAP_VIDEO_CAPTURE		0x00000001
408 #define V4L2_CAP_STREAMING		0x04000000
409 #define V4L2_CAP_EXT_PIX_FORMAT		0x00200000
410 #define V4L2_CAP_READWRITE		0x01000000
411 #define V4L2_CAP_DEVICE_CAPS		0x80000000
412 #define V4L2_CAP_TIMEPERFRAME		0x1000
413 
414 /*
415  *  Buffer flags
416  */
417 #define V4L2_BUF_FLAG_MAPPED		0x00000001
418 #define V4L2_BUF_FLAG_QUEUED		0x00000002
419 #define V4L2_BUF_FLAG_DONE		0x00000004
420 #define V4L2_BUF_FLAG_ERROR		0x00000040
421 #define V4L2_BUF_FLAG_TIMESTAMP_MASK	0x0000e000
422 #define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x00002000
423 #define V4L2_BUF_FLAG_TSTAMP_SRC_MASK	0x00070000
424 #define V4L2_BUF_FLAG_TSTAMP_SRC_EOF	0x00000000
425 #define V4L2_BUF_FLAG_TIMECODE		0x00000100
426 
427 /*
428  *  Format flags
429  */
430 #define V4L2_FMT_FLAG_COMPRESSED	0x0001
431 
432 /*
433  *  Buffer capabilities
434  */
435 #define V4L2_BUF_CAP_SUPPORTS_MMAP	(1 << 0)
436 
437 /*
438  *  Input types
439  */
440 #define V4L2_INPUT_TYPE_CAMERA		2
441 
442 /*
443  *  Control IDs
444  */
445 #define V4L2_CTRL_CLASS_USER		0x00980000
446 #define V4L2_CID_BASE			(V4L2_CTRL_CLASS_USER | 0x900)
447 #define V4L2_CID_BRIGHTNESS		(V4L2_CID_BASE + 0)
448 #define V4L2_CID_CONTRAST		(V4L2_CID_BASE + 1)
449 #define V4L2_CID_SATURATION		(V4L2_CID_BASE + 2)
450 #define V4L2_CID_HUE			(V4L2_CID_BASE + 3)
451 #define V4L2_CID_AUTO_WHITE_BALANCE	(V4L2_CID_BASE + 12)
452 #define V4L2_CID_RED_BALANCE		(V4L2_CID_BASE + 14)
453 #define V4L2_CID_BLUE_BALANCE		(V4L2_CID_BASE + 15)
454 #define V4L2_CID_GAMMA			(V4L2_CID_BASE + 16)
455 #define V4L2_CID_GAIN			(V4L2_CID_BASE + 19)
456 #define V4L2_CID_POWER_LINE_FREQUENCY	(V4L2_CID_BASE + 24)
457 #define V4L2_CID_HUE_AUTO		(V4L2_CID_BASE + 25)
458 #define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE + 26)
459 #define V4L2_CID_SHARPNESS		(V4L2_CID_BASE + 27)
460 #define V4L2_CID_BACKLIGHT_COMPENSATION	(V4L2_CID_BASE + 28)
461 
462 #define V4L2_CID_CAMERA_CLASS_BASE	0x009a0000
463 #define V4L2_CID_EXPOSURE_AUTO		(V4L2_CID_CAMERA_CLASS_BASE + 1)
464 #define V4L2_CID_EXPOSURE_ABSOLUTE	(V4L2_CID_CAMERA_CLASS_BASE + 2)
465 #define V4L2_CID_EXPOSURE_AUTO_PRIORITY	(V4L2_CID_CAMERA_CLASS_BASE + 3)
466 #define V4L2_CID_FOCUS_ABSOLUTE		(V4L2_CID_CAMERA_CLASS_BASE + 4)
467 #define V4L2_CID_FOCUS_RELATIVE		(V4L2_CID_CAMERA_CLASS_BASE + 5)
468 #define V4L2_CID_PAN_ABSOLUTE		(V4L2_CID_CAMERA_CLASS_BASE + 8)
469 #define V4L2_CID_TILT_ABSOLUTE		(V4L2_CID_CAMERA_CLASS_BASE + 9)
470 #define V4L2_CID_FOCUS_AUTO		(V4L2_CID_CAMERA_CLASS_BASE + 12)
471 #define V4L2_CID_ZOOM_ABSOLUTE		(V4L2_CID_CAMERA_CLASS_BASE + 13)
472 #define V4L2_CID_ZOOM_CONTINUOUS	(V4L2_CID_CAMERA_CLASS_BASE + 15)
473 #define V4L2_CID_PRIVACY		(V4L2_CID_CAMERA_CLASS_BASE + 16)
474 
475 /*
476  *  V4L2 ioctl definitions
477  */
478 #define VIDIOC_QUERYCAP		_IOR('V',  0, struct v4l2_capability)
479 #define VIDIOC_ENUM_FMT		_IOWR('V',  2, struct v4l2_fmtdesc)
480 #define VIDIOC_G_FMT		_IOWR('V',  4, struct v4l2_format)
481 #define VIDIOC_S_FMT		_IOWR('V',  5, struct v4l2_format)
482 #define VIDIOC_REQBUFS		_IOWR('V',  8, struct v4l2_requestbuffers)
483 #define VIDIOC_QUERYBUF		_IOWR('V',  9, struct v4l2_buffer)
484 #define VIDIOC_QBUF		_IOWR('V', 15, struct v4l2_buffer)
485 #define VIDIOC_DQBUF		_IOWR('V', 17, struct v4l2_buffer)
486 #define VIDIOC_STREAMON		_IOW('V', 18, int)
487 #define VIDIOC_STREAMOFF	_IOW('V', 19, int)
488 #define VIDIOC_G_PARM		_IOWR('V', 21, struct v4l2_streamparm)
489 #define VIDIOC_S_PARM		_IOWR('V', 22, struct v4l2_streamparm)
490 #define VIDIOC_ENUMINPUT	_IOWR('V', 26, struct v4l2_input)
491 #define VIDIOC_G_CTRL		_IOWR('V', 27, struct v4l2_control)
492 #define VIDIOC_S_CTRL		_IOWR('V', 28, struct v4l2_control)
493 #define VIDIOC_QUERYCTRL	_IOWR('V', 36, struct v4l2_queryctrl)
494 #define VIDIOC_G_INPUT		_IOR('V', 38, int)
495 #define VIDIOC_S_INPUT		_IOWR('V', 39, int)
496 #define VIDIOC_G_PRIORITY	_IOR('V', 67, u_int32_t)
497 #define VIDIOC_S_PRIORITY	_IOW('V', 68, u_int32_t)
498 #define VIDIOC_TRY_FMT		_IOWR('V', 64, struct v4l2_format)
499 #define VIDIOC_ENUM_FRAMESIZES	_IOWR('V', 74, struct v4l2_frmsizeenum)
500 #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
501 
502 #endif /* _UVIDEO_V4L2_H_ */
503