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_H
29#define MMAL_PARAMETERS_H
30
31#include "mmal_common.h"
32#include "mmal_parameters_camera.h"
33#include "mmal_parameters_video.h"
34#include "mmal_parameters_audio.h"
35#include "mmal_parameters_clock.h"
36
37/** \defgroup MmalParameters List of pre-defined parameters
38 * This defines a list of standard parameters. Components can define proprietary
39 * parameters by creating a new group and defining their own structures. */
40/* @{ */
41
42/** Generic unsigned 64-bit integer parameter type. */
43typedef struct MMAL_PARAMETER_UINT64_T
44{
45 MMAL_PARAMETER_HEADER_T hdr;
46
47 uint64_t value; /**< Parameter value */
48} MMAL_PARAMETER_UINT64_T;
49
50/** Generic signed 64-bit integer parameter type. */
51typedef struct MMAL_PARAMETER_INT64_T
52{
53 MMAL_PARAMETER_HEADER_T hdr;
54
55 int64_t value; /**< Parameter value */
56} MMAL_PARAMETER_INT64_T;
57
58/** Generic unsigned 32-bit integer parameter type. */
59typedef struct MMAL_PARAMETER_UINT32_T
60{
61 MMAL_PARAMETER_HEADER_T hdr;
62
63 uint32_t value; /**< Parameter value */
64} MMAL_PARAMETER_UINT32_T;
65
66/** Generic signed 32-bit integer parameter type. */
67typedef struct MMAL_PARAMETER_INT32_T
68{
69 MMAL_PARAMETER_HEADER_T hdr;
70
71 int32_t value; /**< Parameter value */
72} MMAL_PARAMETER_INT32_T;
73
74/** Generic rational parameter type. */
75typedef struct MMAL_PARAMETER_RATIONAL_T {
76 MMAL_PARAMETER_HEADER_T hdr;
77
78 MMAL_RATIONAL_T value; /**< Parameter value */
79} MMAL_PARAMETER_RATIONAL_T;
80
81/** Generic boolean parameter type. */
82typedef struct MMAL_PARAMETER_BOOLEAN_T
83{
84 MMAL_PARAMETER_HEADER_T hdr;
85
86 MMAL_BOOL_T enable; /**< Parameter value */
87} MMAL_PARAMETER_BOOLEAN_T;
88
89/** Generic string parameter type. */
90typedef struct MMAL_PARAMETER_STRING_T
91{
92 MMAL_PARAMETER_HEADER_T hdr;
93
94 char str[1]; /**< Null-terminated string */
95} MMAL_PARAMETER_STRING_T;
96
97/** Generic array of bytes parameter type. */
98typedef struct MMAL_PARAMETER_BYTES_T
99{
100 MMAL_PARAMETER_HEADER_T hdr;
101
102 uint8_t data[1]; /**< Array of bytes */
103} MMAL_PARAMETER_BYTES_T;
104
105/** The value 1 in 16.16 fixed point form */
106#define MMAL_FIXED_16_16_ONE (1 << 16)
107
108/** Generic two-dimensional scaling factor type. */
109typedef struct MMAL_PARAMETER_SCALEFACTOR_T
110{
111 MMAL_PARAMETER_HEADER_T hdr;
112
113 MMAL_FIXED_16_16_T scale_x; /**< Scaling factor in X-axis */
114 MMAL_FIXED_16_16_T scale_y; /**< Scaling factor in Y-axis */
115} MMAL_PARAMETER_SCALEFACTOR_T;
116
117/** Valid mirror modes */
118typedef enum MMAL_PARAM_MIRROR_T
119{
120 MMAL_PARAM_MIRROR_NONE,
121 MMAL_PARAM_MIRROR_VERTICAL,
122 MMAL_PARAM_MIRROR_HORIZONTAL,
123 MMAL_PARAM_MIRROR_BOTH,
124} MMAL_PARAM_MIRROR_T;
125
126/** Generic mirror parameter type */
127typedef struct MMAL_PARAMETER_MIRROR_T
128{
129 MMAL_PARAMETER_HEADER_T hdr;
130
131 MMAL_PARAM_MIRROR_T value; /**< Mirror mode */
132} MMAL_PARAMETER_MIRROR_T;
133
134/** URI parameter type.
135 * The parameter may hold an arbitrary length, nul-terminated string as long
136 * as the size is set appropriately.
137 */
138typedef struct MMAL_PARAMETER_URI_T
139{
140 MMAL_PARAMETER_HEADER_T hdr;
141
142 char uri[1]; /**< URI string (null-terminated) */
143} MMAL_PARAMETER_URI_T;
144
145/** Generic encoding parameter type.
146 * The parameter may hold more than one encoding by overriding the size to
147 * include a bigger array.
148 */
149typedef struct MMAL_PARAMETER_ENCODING_T
150{
151 MMAL_PARAMETER_HEADER_T hdr;
152
153 uint32_t encoding[1]; /**< Array of FourCC encodings, see \ref MmalEncodings */
154} MMAL_PARAMETER_ENCODING_T;
155
156/** Generic frame-rate parameter type.
157 * Frame rates are specified as a rational number, using a pair of integers.
158 * Since there can be many valid pairs for the same ratio, a frame-rate may
159 * not contain exactly the same pairs of values when read back as it was
160 * when set.
161 */
162typedef struct MMAL_PARAMETER_FRAME_RATE_T {
163 MMAL_PARAMETER_HEADER_T hdr;
164
165 MMAL_RATIONAL_T frame_rate; /**< Frame-rate value */
166} MMAL_PARAMETER_FRAME_RATE_T;
167
168/** Generic configuration-file setup type.
169 * Configuration files are transferred in small chunks. The component can
170 * save all the chunks into a buffer, then process the entire file later.
171 * This parameter initialises a config file to have the given size.
172 */
173typedef struct MMAL_PARAMETER_CONFIGFILE_T {
174 MMAL_PARAMETER_HEADER_T hdr;
175
176 uint32_t file_size; /**< Size of complete file data */
177} MMAL_PARAMETER_CONFIGFILE_T;
178
179/** Generic configuration-file chunk data type.
180 * Once a config file has been initialised, this parameter can be used to
181 * write an arbitrary chunk of the file data (limited by the maximum MMAL
182 * message size).
183 */
184typedef struct MMAL_PARAMETER_CONFIGFILE_CHUNK_T {
185 MMAL_PARAMETER_HEADER_T hdr;
186
187 uint32_t size; /**< Number of bytes being transferred in this chunk */
188 uint32_t offset; /**< Offset of this chunk in the file */
189 char data[1]; /**< Chunk data */
190} MMAL_PARAMETER_CONFIGFILE_CHUNK_T;
191
192/* @} */
193
194#endif /* MMAL_PARAMETERS_H */
195