• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Broadcom BM2835 V4L2 driver
4  *
5  * Copyright © 2013 Raspberry Pi (Trading) Ltd.
6  *
7  * Authors: Vincent Sanders @ Collabora
8  *          Dave Stevenson @ Broadcom
9  *		(now dave.stevenson@raspberrypi.org)
10  *          Simon Mellor @ Broadcom
11  *          Luke Diamand @ Broadcom
12  */
13 
14 /* common parameters */
15 
16 /** @name Parameter groups
17  * Parameters are divided into groups, and then allocated sequentially within
18  * a group using an enum.
19  * @{
20  */
21 
22 #ifndef MMAL_PARAMETERS_H
23 #define MMAL_PARAMETERS_H
24 
25 /** Common parameter ID group, used with many types of component. */
26 #define MMAL_PARAMETER_GROUP_COMMON		(0 << 16)
27 /** Camera-specific parameter ID group. */
28 #define MMAL_PARAMETER_GROUP_CAMERA		(1 << 16)
29 /** Video-specific parameter ID group. */
30 #define MMAL_PARAMETER_GROUP_VIDEO		(2 << 16)
31 /** Audio-specific parameter ID group. */
32 #define MMAL_PARAMETER_GROUP_AUDIO		(3 << 16)
33 /** Clock-specific parameter ID group. */
34 #define MMAL_PARAMETER_GROUP_CLOCK		(4 << 16)
35 /** Miracast-specific parameter ID group. */
36 #define MMAL_PARAMETER_GROUP_MIRACAST		(5 << 16)
37 
38 /* Common parameters */
39 enum mmal_parameter_common_type {
40 	/**< Never a valid parameter ID */
41 	MMAL_PARAMETER_UNUSED = MMAL_PARAMETER_GROUP_COMMON,
42 
43 		/**< MMAL_PARAMETER_ENCODING_T */
44 	MMAL_PARAMETER_SUPPORTED_ENCODINGS,
45 		/**< MMAL_PARAMETER_URI_T */
46 	MMAL_PARAMETER_URI,
47 		/** MMAL_PARAMETER_CHANGE_EVENT_REQUEST_T */
48 	MMAL_PARAMETER_CHANGE_EVENT_REQUEST,
49 		/** MMAL_PARAMETER_BOOLEAN_T */
50 	MMAL_PARAMETER_ZERO_COPY,
51 		/**< MMAL_PARAMETER_BUFFER_REQUIREMENTS_T */
52 	MMAL_PARAMETER_BUFFER_REQUIREMENTS,
53 		/**< MMAL_PARAMETER_STATISTICS_T */
54 	MMAL_PARAMETER_STATISTICS,
55 		/**< MMAL_PARAMETER_CORE_STATISTICS_T */
56 	MMAL_PARAMETER_CORE_STATISTICS,
57 		/**< MMAL_PARAMETER_MEM_USAGE_T */
58 	MMAL_PARAMETER_MEM_USAGE,
59 		/**< MMAL_PARAMETER_UINT32_T */
60 	MMAL_PARAMETER_BUFFER_FLAG_FILTER,
61 		/**< MMAL_PARAMETER_SEEK_T */
62 	MMAL_PARAMETER_SEEK,
63 		/**< MMAL_PARAMETER_BOOLEAN_T */
64 	MMAL_PARAMETER_POWERMON_ENABLE,
65 		/**< MMAL_PARAMETER_LOGGING_T */
66 	MMAL_PARAMETER_LOGGING,
67 		/**< MMAL_PARAMETER_UINT64_T */
68 	MMAL_PARAMETER_SYSTEM_TIME,
69 		/**< MMAL_PARAMETER_BOOLEAN_T */
70 	MMAL_PARAMETER_NO_IMAGE_PADDING,
71 };
72 
73 /* camera parameters */
74 
75 enum mmal_parameter_camera_type {
76 	/* 0 */
77 		/** @ref MMAL_PARAMETER_THUMBNAIL_CONFIG_T */
78 	MMAL_PARAMETER_THUMBNAIL_CONFIGURATION =
79 		MMAL_PARAMETER_GROUP_CAMERA,
80 		/**< Unused? */
81 	MMAL_PARAMETER_CAPTURE_QUALITY,
82 		/**< @ref MMAL_PARAMETER_INT32_T */
83 	MMAL_PARAMETER_ROTATION,
84 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
85 	MMAL_PARAMETER_EXIF_DISABLE,
86 		/**< @ref MMAL_PARAMETER_EXIF_T */
87 	MMAL_PARAMETER_EXIF,
88 		/**< @ref MMAL_PARAM_AWBMODE_T */
89 	MMAL_PARAMETER_AWB_MODE,
90 		/**< @ref MMAL_PARAMETER_IMAGEFX_T */
91 	MMAL_PARAMETER_IMAGE_EFFECT,
92 		/**< @ref MMAL_PARAMETER_COLOURFX_T */
93 	MMAL_PARAMETER_COLOUR_EFFECT,
94 		/**< @ref MMAL_PARAMETER_FLICKERAVOID_T */
95 	MMAL_PARAMETER_FLICKER_AVOID,
96 		/**< @ref MMAL_PARAMETER_FLASH_T */
97 	MMAL_PARAMETER_FLASH,
98 		/**< @ref MMAL_PARAMETER_REDEYE_T */
99 	MMAL_PARAMETER_REDEYE,
100 		/**< @ref MMAL_PARAMETER_FOCUS_T */
101 	MMAL_PARAMETER_FOCUS,
102 		/**< Unused? */
103 	MMAL_PARAMETER_FOCAL_LENGTHS,
104 		/**< @ref MMAL_PARAMETER_INT32_T */
105 	MMAL_PARAMETER_EXPOSURE_COMP,
106 		/**< @ref MMAL_PARAMETER_SCALEFACTOR_T */
107 	MMAL_PARAMETER_ZOOM,
108 		/**< @ref MMAL_PARAMETER_MIRROR_T */
109 	MMAL_PARAMETER_MIRROR,
110 
111 	/* 0x10 */
112 		/**< @ref MMAL_PARAMETER_UINT32_T */
113 	MMAL_PARAMETER_CAMERA_NUM,
114 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
115 	MMAL_PARAMETER_CAPTURE,
116 		/**< @ref MMAL_PARAMETER_EXPOSUREMODE_T */
117 	MMAL_PARAMETER_EXPOSURE_MODE,
118 		/**< @ref MMAL_PARAMETER_EXPOSUREMETERINGMODE_T */
119 	MMAL_PARAMETER_EXP_METERING_MODE,
120 		/**< @ref MMAL_PARAMETER_FOCUS_STATUS_T */
121 	MMAL_PARAMETER_FOCUS_STATUS,
122 		/**< @ref MMAL_PARAMETER_CAMERA_CONFIG_T */
123 	MMAL_PARAMETER_CAMERA_CONFIG,
124 		/**< @ref MMAL_PARAMETER_CAPTURE_STATUS_T */
125 	MMAL_PARAMETER_CAPTURE_STATUS,
126 		/**< @ref MMAL_PARAMETER_FACE_TRACK_T */
127 	MMAL_PARAMETER_FACE_TRACK,
128 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
129 	MMAL_PARAMETER_DRAW_BOX_FACES_AND_FOCUS,
130 		/**< @ref MMAL_PARAMETER_UINT32_T */
131 	MMAL_PARAMETER_JPEG_Q_FACTOR,
132 		/**< @ref MMAL_PARAMETER_FRAME_RATE_T */
133 	MMAL_PARAMETER_FRAME_RATE,
134 		/**< @ref MMAL_PARAMETER_CAMERA_STC_MODE_T */
135 	MMAL_PARAMETER_USE_STC,
136 		/**< @ref MMAL_PARAMETER_CAMERA_INFO_T */
137 	MMAL_PARAMETER_CAMERA_INFO,
138 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
139 	MMAL_PARAMETER_VIDEO_STABILISATION,
140 		/**< @ref MMAL_PARAMETER_FACE_TRACK_RESULTS_T */
141 	MMAL_PARAMETER_FACE_TRACK_RESULTS,
142 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
143 	MMAL_PARAMETER_ENABLE_RAW_CAPTURE,
144 
145 	/* 0x20 */
146 		/**< @ref MMAL_PARAMETER_URI_T */
147 	MMAL_PARAMETER_DPF_FILE,
148 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
149 	MMAL_PARAMETER_ENABLE_DPF_FILE,
150 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
151 	MMAL_PARAMETER_DPF_FAIL_IS_FATAL,
152 		/**< @ref MMAL_PARAMETER_CAPTUREMODE_T */
153 	MMAL_PARAMETER_CAPTURE_MODE,
154 		/**< @ref MMAL_PARAMETER_FOCUS_REGIONS_T */
155 	MMAL_PARAMETER_FOCUS_REGIONS,
156 		/**< @ref MMAL_PARAMETER_INPUT_CROP_T */
157 	MMAL_PARAMETER_INPUT_CROP,
158 		/**< @ref MMAL_PARAMETER_SENSOR_INFORMATION_T */
159 	MMAL_PARAMETER_SENSOR_INFORMATION,
160 		/**< @ref MMAL_PARAMETER_FLASH_SELECT_T */
161 	MMAL_PARAMETER_FLASH_SELECT,
162 		/**< @ref MMAL_PARAMETER_FIELD_OF_VIEW_T */
163 	MMAL_PARAMETER_FIELD_OF_VIEW,
164 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
165 	MMAL_PARAMETER_HIGH_DYNAMIC_RANGE,
166 		/**< @ref MMAL_PARAMETER_DRC_T */
167 	MMAL_PARAMETER_DYNAMIC_RANGE_COMPRESSION,
168 		/**< @ref MMAL_PARAMETER_ALGORITHM_CONTROL_T */
169 	MMAL_PARAMETER_ALGORITHM_CONTROL,
170 		/**< @ref MMAL_PARAMETER_RATIONAL_T */
171 	MMAL_PARAMETER_SHARPNESS,
172 		/**< @ref MMAL_PARAMETER_RATIONAL_T */
173 	MMAL_PARAMETER_CONTRAST,
174 		/**< @ref MMAL_PARAMETER_RATIONAL_T */
175 	MMAL_PARAMETER_BRIGHTNESS,
176 		/**< @ref MMAL_PARAMETER_RATIONAL_T */
177 	MMAL_PARAMETER_SATURATION,
178 
179 	/* 0x30 */
180 		/**< @ref MMAL_PARAMETER_UINT32_T */
181 	MMAL_PARAMETER_ISO,
182 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
183 	MMAL_PARAMETER_ANTISHAKE,
184 		/** @ref MMAL_PARAMETER_IMAGEFX_PARAMETERS_T */
185 	MMAL_PARAMETER_IMAGE_EFFECT_PARAMETERS,
186 		/** @ref MMAL_PARAMETER_BOOLEAN_T */
187 	MMAL_PARAMETER_CAMERA_BURST_CAPTURE,
188 		/** @ref MMAL_PARAMETER_UINT32_T */
189 	MMAL_PARAMETER_CAMERA_MIN_ISO,
190 		/** @ref MMAL_PARAMETER_CAMERA_USE_CASE_T */
191 	MMAL_PARAMETER_CAMERA_USE_CASE,
192 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
193 	MMAL_PARAMETER_CAPTURE_STATS_PASS,
194 		/** @ref MMAL_PARAMETER_UINT32_T */
195 	MMAL_PARAMETER_CAMERA_CUSTOM_SENSOR_CONFIG,
196 		/** @ref MMAL_PARAMETER_BOOLEAN_T */
197 	MMAL_PARAMETER_ENABLE_REGISTER_FILE,
198 		/** @ref MMAL_PARAMETER_BOOLEAN_T */
199 	MMAL_PARAMETER_REGISTER_FAIL_IS_FATAL,
200 		/** @ref MMAL_PARAMETER_CONFIGFILE_T */
201 	MMAL_PARAMETER_CONFIGFILE_REGISTERS,
202 		/** @ref MMAL_PARAMETER_CONFIGFILE_CHUNK_T */
203 	MMAL_PARAMETER_CONFIGFILE_CHUNK_REGISTERS,
204 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
205 	MMAL_PARAMETER_JPEG_ATTACH_LOG,
206 		/**< @ref MMAL_PARAMETER_ZEROSHUTTERLAG_T */
207 	MMAL_PARAMETER_ZERO_SHUTTER_LAG,
208 		/**< @ref MMAL_PARAMETER_FPS_RANGE_T */
209 	MMAL_PARAMETER_FPS_RANGE,
210 		/**< @ref MMAL_PARAMETER_INT32_T */
211 	MMAL_PARAMETER_CAPTURE_EXPOSURE_COMP,
212 
213 	/* 0x40 */
214 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
215 	MMAL_PARAMETER_SW_SHARPEN_DISABLE,
216 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
217 	MMAL_PARAMETER_FLASH_REQUIRED,
218 		/**< @ref MMAL_PARAMETER_BOOLEAN_T */
219 	MMAL_PARAMETER_SW_SATURATION_DISABLE,
220 		/**< Takes a @ref MMAL_PARAMETER_UINT32_T */
221 	MMAL_PARAMETER_SHUTTER_SPEED,
222 		/**< Takes a @ref MMAL_PARAMETER_AWB_GAINS_T */
223 	MMAL_PARAMETER_CUSTOM_AWB_GAINS,
224 };
225 
226 struct mmal_parameter_rational {
227 	s32 num;    /**< Numerator */
228 	s32 den;    /**< Denominator */
229 };
230 
231 enum mmal_parameter_camera_config_timestamp_mode {
232 	MMAL_PARAM_TIMESTAMP_MODE_ZERO = 0, /* Always timestamp frames as 0 */
233 	MMAL_PARAM_TIMESTAMP_MODE_RAW_STC,  /* Use the raw STC value
234 					     * for the frame timestamp
235 					     */
236 	MMAL_PARAM_TIMESTAMP_MODE_RESET_STC, /* Use the STC timestamp
237 					      * but subtract the
238 					      * timestamp of the first
239 					      * frame sent to give a
240 					      * zero based timestamp.
241 					      */
242 };
243 
244 struct mmal_parameter_fps_range {
245 	/**< Low end of the permitted framerate range */
246 	struct mmal_parameter_rational	fps_low;
247 	/**< High end of the permitted framerate range */
248 	struct mmal_parameter_rational	fps_high;
249 };
250 
251 /* camera configuration parameter */
252 struct mmal_parameter_camera_config {
253 	/* Parameters for setting up the image pools */
254 	u32 max_stills_w; /* Max size of stills capture */
255 	u32 max_stills_h;
256 	u32 stills_yuv422; /* Allow YUV422 stills capture */
257 	u32 one_shot_stills; /* Continuous or one shot stills captures. */
258 
259 	u32 max_preview_video_w; /* Max size of the preview or video
260 				  * capture frames
261 				  */
262 	u32 max_preview_video_h;
263 	u32 num_preview_video_frames;
264 
265 	/** Sets the height of the circular buffer for stills capture. */
266 	u32 stills_capture_circular_buffer_height;
267 
268 	/** Allows preview/encode to resume as fast as possible after the stills
269 	 * input frame has been received, and then processes the still frame in
270 	 * the background whilst preview/encode has resumed.
271 	 * Actual mode is controlled by MMAL_PARAMETER_CAPTURE_MODE.
272 	 */
273 	u32 fast_preview_resume;
274 
275 	/** Selects algorithm for timestamping frames if
276 	 * there is no clock component connected.
277 	 * enum mmal_parameter_camera_config_timestamp_mode
278 	 */
279 	s32 use_stc_timestamp;
280 };
281 
282 enum mmal_parameter_exposuremode {
283 	MMAL_PARAM_EXPOSUREMODE_OFF,
284 	MMAL_PARAM_EXPOSUREMODE_AUTO,
285 	MMAL_PARAM_EXPOSUREMODE_NIGHT,
286 	MMAL_PARAM_EXPOSUREMODE_NIGHTPREVIEW,
287 	MMAL_PARAM_EXPOSUREMODE_BACKLIGHT,
288 	MMAL_PARAM_EXPOSUREMODE_SPOTLIGHT,
289 	MMAL_PARAM_EXPOSUREMODE_SPORTS,
290 	MMAL_PARAM_EXPOSUREMODE_SNOW,
291 	MMAL_PARAM_EXPOSUREMODE_BEACH,
292 	MMAL_PARAM_EXPOSUREMODE_VERYLONG,
293 	MMAL_PARAM_EXPOSUREMODE_FIXEDFPS,
294 	MMAL_PARAM_EXPOSUREMODE_ANTISHAKE,
295 	MMAL_PARAM_EXPOSUREMODE_FIREWORKS,
296 };
297 
298 enum mmal_parameter_exposuremeteringmode {
299 	MMAL_PARAM_EXPOSUREMETERINGMODE_AVERAGE,
300 	MMAL_PARAM_EXPOSUREMETERINGMODE_SPOT,
301 	MMAL_PARAM_EXPOSUREMETERINGMODE_BACKLIT,
302 	MMAL_PARAM_EXPOSUREMETERINGMODE_MATRIX,
303 };
304 
305 enum mmal_parameter_awbmode {
306 	MMAL_PARAM_AWBMODE_OFF,
307 	MMAL_PARAM_AWBMODE_AUTO,
308 	MMAL_PARAM_AWBMODE_SUNLIGHT,
309 	MMAL_PARAM_AWBMODE_CLOUDY,
310 	MMAL_PARAM_AWBMODE_SHADE,
311 	MMAL_PARAM_AWBMODE_TUNGSTEN,
312 	MMAL_PARAM_AWBMODE_FLUORESCENT,
313 	MMAL_PARAM_AWBMODE_INCANDESCENT,
314 	MMAL_PARAM_AWBMODE_FLASH,
315 	MMAL_PARAM_AWBMODE_HORIZON,
316 };
317 
318 enum mmal_parameter_imagefx {
319 	MMAL_PARAM_IMAGEFX_NONE,
320 	MMAL_PARAM_IMAGEFX_NEGATIVE,
321 	MMAL_PARAM_IMAGEFX_SOLARIZE,
322 	MMAL_PARAM_IMAGEFX_POSTERIZE,
323 	MMAL_PARAM_IMAGEFX_WHITEBOARD,
324 	MMAL_PARAM_IMAGEFX_BLACKBOARD,
325 	MMAL_PARAM_IMAGEFX_SKETCH,
326 	MMAL_PARAM_IMAGEFX_DENOISE,
327 	MMAL_PARAM_IMAGEFX_EMBOSS,
328 	MMAL_PARAM_IMAGEFX_OILPAINT,
329 	MMAL_PARAM_IMAGEFX_HATCH,
330 	MMAL_PARAM_IMAGEFX_GPEN,
331 	MMAL_PARAM_IMAGEFX_PASTEL,
332 	MMAL_PARAM_IMAGEFX_WATERCOLOUR,
333 	MMAL_PARAM_IMAGEFX_FILM,
334 	MMAL_PARAM_IMAGEFX_BLUR,
335 	MMAL_PARAM_IMAGEFX_SATURATION,
336 	MMAL_PARAM_IMAGEFX_COLOURSWAP,
337 	MMAL_PARAM_IMAGEFX_WASHEDOUT,
338 	MMAL_PARAM_IMAGEFX_POSTERISE,
339 	MMAL_PARAM_IMAGEFX_COLOURPOINT,
340 	MMAL_PARAM_IMAGEFX_COLOURBALANCE,
341 	MMAL_PARAM_IMAGEFX_CARTOON,
342 };
343 
344 enum MMAL_PARAM_FLICKERAVOID {
345 	MMAL_PARAM_FLICKERAVOID_OFF,
346 	MMAL_PARAM_FLICKERAVOID_AUTO,
347 	MMAL_PARAM_FLICKERAVOID_50HZ,
348 	MMAL_PARAM_FLICKERAVOID_60HZ,
349 	MMAL_PARAM_FLICKERAVOID_MAX = 0x7FFFFFFF
350 };
351 
352 struct mmal_parameter_awbgains {
353 	struct mmal_parameter_rational r_gain;	/**< Red gain */
354 	struct mmal_parameter_rational b_gain;	/**< Blue gain */
355 };
356 
357 /** Manner of video rate control */
358 enum mmal_parameter_rate_control_mode {
359 	MMAL_VIDEO_RATECONTROL_DEFAULT,
360 	MMAL_VIDEO_RATECONTROL_VARIABLE,
361 	MMAL_VIDEO_RATECONTROL_CONSTANT,
362 	MMAL_VIDEO_RATECONTROL_VARIABLE_SKIP_FRAMES,
363 	MMAL_VIDEO_RATECONTROL_CONSTANT_SKIP_FRAMES
364 };
365 
366 enum mmal_video_profile {
367 	MMAL_VIDEO_PROFILE_H263_BASELINE,
368 	MMAL_VIDEO_PROFILE_H263_H320CODING,
369 	MMAL_VIDEO_PROFILE_H263_BACKWARDCOMPATIBLE,
370 	MMAL_VIDEO_PROFILE_H263_ISWV2,
371 	MMAL_VIDEO_PROFILE_H263_ISWV3,
372 	MMAL_VIDEO_PROFILE_H263_HIGHCOMPRESSION,
373 	MMAL_VIDEO_PROFILE_H263_INTERNET,
374 	MMAL_VIDEO_PROFILE_H263_INTERLACE,
375 	MMAL_VIDEO_PROFILE_H263_HIGHLATENCY,
376 	MMAL_VIDEO_PROFILE_MP4V_SIMPLE,
377 	MMAL_VIDEO_PROFILE_MP4V_SIMPLESCALABLE,
378 	MMAL_VIDEO_PROFILE_MP4V_CORE,
379 	MMAL_VIDEO_PROFILE_MP4V_MAIN,
380 	MMAL_VIDEO_PROFILE_MP4V_NBIT,
381 	MMAL_VIDEO_PROFILE_MP4V_SCALABLETEXTURE,
382 	MMAL_VIDEO_PROFILE_MP4V_SIMPLEFACE,
383 	MMAL_VIDEO_PROFILE_MP4V_SIMPLEFBA,
384 	MMAL_VIDEO_PROFILE_MP4V_BASICANIMATED,
385 	MMAL_VIDEO_PROFILE_MP4V_HYBRID,
386 	MMAL_VIDEO_PROFILE_MP4V_ADVANCEDREALTIME,
387 	MMAL_VIDEO_PROFILE_MP4V_CORESCALABLE,
388 	MMAL_VIDEO_PROFILE_MP4V_ADVANCEDCODING,
389 	MMAL_VIDEO_PROFILE_MP4V_ADVANCEDCORE,
390 	MMAL_VIDEO_PROFILE_MP4V_ADVANCEDSCALABLE,
391 	MMAL_VIDEO_PROFILE_MP4V_ADVANCEDSIMPLE,
392 	MMAL_VIDEO_PROFILE_H264_BASELINE,
393 	MMAL_VIDEO_PROFILE_H264_MAIN,
394 	MMAL_VIDEO_PROFILE_H264_EXTENDED,
395 	MMAL_VIDEO_PROFILE_H264_HIGH,
396 	MMAL_VIDEO_PROFILE_H264_HIGH10,
397 	MMAL_VIDEO_PROFILE_H264_HIGH422,
398 	MMAL_VIDEO_PROFILE_H264_HIGH444,
399 	MMAL_VIDEO_PROFILE_H264_CONSTRAINED_BASELINE,
400 	MMAL_VIDEO_PROFILE_DUMMY = 0x7FFFFFFF
401 };
402 
403 enum mmal_video_level {
404 	MMAL_VIDEO_LEVEL_H263_10,
405 	MMAL_VIDEO_LEVEL_H263_20,
406 	MMAL_VIDEO_LEVEL_H263_30,
407 	MMAL_VIDEO_LEVEL_H263_40,
408 	MMAL_VIDEO_LEVEL_H263_45,
409 	MMAL_VIDEO_LEVEL_H263_50,
410 	MMAL_VIDEO_LEVEL_H263_60,
411 	MMAL_VIDEO_LEVEL_H263_70,
412 	MMAL_VIDEO_LEVEL_MP4V_0,
413 	MMAL_VIDEO_LEVEL_MP4V_0b,
414 	MMAL_VIDEO_LEVEL_MP4V_1,
415 	MMAL_VIDEO_LEVEL_MP4V_2,
416 	MMAL_VIDEO_LEVEL_MP4V_3,
417 	MMAL_VIDEO_LEVEL_MP4V_4,
418 	MMAL_VIDEO_LEVEL_MP4V_4a,
419 	MMAL_VIDEO_LEVEL_MP4V_5,
420 	MMAL_VIDEO_LEVEL_MP4V_6,
421 	MMAL_VIDEO_LEVEL_H264_1,
422 	MMAL_VIDEO_LEVEL_H264_1b,
423 	MMAL_VIDEO_LEVEL_H264_11,
424 	MMAL_VIDEO_LEVEL_H264_12,
425 	MMAL_VIDEO_LEVEL_H264_13,
426 	MMAL_VIDEO_LEVEL_H264_2,
427 	MMAL_VIDEO_LEVEL_H264_21,
428 	MMAL_VIDEO_LEVEL_H264_22,
429 	MMAL_VIDEO_LEVEL_H264_3,
430 	MMAL_VIDEO_LEVEL_H264_31,
431 	MMAL_VIDEO_LEVEL_H264_32,
432 	MMAL_VIDEO_LEVEL_H264_4,
433 	MMAL_VIDEO_LEVEL_H264_41,
434 	MMAL_VIDEO_LEVEL_H264_42,
435 	MMAL_VIDEO_LEVEL_H264_5,
436 	MMAL_VIDEO_LEVEL_H264_51,
437 	MMAL_VIDEO_LEVEL_DUMMY = 0x7FFFFFFF
438 };
439 
440 struct mmal_parameter_video_profile {
441 	enum mmal_video_profile profile;
442 	enum mmal_video_level level;
443 };
444 
445 /* video parameters */
446 
447 enum mmal_parameter_video_type {
448 	/** @ref MMAL_DISPLAYREGION_T */
449 	MMAL_PARAMETER_DISPLAYREGION = MMAL_PARAMETER_GROUP_VIDEO,
450 
451 	/** @ref MMAL_PARAMETER_VIDEO_PROFILE_T */
452 	MMAL_PARAMETER_SUPPORTED_PROFILES,
453 
454 	/** @ref MMAL_PARAMETER_VIDEO_PROFILE_T */
455 	MMAL_PARAMETER_PROFILE,
456 
457 	/** @ref MMAL_PARAMETER_UINT32_T */
458 	MMAL_PARAMETER_INTRAPERIOD,
459 
460 	/** @ref MMAL_PARAMETER_VIDEO_RATECONTROL_T */
461 	MMAL_PARAMETER_RATECONTROL,
462 
463 	/** @ref MMAL_PARAMETER_VIDEO_NALUNITFORMAT_T */
464 	MMAL_PARAMETER_NALUNITFORMAT,
465 
466 	/** @ref MMAL_PARAMETER_BOOLEAN_T */
467 	MMAL_PARAMETER_MINIMISE_FRAGMENTATION,
468 
469 	/** @ref MMAL_PARAMETER_UINT32_T.
470 	 * Setting the value to zero resets to the default (one slice per
471 	 * frame).
472 	 */
473 	MMAL_PARAMETER_MB_ROWS_PER_SLICE,
474 
475 	/** @ref MMAL_PARAMETER_VIDEO_LEVEL_EXTENSION_T */
476 	MMAL_PARAMETER_VIDEO_LEVEL_EXTENSION,
477 
478 	/** @ref MMAL_PARAMETER_VIDEO_EEDE_ENABLE_T */
479 	MMAL_PARAMETER_VIDEO_EEDE_ENABLE,
480 
481 	/** @ref MMAL_PARAMETER_VIDEO_EEDE_LOSSRATE_T */
482 	MMAL_PARAMETER_VIDEO_EEDE_LOSSRATE,
483 
484 	/** @ref MMAL_PARAMETER_BOOLEAN_T. Request an I-frame. */
485 	MMAL_PARAMETER_VIDEO_REQUEST_I_FRAME,
486 	/** @ref MMAL_PARAMETER_VIDEO_INTRA_REFRESH_T */
487 	MMAL_PARAMETER_VIDEO_INTRA_REFRESH,
488 
489 	/** @ref MMAL_PARAMETER_BOOLEAN_T. */
490 	MMAL_PARAMETER_VIDEO_IMMUTABLE_INPUT,
491 
492 	/** @ref MMAL_PARAMETER_UINT32_T. Run-time bit rate control */
493 	MMAL_PARAMETER_VIDEO_BIT_RATE,
494 
495 	/** @ref MMAL_PARAMETER_FRAME_RATE_T */
496 	MMAL_PARAMETER_VIDEO_FRAME_RATE,
497 
498 	/** @ref MMAL_PARAMETER_UINT32_T. */
499 	MMAL_PARAMETER_VIDEO_ENCODE_MIN_QUANT,
500 
501 	/** @ref MMAL_PARAMETER_UINT32_T. */
502 	MMAL_PARAMETER_VIDEO_ENCODE_MAX_QUANT,
503 
504 	/** @ref MMAL_PARAMETER_VIDEO_ENCODE_RC_MODEL_T. */
505 	MMAL_PARAMETER_VIDEO_ENCODE_RC_MODEL,
506 
507 	MMAL_PARAMETER_EXTRA_BUFFERS, /**< @ref MMAL_PARAMETER_UINT32_T. */
508 	/** @ref MMAL_PARAMETER_UINT32_T.
509 	 * Changing this parameter from the default can reduce frame rate
510 	 * because image buffers need to be re-pitched.
511 	 */
512 	MMAL_PARAMETER_VIDEO_ALIGN_HORIZ,
513 
514 	/** @ref MMAL_PARAMETER_UINT32_T.
515 	 * Changing this parameter from the default can reduce frame rate
516 	 * because image buffers need to be re-pitched.
517 	 */
518 	MMAL_PARAMETER_VIDEO_ALIGN_VERT,
519 
520 	/** @ref MMAL_PARAMETER_BOOLEAN_T. */
521 	MMAL_PARAMETER_VIDEO_DROPPABLE_PFRAMES,
522 
523 	/** @ref MMAL_PARAMETER_UINT32_T. */
524 	MMAL_PARAMETER_VIDEO_ENCODE_INITIAL_QUANT,
525 
526 	/**< @ref MMAL_PARAMETER_UINT32_T. */
527 	MMAL_PARAMETER_VIDEO_ENCODE_QP_P,
528 
529 	/**< @ref MMAL_PARAMETER_UINT32_T. */
530 	MMAL_PARAMETER_VIDEO_ENCODE_RC_SLICE_DQUANT,
531 
532 	/** @ref MMAL_PARAMETER_UINT32_T */
533 	MMAL_PARAMETER_VIDEO_ENCODE_FRAME_LIMIT_BITS,
534 
535 	/** @ref MMAL_PARAMETER_UINT32_T. */
536 	MMAL_PARAMETER_VIDEO_ENCODE_PEAK_RATE,
537 
538 	/* H264 specific parameters */
539 
540 	/** @ref MMAL_PARAMETER_BOOLEAN_T. */
541 	MMAL_PARAMETER_VIDEO_ENCODE_H264_DISABLE_CABAC,
542 
543 	/** @ref MMAL_PARAMETER_BOOLEAN_T. */
544 	MMAL_PARAMETER_VIDEO_ENCODE_H264_LOW_LATENCY,
545 
546 	/** @ref MMAL_PARAMETER_BOOLEAN_T. */
547 	MMAL_PARAMETER_VIDEO_ENCODE_H264_AU_DELIMITERS,
548 
549 	/** @ref MMAL_PARAMETER_UINT32_T. */
550 	MMAL_PARAMETER_VIDEO_ENCODE_H264_DEBLOCK_IDC,
551 
552 	/** @ref MMAL_PARAMETER_VIDEO_ENCODER_H264_MB_INTRA_MODES_T. */
553 	MMAL_PARAMETER_VIDEO_ENCODE_H264_MB_INTRA_MODE,
554 
555 	/** @ref MMAL_PARAMETER_BOOLEAN_T */
556 	MMAL_PARAMETER_VIDEO_ENCODE_HEADER_ON_OPEN,
557 
558 	/** @ref MMAL_PARAMETER_BOOLEAN_T */
559 	MMAL_PARAMETER_VIDEO_ENCODE_PRECODE_FOR_QP,
560 
561 	/** @ref MMAL_PARAMETER_VIDEO_DRM_INIT_INFO_T. */
562 	MMAL_PARAMETER_VIDEO_DRM_INIT_INFO,
563 
564 	/** @ref MMAL_PARAMETER_BOOLEAN_T */
565 	MMAL_PARAMETER_VIDEO_TIMESTAMP_FIFO,
566 
567 	/** @ref MMAL_PARAMETER_BOOLEAN_T */
568 	MMAL_PARAMETER_VIDEO_DECODE_ERROR_CONCEALMENT,
569 
570 	/** @ref MMAL_PARAMETER_VIDEO_DRM_PROTECT_BUFFER_T. */
571 	MMAL_PARAMETER_VIDEO_DRM_PROTECT_BUFFER,
572 
573 	/** @ref MMAL_PARAMETER_BYTES_T */
574 	MMAL_PARAMETER_VIDEO_DECODE_CONFIG_VD3,
575 
576 	/**< @ref MMAL_PARAMETER_BOOLEAN_T */
577 	MMAL_PARAMETER_VIDEO_ENCODE_H264_VCL_HRD_PARAMETERS,
578 
579 	/**< @ref MMAL_PARAMETER_BOOLEAN_T */
580 	MMAL_PARAMETER_VIDEO_ENCODE_H264_LOW_DELAY_HRD_FLAG,
581 
582 	/**< @ref MMAL_PARAMETER_BOOLEAN_T */
583 	MMAL_PARAMETER_VIDEO_ENCODE_INLINE_HEADER
584 };
585 
586 /** Valid mirror modes */
587 enum mmal_parameter_mirror {
588 	MMAL_PARAM_MIRROR_NONE,
589 	MMAL_PARAM_MIRROR_VERTICAL,
590 	MMAL_PARAM_MIRROR_HORIZONTAL,
591 	MMAL_PARAM_MIRROR_BOTH,
592 };
593 
594 enum mmal_parameter_displaytransform {
595 	MMAL_DISPLAY_ROT0 = 0,
596 	MMAL_DISPLAY_MIRROR_ROT0 = 1,
597 	MMAL_DISPLAY_MIRROR_ROT180 = 2,
598 	MMAL_DISPLAY_ROT180 = 3,
599 	MMAL_DISPLAY_MIRROR_ROT90 = 4,
600 	MMAL_DISPLAY_ROT270 = 5,
601 	MMAL_DISPLAY_ROT90 = 6,
602 	MMAL_DISPLAY_MIRROR_ROT270 = 7,
603 };
604 
605 enum mmal_parameter_displaymode {
606 	MMAL_DISPLAY_MODE_FILL = 0,
607 	MMAL_DISPLAY_MODE_LETTERBOX = 1,
608 };
609 
610 enum mmal_parameter_displayset {
611 	MMAL_DISPLAY_SET_NONE = 0,
612 	MMAL_DISPLAY_SET_NUM = 1,
613 	MMAL_DISPLAY_SET_FULLSCREEN = 2,
614 	MMAL_DISPLAY_SET_TRANSFORM = 4,
615 	MMAL_DISPLAY_SET_DEST_RECT = 8,
616 	MMAL_DISPLAY_SET_SRC_RECT = 0x10,
617 	MMAL_DISPLAY_SET_MODE = 0x20,
618 	MMAL_DISPLAY_SET_PIXEL = 0x40,
619 	MMAL_DISPLAY_SET_NOASPECT = 0x80,
620 	MMAL_DISPLAY_SET_LAYER = 0x100,
621 	MMAL_DISPLAY_SET_COPYPROTECT = 0x200,
622 	MMAL_DISPLAY_SET_ALPHA = 0x400,
623 };
624 
625 /* rectangle, used lots so it gets its own struct */
626 struct vchiq_mmal_rect {
627 	s32 x;
628 	s32 y;
629 	s32 width;
630 	s32 height;
631 };
632 
633 struct mmal_parameter_displayregion {
634 	/** Bitfield that indicates which fields are set and should be
635 	 * used. All other fields will maintain their current value.
636 	 * \ref MMAL_DISPLAYSET_T defines the bits that can be
637 	 * combined.
638 	 */
639 	u32 set;
640 
641 	/** Describes the display output device, with 0 typically
642 	 * being a directly connected LCD display.  The actual values
643 	 * will depend on the hardware.  Code using hard-wired numbers
644 	 * (e.g. 2) is certain to fail.
645 	 */
646 
647 	u32 display_num;
648 	/** Indicates that we are using the full device screen area,
649 	 * rather than a window of the display.  If zero, then
650 	 * dest_rect is used to specify a region of the display to
651 	 * use.
652 	 */
653 
654 	s32 fullscreen;
655 	/** Indicates any rotation or flipping used to map frames onto
656 	 * the natural display orientation.
657 	 */
658 	u32 transform; /* enum mmal_parameter_displaytransform */
659 
660 	/** Where to display the frame within the screen, if
661 	 * fullscreen is zero.
662 	 */
663 	struct vchiq_mmal_rect dest_rect;
664 
665 	/** Indicates which area of the frame to display. If all
666 	 * values are zero, the whole frame will be used.
667 	 */
668 	struct vchiq_mmal_rect src_rect;
669 
670 	/** If set to non-zero, indicates that any display scaling
671 	 * should disregard the aspect ratio of the frame region being
672 	 * displayed.
673 	 */
674 	s32 noaspect;
675 
676 	/** Indicates how the image should be scaled to fit the
677 	 * display. \code MMAL_DISPLAY_MODE_FILL \endcode indicates
678 	 * that the image should fill the screen by potentially
679 	 * cropping the frames.  Setting \code mode \endcode to \code
680 	 * MMAL_DISPLAY_MODE_LETTERBOX \endcode indicates that all the
681 	 * source region should be displayed and black bars added if
682 	 * necessary.
683 	 */
684 	u32 mode; /* enum mmal_parameter_displaymode */
685 
686 	/** If non-zero, defines the width of a source pixel relative
687 	 * to \code pixel_y \endcode.  If zero, then pixels default to
688 	 * being square.
689 	 */
690 	u32 pixel_x;
691 
692 	/** If non-zero, defines the height of a source pixel relative
693 	 * to \code pixel_x \endcode.  If zero, then pixels default to
694 	 * being square.
695 	 */
696 	u32 pixel_y;
697 
698 	/** Sets the relative depth of the images, with greater values
699 	 * being in front of smaller values.
700 	 */
701 	u32 layer;
702 
703 	/** Set to non-zero to ensure copy protection is used on
704 	 * output.
705 	 */
706 	s32 copyprotect_required;
707 
708 	/** Level of opacity of the layer, where zero is fully
709 	 * transparent and 255 is fully opaque.
710 	 */
711 	u32 alpha;
712 };
713 
714 #define MMAL_MAX_IMAGEFX_PARAMETERS 5
715 
716 struct mmal_parameter_imagefx_parameters {
717 	enum mmal_parameter_imagefx effect;
718 	u32 num_effect_params;
719 	u32 effect_parameter[MMAL_MAX_IMAGEFX_PARAMETERS];
720 };
721 
722 #define MMAL_PARAMETER_CAMERA_INFO_MAX_CAMERAS 4
723 #define MMAL_PARAMETER_CAMERA_INFO_MAX_FLASHES 2
724 #define MMAL_PARAMETER_CAMERA_INFO_MAX_STR_LEN 16
725 
726 struct mmal_parameter_camera_info_camera {
727 	u32 port_id;
728 	u32 max_width;
729 	u32 max_height;
730 	u32 lens_present;
731 	u8 camera_name[MMAL_PARAMETER_CAMERA_INFO_MAX_STR_LEN];
732 };
733 
734 enum mmal_parameter_camera_info_flash_type {
735 	/* Make values explicit to ensure they match values in config ini */
736 	MMAL_PARAMETER_CAMERA_INFO_FLASH_TYPE_XENON = 0,
737 	MMAL_PARAMETER_CAMERA_INFO_FLASH_TYPE_LED   = 1,
738 	MMAL_PARAMETER_CAMERA_INFO_FLASH_TYPE_OTHER = 2,
739 	MMAL_PARAMETER_CAMERA_INFO_FLASH_TYPE_MAX = 0x7FFFFFFF
740 };
741 
742 struct mmal_parameter_camera_info_flash {
743 	enum mmal_parameter_camera_info_flash_type flash_type;
744 };
745 
746 struct mmal_parameter_camera_info {
747 	u32 num_cameras;
748 	u32 num_flashes;
749 	struct mmal_parameter_camera_info_camera
750 		cameras[MMAL_PARAMETER_CAMERA_INFO_MAX_CAMERAS];
751 	struct mmal_parameter_camera_info_flash
752 				flashes[MMAL_PARAMETER_CAMERA_INFO_MAX_FLASHES];
753 };
754 
755 #endif
756