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