1/*
2Copyright (c) 2012, Broadcom Europe Ltd
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in the
11 documentation and/or other materials provided with the distribution.
12 * Neither the name of the copyright holder nor the
13 names of its contributors may be used to endorse or promote products
14 derived from this software without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28#ifndef MMAL_PARAMETERS_VIDEO_H
29#define MMAL_PARAMETERS_VIDEO_H
30
31#include "mmal_parameters_common.h"
32
33/*************************************************
34 * ALWAYS ADD NEW ENUMS AT THE END OF THIS LIST! *
35 ************************************************/
36
37/** Video-specific MMAL parameter IDs.
38 * @ingroup MMAL_PARAMETER_IDS
39 */
40enum {
41 MMAL_PARAMETER_DISPLAYREGION /**< Takes a @ref MMAL_DISPLAYREGION_T */
42 = MMAL_PARAMETER_GROUP_VIDEO,
43 MMAL_PARAMETER_SUPPORTED_PROFILES, /**< Takes a @ref MMAL_PARAMETER_VIDEO_PROFILE_T */
44 MMAL_PARAMETER_PROFILE, /**< Takes a @ref MMAL_PARAMETER_VIDEO_PROFILE_T */
45 MMAL_PARAMETER_INTRAPERIOD, /**< Takes a @ref MMAL_PARAMETER_UINT32_T */
46 MMAL_PARAMETER_RATECONTROL, /**< Takes a @ref MMAL_PARAMETER_VIDEO_RATECONTROL_T */
47 MMAL_PARAMETER_NALUNITFORMAT, /**< Takes a @ref MMAL_PARAMETER_VIDEO_NALUNITFORMAT_T */
48 MMAL_PARAMETER_MINIMISE_FRAGMENTATION, /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */
49 MMAL_PARAMETER_MB_ROWS_PER_SLICE, /**< Takes a @ref MMAL_PARAMETER_UINT32_T.
50 * Setting the value to zero resets to the default (one slice per frame). */
51 MMAL_PARAMETER_VIDEO_LEVEL_EXTENSION, /**< Takes a @ref MMAL_PARAMETER_VIDEO_LEVEL_EXTENSION_T */
52 MMAL_PARAMETER_VIDEO_EEDE_ENABLE, /**< Takes a @ref MMAL_PARAMETER_VIDEO_EEDE_ENABLE_T */
53 MMAL_PARAMETER_VIDEO_EEDE_LOSSRATE, /**< Takes a @ref MMAL_PARAMETER_VIDEO_EEDE_LOSSRATE_T */
54 MMAL_PARAMETER_VIDEO_REQUEST_I_FRAME, /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T.
55 * Request an I-frame. */
56 MMAL_PARAMETER_VIDEO_INTRA_REFRESH, /**< Takes a @ref MMAL_PARAMETER_VIDEO_INTRA_REFRESH_T */
57 MMAL_PARAMETER_VIDEO_IMMUTABLE_INPUT, /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T. */
58 MMAL_PARAMETER_VIDEO_BIT_RATE, /**< Takes a @ref MMAL_PARAMETER_UINT32_T.
59 * Run-time bit rate control */
60 MMAL_PARAMETER_VIDEO_FRAME_RATE, /**< Takes a @ref MMAL_PARAMETER_FRAME_RATE_T */
61 MMAL_PARAMETER_VIDEO_ENCODE_MIN_QUANT, /**< Takes a @ref MMAL_PARAMETER_UINT32_T. */
62 MMAL_PARAMETER_VIDEO_ENCODE_MAX_QUANT, /**< Takes a @ref MMAL_PARAMETER_UINT32_T. */
63 MMAL_PARAMETER_VIDEO_ENCODE_RC_MODEL, /**< Takes a @ref MMAL_PARAMETER_VIDEO_ENCODE_RC_MODEL_T. */
64 MMAL_PARAMETER_EXTRA_BUFFERS, /**< Takes a @ref MMAL_PARAMETER_UINT32_T. */
65 MMAL_PARAMETER_VIDEO_ALIGN_HORIZ, /**< Takes a @ref MMAL_PARAMETER_UINT32_T.
66 Changing this paramater from the default can reduce frame rate
67 because image buffers need to be re-pitched.*/
68 MMAL_PARAMETER_VIDEO_ALIGN_VERT, /**< Takes a @ref MMAL_PARAMETER_UINT32_T.
69 Changing this paramater from the default can reduce frame rate
70 because image buffers need to be re-pitched.*/
71 MMAL_PARAMETER_VIDEO_DROPPABLE_PFRAMES, /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T. */
72 MMAL_PARAMETER_VIDEO_ENCODE_INITIAL_QUANT, /**< Takes a @ref MMAL_PARAMETER_UINT32_T. */
73 MMAL_PARAMETER_VIDEO_ENCODE_QP_P, /**< Takes a @ref MMAL_PARAMETER_UINT32_T. */
74 MMAL_PARAMETER_VIDEO_ENCODE_RC_SLICE_DQUANT, /**< Takes a @ref MMAL_PARAMETER_UINT32_T. */
75 MMAL_PARAMETER_VIDEO_ENCODE_FRAME_LIMIT_BITS, /**< Takes a @ref MMAL_PARAMETER_UINT32_T */
76 MMAL_PARAMETER_VIDEO_ENCODE_PEAK_RATE, /**< Takes a @ref MMAL_PARAMETER_UINT32_T. */
77
78 /*H264 specific parameters*/
79 MMAL_PARAMETER_VIDEO_ENCODE_H264_DISABLE_CABAC, /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T. */
80 MMAL_PARAMETER_VIDEO_ENCODE_H264_LOW_LATENCY, /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T. */
81 MMAL_PARAMETER_VIDEO_ENCODE_H264_AU_DELIMITERS, /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T. */
82 MMAL_PARAMETER_VIDEO_ENCODE_H264_DEBLOCK_IDC, /**< Takes a @ref MMAL_PARAMETER_UINT32_T. */
83 MMAL_PARAMETER_VIDEO_ENCODE_H264_MB_INTRA_MODE, /**< Takes a @ref MMAL_PARAMETER_VIDEO_ENCODER_H264_MB_INTRA_MODES_T. */
84
85 MMAL_PARAMETER_VIDEO_ENCODE_HEADER_ON_OPEN, /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */
86 MMAL_PARAMETER_VIDEO_ENCODE_PRECODE_FOR_QP, /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */
87
88 MMAL_PARAMETER_VIDEO_DRM_INIT_INFO, /**< Takes a @ref MMAL_PARAMETER_VIDEO_DRM_INIT_INFO_T. */
89 MMAL_PARAMETER_VIDEO_TIMESTAMP_FIFO, /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */
90 MMAL_PARAMETER_VIDEO_DECODE_ERROR_CONCEALMENT, /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */
91 MMAL_PARAMETER_VIDEO_DRM_PROTECT_BUFFER, /**< Takes a @ref MMAL_PARAMETER_VIDEO_DRM_PROTECT_BUFFER_T. */
92
93 MMAL_PARAMETER_VIDEO_DECODE_CONFIG_VD3, /**< Takes a @ref MMAL_PARAMETER_BYTES_T */
94 MMAL_PARAMETER_VIDEO_ENCODE_H264_VCL_HRD_PARAMETERS, /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T. */
95 MMAL_PARAMETER_VIDEO_ENCODE_H264_LOW_DELAY_HRD_FLAG, /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T. */
96 MMAL_PARAMETER_VIDEO_ENCODE_INLINE_HEADER, /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T. */
97 MMAL_PARAMETER_VIDEO_ENCODE_SEI_ENABLE, /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T. */
98 MMAL_PARAMETER_VIDEO_ENCODE_INLINE_VECTORS, /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T. */
99 MMAL_PARAMETER_VIDEO_RENDER_STATS, /**< Take a @ref MMAL_PARAMETER_VIDEO_RENDER_STATS_T. */
100 MMAL_PARAMETER_VIDEO_INTERLACE_TYPE, /**< Take a @ref MMAL_PARAMETER_VIDEO_INTERLACE_TYPE_T. */
101 MMAL_PARAMETER_VIDEO_INTERPOLATE_TIMESTAMPS, /**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */
102 MMAL_PARAMETER_VIDEO_ENCODE_SPS_TIMING, /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */
103 MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS, /**< Take a @ref MMAL_PARAMETER_UINT32_T */
104 MMAL_PARAMETER_VIDEO_SOURCE_PATTERN, /**< Take a @ref MMAL_PARAMETER_SOURCE_PATTERN_T */
105 MMAL_PARAMETER_VIDEO_ENCODE_SEPARATE_NAL_BUFS, /**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */
106 MMAL_PARAMETER_VIDEO_DROPPABLE_PFRAME_LENGTH, /**< Take a @ref MMAL_PARAMETER_UINT32_T */
107};
108
109/** Display transformations.
110 * Although an enumeration, the values correspond to combinations of:
111 * \li 1 Reflect in a vertical axis
112 * \li 2 180 degree rotation
113 * \li 4 Reflect in the leading diagonal
114 */
115typedef enum MMAL_DISPLAYTRANSFORM_T {
116 MMAL_DISPLAY_ROT0 = 0,
117 MMAL_DISPLAY_MIRROR_ROT0 = 1,
118 MMAL_DISPLAY_MIRROR_ROT180 = 2,
119 MMAL_DISPLAY_ROT180 = 3,
120 MMAL_DISPLAY_MIRROR_ROT90 = 4,
121 MMAL_DISPLAY_ROT270 = 5,
122 MMAL_DISPLAY_ROT90 = 6,
123 MMAL_DISPLAY_MIRROR_ROT270 = 7,
124 MMAL_DISPLAY_DUMMY = 0x7FFFFFFF
125} MMAL_DISPLAYTRANSFORM_T;
126
127/** Display modes. */
128typedef enum MMAL_DISPLAYMODE_T {
129 MMAL_DISPLAY_MODE_FILL = 0,
130 MMAL_DISPLAY_MODE_LETTERBOX = 1,
131 // these allow a left eye source->dest to be specified and the right eye mapping will be inferred by symmetry
132 MMAL_DISPLAY_MODE_STEREO_LEFT_TO_LEFT = 2,
133 MMAL_DISPLAY_MODE_STEREO_TOP_TO_TOP = 3,
134 MMAL_DISPLAY_MODE_STEREO_LEFT_TO_TOP = 4,
135 MMAL_DISPLAY_MODE_STEREO_TOP_TO_LEFT = 5,
136 MMAL_DISPLAY_MODE_DUMMY = 0x7FFFFFFF
137} MMAL_DISPLAYMODE_T;
138
139/** Values used to indicate which fields are used when setting the
140 * display configuration */
141typedef enum MMAL_DISPLAYSET_T {
142 MMAL_DISPLAY_SET_NONE = 0,
143 MMAL_DISPLAY_SET_NUM = 1,
144 MMAL_DISPLAY_SET_FULLSCREEN = 2,
145 MMAL_DISPLAY_SET_TRANSFORM = 4,
146 MMAL_DISPLAY_SET_DEST_RECT = 8,
147 MMAL_DISPLAY_SET_SRC_RECT = 0x10,
148 MMAL_DISPLAY_SET_MODE = 0x20,
149 MMAL_DISPLAY_SET_PIXEL = 0x40,
150 MMAL_DISPLAY_SET_NOASPECT = 0x80,
151 MMAL_DISPLAY_SET_LAYER = 0x100,
152 MMAL_DISPLAY_SET_COPYPROTECT = 0x200,
153 MMAL_DISPLAY_SET_ALPHA = 0x400,
154 MMAL_DISPLAY_SET_DUMMY = 0x7FFFFFFF
155} MMAL_DISPLAYSET_T;
156
157typedef enum MMAL_DISPLAYALPHAFLAGS_T {
158 MMAL_DISPLAY_ALPHA_FLAGS_NONE = 0,
159 /**< Discard all lower layers as if this layer were fullscreen and completely
160 * opaque. This flag removes the lower layers from the display list, therefore
161 * avoiding using resources in wasted effort.
162 */
163 MMAL_DISPLAY_ALPHA_FLAGS_DISCARD_LOWER_LAYERS = 1<<29,
164 /**< Alpha values are already premultiplied */
165 MMAL_DISPLAY_ALPHA_FLAGS_PREMULT = 1<<30,
166 /**< Mix the per pixel alpha (if present) and the per plane alpha. */
167 MMAL_DISPLAY_ALPHA_FLAGS_MIX = 1<<31,
168} MMAL_DISPLAYALPHAFLAGS_T;
169
170/**
171This config sets the output display device, as well as the region used
172on the output display, any display transformation, and some flags to
173indicate how to scale the image.
174*/
175
176typedef struct MMAL_DISPLAYREGION_T {
177 MMAL_PARAMETER_HEADER_T hdr;
178 /** Bitfield that indicates which fields are set and should be used. All
179 * other fields will maintain their current value.
180 * \ref MMAL_DISPLAYSET_T defines the bits that can be combined.
181 */
182 uint32_t set;
183 /** Describes the display output device, with 0 typically being a directly
184 * connected LCD display. The actual values will depend on the hardware.
185 * Code using hard-wired numbers (e.g. 2) is certain to fail.
186 */
187 uint32_t display_num;
188 /** Indicates that we are using the full device screen area, rather than
189 * a window of the display. If zero, then dest_rect is used to specify a
190 * region of the display to use.
191 */
192 MMAL_BOOL_T fullscreen;
193 /** Indicates any rotation or flipping used to map frames onto the natural
194 * display orientation.
195 */
196 MMAL_DISPLAYTRANSFORM_T transform;
197 /** Where to display the frame within the screen, if fullscreen is zero.
198 */
199 MMAL_RECT_T dest_rect;
200 /** Indicates which area of the frame to display. If all values are zero,
201 * the whole frame will be used.
202 */
203 MMAL_RECT_T src_rect;
204 /** If set to non-zero, indicates that any display scaling should disregard
205 * the aspect ratio of the frame region being displayed.
206 */
207 MMAL_BOOL_T noaspect;
208 /** Indicates how the image should be scaled to fit the display. \code
209 * MMAL_DISPLAY_MODE_FILL \endcode indicates that the image should fill the
210 * screen by potentially cropping the frames. Setting \code mode \endcode
211 * to \code MMAL_DISPLAY_MODE_LETTERBOX \endcode indicates that all the source
212 * region should be displayed and black bars added if necessary.
213 */
214 MMAL_DISPLAYMODE_T mode;
215 /** If non-zero, defines the width of a source pixel relative to \code pixel_y
216 * \endcode. If zero, then pixels default to being square.
217 */
218 uint32_t pixel_x;
219 /** If non-zero, defines the height of a source pixel relative to \code pixel_x
220 * \endcode. If zero, then pixels default to being square.
221 */
222 uint32_t pixel_y;
223 /** Sets the relative depth of the images, with greater values being in front
224 * of smaller values.
225 */
226 int32_t layer;
227 /** Set to non-zero to ensure copy protection is used on output.
228 */
229 MMAL_BOOL_T copyprotect_required;
230 /** Bits 7-0: Level of opacity of the layer, where zero is fully transparent and
231 * 255 is fully opaque.
232 * Bits 31-8: Flags from \code MMAL_DISPLAYALPHAFLAGS_T for alpha mode selection.
233 */
234 uint32_t alpha;
235} MMAL_DISPLAYREGION_T;
236
237/** Video profiles.
238 * Only certain combinations of profile and level will be valid.
239 * @ref MMAL_VIDEO_LEVEL_T
240 */
241typedef enum MMAL_VIDEO_PROFILE_T {
242 MMAL_VIDEO_PROFILE_H263_BASELINE,
243 MMAL_VIDEO_PROFILE_H263_H320CODING,
244 MMAL_VIDEO_PROFILE_H263_BACKWARDCOMPATIBLE,
245 MMAL_VIDEO_PROFILE_H263_ISWV2,
246 MMAL_VIDEO_PROFILE_H263_ISWV3,
247 MMAL_VIDEO_PROFILE_H263_HIGHCOMPRESSION,
248 MMAL_VIDEO_PROFILE_H263_INTERNET,
249 MMAL_VIDEO_PROFILE_H263_INTERLACE,
250 MMAL_VIDEO_PROFILE_H263_HIGHLATENCY,
251 MMAL_VIDEO_PROFILE_MP4V_SIMPLE,
252 MMAL_VIDEO_PROFILE_MP4V_SIMPLESCALABLE,
253 MMAL_VIDEO_PROFILE_MP4V_CORE,
254 MMAL_VIDEO_PROFILE_MP4V_MAIN,
255 MMAL_VIDEO_PROFILE_MP4V_NBIT,
256 MMAL_VIDEO_PROFILE_MP4V_SCALABLETEXTURE,
257 MMAL_VIDEO_PROFILE_MP4V_SIMPLEFACE,
258 MMAL_VIDEO_PROFILE_MP4V_SIMPLEFBA,
259 MMAL_VIDEO_PROFILE_MP4V_BASICANIMATED,
260 MMAL_VIDEO_PROFILE_MP4V_HYBRID,
261 MMAL_VIDEO_PROFILE_MP4V_ADVANCEDREALTIME,
262 MMAL_VIDEO_PROFILE_MP4V_CORESCALABLE,
263 MMAL_VIDEO_PROFILE_MP4V_ADVANCEDCODING,
264 MMAL_VIDEO_PROFILE_MP4V_ADVANCEDCORE,
265 MMAL_VIDEO_PROFILE_MP4V_ADVANCEDSCALABLE,
266 MMAL_VIDEO_PROFILE_MP4V_ADVANCEDSIMPLE,
267 MMAL_VIDEO_PROFILE_H264_BASELINE,
268 MMAL_VIDEO_PROFILE_H264_MAIN,
269 MMAL_VIDEO_PROFILE_H264_EXTENDED,
270 MMAL_VIDEO_PROFILE_H264_HIGH,
271 MMAL_VIDEO_PROFILE_H264_HIGH10,
272 MMAL_VIDEO_PROFILE_H264_HIGH422,
273 MMAL_VIDEO_PROFILE_H264_HIGH444,
274 MMAL_VIDEO_PROFILE_H264_CONSTRAINED_BASELINE,
275 MMAL_VIDEO_PROFILE_DUMMY = 0x7FFFFFFF
276} MMAL_VIDEO_PROFILE_T;
277
278/** Video levels.
279 * Only certain combinations of profile and level will be valid.
280 * @ref MMAL_VIDEO_PROFILE_T
281 */
282typedef enum MMAL_VIDEO_LEVEL_T {
283 MMAL_VIDEO_LEVEL_H263_10,
284 MMAL_VIDEO_LEVEL_H263_20,
285 MMAL_VIDEO_LEVEL_H263_30,
286 MMAL_VIDEO_LEVEL_H263_40,
287 MMAL_VIDEO_LEVEL_H263_45,
288 MMAL_VIDEO_LEVEL_H263_50,
289 MMAL_VIDEO_LEVEL_H263_60,
290 MMAL_VIDEO_LEVEL_H263_70,
291 MMAL_VIDEO_LEVEL_MP4V_0,
292 MMAL_VIDEO_LEVEL_MP4V_0b,
293 MMAL_VIDEO_LEVEL_MP4V_1,
294 MMAL_VIDEO_LEVEL_MP4V_2,
295 MMAL_VIDEO_LEVEL_MP4V_3,
296 MMAL_VIDEO_LEVEL_MP4V_4,
297 MMAL_VIDEO_LEVEL_MP4V_4a,
298 MMAL_VIDEO_LEVEL_MP4V_5,
299 MMAL_VIDEO_LEVEL_MP4V_6,
300 MMAL_VIDEO_LEVEL_H264_1,
301 MMAL_VIDEO_LEVEL_H264_1b,
302 MMAL_VIDEO_LEVEL_H264_11,
303 MMAL_VIDEO_LEVEL_H264_12,
304 MMAL_VIDEO_LEVEL_H264_13,
305 MMAL_VIDEO_LEVEL_H264_2,
306 MMAL_VIDEO_LEVEL_H264_21,
307 MMAL_VIDEO_LEVEL_H264_22,
308 MMAL_VIDEO_LEVEL_H264_3,
309 MMAL_VIDEO_LEVEL_H264_31,
310 MMAL_VIDEO_LEVEL_H264_32,
311 MMAL_VIDEO_LEVEL_H264_4,
312 MMAL_VIDEO_LEVEL_H264_41,
313 MMAL_VIDEO_LEVEL_H264_42,
314 MMAL_VIDEO_LEVEL_H264_5,
315 MMAL_VIDEO_LEVEL_H264_51,
316 MMAL_VIDEO_LEVEL_DUMMY = 0x7FFFFFFF
317} MMAL_VIDEO_LEVEL_T;
318
319/** Video profile and level setting.
320 * This is a variable length structure when querying the supported profiles and
321 * levels. To get more than one, pass a structure with more profile/level pairs.
322 */
323typedef struct MMAL_PARAMETER_VIDEO_PROFILE_T
324{
325 MMAL_PARAMETER_HEADER_T hdr;
326
327 struct
328 {
329 MMAL_VIDEO_PROFILE_T profile;
330 MMAL_VIDEO_LEVEL_T level;
331 } profile[1];
332} MMAL_PARAMETER_VIDEO_PROFILE_T;
333
334/** Manner of video rate control */
335typedef enum MMAL_VIDEO_RATECONTROL_T {
336 MMAL_VIDEO_RATECONTROL_DEFAULT,
337 MMAL_VIDEO_RATECONTROL_VARIABLE,
338 MMAL_VIDEO_RATECONTROL_CONSTANT,
339 MMAL_VIDEO_RATECONTROL_VARIABLE_SKIP_FRAMES,
340 MMAL_VIDEO_RATECONTROL_CONSTANT_SKIP_FRAMES,
341 MMAL_VIDEO_RATECONTROL_DUMMY = 0x7fffffff
342} MMAL_VIDEO_RATECONTROL_T;
343
344/** Intra refresh modes */
345typedef enum MMAL_VIDEO_INTRA_REFRESH_T {
346 MMAL_VIDEO_INTRA_REFRESH_CYCLIC,
347 MMAL_VIDEO_INTRA_REFRESH_ADAPTIVE,
348 MMAL_VIDEO_INTRA_REFRESH_BOTH,
349 MMAL_VIDEO_INTRA_REFRESH_KHRONOSEXTENSIONS = 0x6F000000,
350 MMAL_VIDEO_INTRA_REFRESH_VENDORSTARTUNUSED = 0x7F000000,
351 MMAL_VIDEO_INTRA_REFRESH_CYCLIC_MROWS,
352 MMAL_VIDEO_INTRA_REFRESH_PSEUDO_RAND,
353 MMAL_VIDEO_INTRA_REFRESH_MAX,
354 MMAL_VIDEO_INTRA_REFRESH_DUMMY = 0x7FFFFFFF
355} MMAL_VIDEO_INTRA_REFRESH_T;
356
357/*Encode RC Models Supported*/
358typedef enum MMAL_VIDEO_ENCODE_RC_MODEL_T {
359 MMAL_VIDEO_ENCODER_RC_MODEL_DEFAULT = 0,
360 MMAL_VIDEO_ENCODER_RC_MODEL_JVT = MMAL_VIDEO_ENCODER_RC_MODEL_DEFAULT,
361 MMAL_VIDEO_ENCODER_RC_MODEL_VOWIFI,
362 MMAL_VIDEO_ENCODER_RC_MODEL_CBR,
363 MMAL_VIDEO_ENCODER_RC_MODEL_LAST,
364 MMAL_VIDEO_ENCODER_RC_MODEL_DUMMY = 0x7FFFFFFF
365} MMAL_VIDEO_ENCODE_RC_MODEL_T;
366
367typedef struct MMAL_PARAMETER_VIDEO_ENCODE_RC_MODEL_T {
368 MMAL_PARAMETER_HEADER_T hdr;
369 MMAL_VIDEO_ENCODE_RC_MODEL_T rc_model;
370}MMAL_PARAMETER_VIDEO_ENCODE_RC_MODEL_T;
371
372/** Video rate control setting */
373typedef struct MMAL_PARAMETER_VIDEO_RATECONTROL_T {
374 MMAL_PARAMETER_HEADER_T hdr;
375
376 MMAL_VIDEO_RATECONTROL_T control;
377} MMAL_PARAMETER_VIDEO_RATECONTROL_T;
378
379/*H264 INTRA MB MODES*/
380typedef enum MMAL_VIDEO_ENCODE_H264_MB_INTRA_MODES_T {
381 MMAL_VIDEO_ENCODER_H264_MB_4x4_INTRA = 1,
382 MMAL_VIDEO_ENCODER_H264_MB_8x8_INTRA = 2,
383 MMAL_VIDEO_ENCODER_H264_MB_16x16_INTRA = 4,
384 MMAL_VIDEO_ENCODER_H264_MB_INTRA_DUMMY = 0x7fffffff
385} MMAL_VIDEO_ENCODE_H264_MB_INTRA_MODES_T;
386
387typedef struct MMAL_PARAMETER_VIDEO_ENCODER_H264_MB_INTRA_MODES_T {
388 MMAL_PARAMETER_HEADER_T hdr;
389 MMAL_VIDEO_ENCODE_H264_MB_INTRA_MODES_T mb_mode;
390}MMAL_PARAMETER_VIDEO_ENCODER_H264_MB_INTRA_MODES_T;
391
392/** NAL unit formats */
393typedef enum MMAL_VIDEO_NALUNITFORMAT_T {
394 MMAL_VIDEO_NALUNITFORMAT_STARTCODES = 1,
395 MMAL_VIDEO_NALUNITFORMAT_NALUNITPERBUFFER = 2,
396 MMAL_VIDEO_NALUNITFORMAT_ONEBYTEINTERLEAVELENGTH = 4,
397 MMAL_VIDEO_NALUNITFORMAT_TWOBYTEINTERLEAVELENGTH = 8,
398 MMAL_VIDEO_NALUNITFORMAT_FOURBYTEINTERLEAVELENGTH = 16,
399 MMAL_VIDEO_NALUNITFORMAT_DUMMY = 0x7fffffff
400} MMAL_VIDEO_NALUNITFORMAT_T;
401
402/** NAL unit format setting */
403typedef struct MMAL_PARAMETER_VIDEO_NALUNITFORMAT_T {
404 MMAL_PARAMETER_HEADER_T hdr;
405
406 MMAL_VIDEO_NALUNITFORMAT_T format;
407} MMAL_PARAMETER_VIDEO_NALUNITFORMAT_T;
408
409/** H264 Only: Overrides for max macro-blocks per second, max framesize,
410 * and max bitrates. This overrides the default maximums for the configured level.
411 */
412typedef struct MMAL_PARAMETER_VIDEO_LEVEL_EXTENSION_T {
413 MMAL_PARAMETER_HEADER_T hdr;
414
415 uint32_t custom_max_mbps;
416 uint32_t custom_max_fs;
417 uint32_t custom_max_br_and_cpb;
418} MMAL_PARAMETER_VIDEO_LEVEL_EXTENSION_T;
419
420/** H264 Only: Overrides for max macro-blocks per second, max framesize,
421 * and max bitrates. This overrides the default maximums for the configured level.
422 */
423typedef struct MMAL_PARAMETER_VIDEO_INTRA_REFRESH_T {
424 MMAL_PARAMETER_HEADER_T hdr;
425
426 MMAL_VIDEO_INTRA_REFRESH_T refresh_mode;
427 uint32_t air_mbs;
428 uint32_t air_ref;
429 uint32_t cir_mbs;
430 uint32_t pir_mbs;
431} MMAL_PARAMETER_VIDEO_INTRA_REFRESH_T;
432
433/** Structure for enabling EEDE, we keep it like this for now, there could be extra fields in the future */
434typedef struct MMAL_PARAMETER_VIDEO_EEDE_ENABLE_T {
435 MMAL_PARAMETER_HEADER_T hdr;
436
437 uint32_t enable;
438} MMAL_PARAMETER_VIDEO_EEDE_ENABLE_T;
439
440/** Structure for setting lossrate for EEDE, we keep it like this for now, there could be extra fields in the future */
441typedef struct MMAL_PARAMETER_VIDEO_EEDE_LOSSRATE_T {
442 MMAL_PARAMETER_HEADER_T hdr;
443
444 uint32_t loss_rate;
445} MMAL_PARAMETER_VIDEO_EEDE_LOSSRATE_T;
446
447/** Structure for setting initial DRM parameters */
448typedef struct MMAL_PARAMETER_VIDEO_DRM_INIT_INFO_T {
449 MMAL_PARAMETER_HEADER_T hdr;
450
451 uint32_t current_time;
452 uint32_t ticks_per_sec;
453 uint8_t lhs[32];
454} MMAL_PARAMETER_VIDEO_DRM_INIT_INFO_T;
455
456/** Structure for requesting a hardware-protected memory buffer **/
457typedef struct MMAL_PARAMETER_VIDEO_DRM_PROTECT_BUFFER_T {
458 MMAL_PARAMETER_HEADER_T hdr;
459
460 uint32_t size_wanted; /**< Input. Zero size means internal video decoder buffer,
461 mem_handle and phys_addr not returned in this case */
462 uint32_t protect; /**< Input. 1 = protect, 0 = unprotect */
463
464 uint32_t mem_handle; /**< Output. Handle for protected buffer */
465 void * phys_addr; /**< Output. Physical memory address of protected buffer */
466
467} MMAL_PARAMETER_VIDEO_DRM_PROTECT_BUFFER_T;
468
469typedef struct MMAL_PARAMETER_VIDEO_RENDER_STATS_T {
470 MMAL_PARAMETER_HEADER_T hdr;
471
472 MMAL_BOOL_T valid;
473 uint32_t match;
474 uint32_t period;
475 uint32_t phase;
476 uint32_t pixel_clock_nominal;
477 uint32_t pixel_clock;
478 uint32_t hvs_status;
479 uint32_t dummy[2];
480} MMAL_PARAMETER_VIDEO_RENDER_STATS_T;
481
482typedef enum MMAL_INTERLACETYPE_T {
483 MMAL_InterlaceProgressive, /**< The data is not interlaced, it is progressive scan */
484 MMAL_InterlaceFieldSingleUpperFirst, /**< The data is interlaced, fields sent
485 separately in temporal order, with upper field first */
486 MMAL_InterlaceFieldSingleLowerFirst, /**< The data is interlaced, fields sent
487 separately in temporal order, with lower field first */
488 MMAL_InterlaceFieldsInterleavedUpperFirst, /**< The data is interlaced, two fields sent together line
489 interleaved, with the upper field temporally earlier */
490 MMAL_InterlaceFieldsInterleavedLowerFirst, /**< The data is interlaced, two fields sent together line
491 interleaved, with the lower field temporally earlier */
492 MMAL_InterlaceMixed, /**< The stream may contain a mixture of progressive
493 and interlaced frames */
494 MMAL_InterlaceKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
495 MMAL_InterlaceVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
496 MMAL_InterlaceMax = 0x7FFFFFFF
497} MMAL_INTERLACETYPE_T;
498
499typedef struct MMAL_PARAMETER_VIDEO_INTERLACE_TYPE_T {
500 MMAL_PARAMETER_HEADER_T hdr;
501
502 MMAL_INTERLACETYPE_T eMode; /**< The interlace type of the content */
503 MMAL_BOOL_T bRepeatFirstField; /**< Whether to repeat the first field */
504} MMAL_PARAMETER_VIDEO_INTERLACE_TYPE_T;
505
506typedef enum MMAL_SOURCE_PATTERN_T {
507 MMAL_VIDEO_SOURCE_PATTERN_WHITE,
508 MMAL_VIDEO_SOURCE_PATTERN_BLACK,
509 MMAL_VIDEO_SOURCE_PATTERN_DIAGONAL,
510 MMAL_VIDEO_SOURCE_PATTERN_NOISE,
511 MMAL_VIDEO_SOURCE_PATTERN_RANDOM,
512 MMAL_VIDEO_SOURCE_PATTERN_COLOUR,
513 MMAL_VIDEO_SOURCE_PATTERN_BLOCKS,
514 MMAL_VIDEO_SOURCE_PATTERN_SWIRLY,
515 MMAL_VIDEO_SOURCE_PATTERN_DUMMY = 0x7fffffff
516} MMAL_SOURCE_PATTERN_T;
517
518typedef struct MMAL_PARAMETER_VIDEO_SOURCE_PATTERN_T {
519 MMAL_PARAMETER_HEADER_T hdr;
520
521 MMAL_SOURCE_PATTERN_T pattern;
522 uint32_t param; /**< Colour for PATTERN_COLOUR mode */
523 uint32_t framecount; /**< Number of frames to produce. 0 for continuous. */
524 MMAL_RATIONAL_T framerate; /**< Framerate used when determining buffer timestamps */
525} MMAL_PARAMETER_VIDEO_SOURCE_PATTERN_T;
526
527
528#endif
529