| 1 | /* |
| 2 | Copyright (c) 2012, Broadcom Europe Ltd |
| 3 | All rights reserved. |
| 4 | |
| 5 | Redistribution and use in source and binary forms, with or without |
| 6 | modification, 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 | |
| 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY |
| 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 23 | ON 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 |
| 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | */ |
| 27 | |
| 28 | #ifndef MMAL_PARAMETERS_COMMON_H |
| 29 | #define MMAL_PARAMETERS_COMMON_H |
| 30 | |
| 31 | /** @defgroup MMAL_PARAMETER_IDS Pre-defined MMAL parameter IDs |
| 32 | * @ingroup MmalParameters |
| 33 | * @{ |
| 34 | */ |
| 35 | |
| 36 | /** @name Parameter groups |
| 37 | * Parameters are divided into groups, and then allocated sequentially within |
| 38 | * a group using an enum. |
| 39 | * @{ |
| 40 | */ |
| 41 | |
| 42 | /** Common parameter ID group, used with many types of component. */ |
| 43 | #define MMAL_PARAMETER_GROUP_COMMON (0<<16) |
| 44 | /** Camera-specific parameter ID group. */ |
| 45 | #define MMAL_PARAMETER_GROUP_CAMERA (1<<16) |
| 46 | /** Video-specific parameter ID group. */ |
| 47 | #define MMAL_PARAMETER_GROUP_VIDEO (2<<16) |
| 48 | /** Audio-specific parameter ID group. */ |
| 49 | #define MMAL_PARAMETER_GROUP_AUDIO (3<<16) |
| 50 | /** Clock-specific parameter ID group. */ |
| 51 | #define MMAL_PARAMETER_GROUP_CLOCK (4<<16) |
| 52 | /** Miracast-specific parameter ID group. */ |
| 53 | #define MMAL_PARAMETER_GROUP_MIRACAST (5<<16) |
| 54 | |
| 55 | |
| 56 | /**@}*/ |
| 57 | |
| 58 | /** Common MMAL parameter IDs. |
| 59 | */ |
| 60 | enum { |
| 61 | MMAL_PARAMETER_UNUSED /**< Never a valid parameter ID */ |
| 62 | = MMAL_PARAMETER_GROUP_COMMON, |
| 63 | MMAL_PARAMETER_SUPPORTED_ENCODINGS, /**< Takes a MMAL_PARAMETER_ENCODING_T */ |
| 64 | MMAL_PARAMETER_URI, /**< Takes a MMAL_PARAMETER_URI_T */ |
| 65 | MMAL_PARAMETER_CHANGE_EVENT_REQUEST, /**< Takes a MMAL_PARAMETER_CHANGE_EVENT_REQUEST_T */ |
| 66 | MMAL_PARAMETER_ZERO_COPY, /**< Takes a MMAL_PARAMETER_BOOLEAN_T */ |
| 67 | MMAL_PARAMETER_BUFFER_REQUIREMENTS, /**< Takes a MMAL_PARAMETER_BUFFER_REQUIREMENTS_T */ |
| 68 | MMAL_PARAMETER_STATISTICS, /**< Takes a MMAL_PARAMETER_STATISTICS_T */ |
| 69 | MMAL_PARAMETER_CORE_STATISTICS, /**< Takes a MMAL_PARAMETER_CORE_STATISTICS_T */ |
| 70 | MMAL_PARAMETER_MEM_USAGE, /**< Takes a MMAL_PARAMETER_MEM_USAGE_T */ |
| 71 | MMAL_PARAMETER_BUFFER_FLAG_FILTER, /**< Takes a MMAL_PARAMETER_UINT32_T */ |
| 72 | MMAL_PARAMETER_SEEK, /**< Takes a MMAL_PARAMETER_SEEK_T */ |
| 73 | MMAL_PARAMETER_POWERMON_ENABLE, /**< Takes a MMAL_PARAMETER_BOOLEAN_T */ |
| 74 | MMAL_PARAMETER_LOGGING, /**< Takes a MMAL_PARAMETER_LOGGING_T */ |
| 75 | MMAL_PARAMETER_SYSTEM_TIME, /**< Takes a MMAL_PARAMETER_UINT64_T */ |
| 76 | MMAL_PARAMETER_NO_IMAGE_PADDING, /**< Takes a MMAL_PARAMETER_BOOLEAN_T */ |
| 77 | MMAL_PARAMETER_LOCKSTEP_ENABLE /**< Takes a MMAL_PARAMETER_BOOLEAN_T */ |
| 78 | }; |
| 79 | |
| 80 | /**@}*/ |
| 81 | |
| 82 | /** Parameter header type. All parameter structures need to begin with this type. |
| 83 | * The \ref id field must be set to a parameter ID, such as one of those listed on |
| 84 | * the \ref MMAL_PARAMETER_IDS "Pre-defined MMAL parameter IDs" page. |
| 85 | */ |
| 86 | typedef struct |
| 87 | { |
| 88 | uint32_t ; /**< Parameter ID. */ |
| 89 | uint32_t ; /**< Size in bytes of the parameter (including the header) */ |
| 90 | } ; |
| 91 | |
| 92 | /** Change event request parameter type. |
| 93 | * This is used to control whether a \ref MMAL_EVENT_PARAMETER_CHANGED_T event |
| 94 | * is issued should a given parameter change. |
| 95 | */ |
| 96 | typedef struct MMAL_PARAMETER_CHANGE_EVENT_REQUEST_T |
| 97 | { |
| 98 | MMAL_PARAMETER_HEADER_T hdr; |
| 99 | |
| 100 | uint32_t change_id; /**< ID of parameter that may change, see \ref MMAL_PARAMETER_IDS */ |
| 101 | MMAL_BOOL_T enable; /**< True if the event is enabled, false if disabled */ |
| 102 | } MMAL_PARAMETER_CHANGE_EVENT_REQUEST_T; |
| 103 | |
| 104 | /** Buffer requirements parameter. |
| 105 | * This is mainly used to increase the requirements of a component. */ |
| 106 | typedef struct MMAL_PARAMETER_BUFFER_REQUIREMENTS_T |
| 107 | { |
| 108 | MMAL_PARAMETER_HEADER_T hdr; |
| 109 | |
| 110 | uint32_t buffer_num_min; /**< Minimum number of buffers the port requires */ |
| 111 | uint32_t buffer_size_min; /**< Minimum size of buffers the port requires */ |
| 112 | uint32_t buffer_alignment_min; /**< Minimum alignment requirement for the buffers. |
| 113 | A value of zero means no special alignment requirements. */ |
| 114 | uint32_t buffer_num_recommended; /**< Number of buffers the port recommends for optimal performance. |
| 115 | A value of zero means no special recommendation. */ |
| 116 | uint32_t buffer_size_recommended; /**< Size of buffers the port recommends for optimal performance. |
| 117 | A value of zero means no special recommendation. */ |
| 118 | } MMAL_PARAMETER_BUFFER_REQUIREMENTS_T; |
| 119 | |
| 120 | /** Seek request parameter type. |
| 121 | * This is used to issue a seek request to a source component. |
| 122 | */ |
| 123 | typedef struct MMAL_PARAMETER_SEEK_T |
| 124 | { |
| 125 | MMAL_PARAMETER_HEADER_T hdr; |
| 126 | |
| 127 | int64_t offset; /**< Offset (in microseconds) to seek to */ |
| 128 | uint32_t flags; /**< Seeking flags */ |
| 129 | |
| 130 | #define MMAL_PARAM_SEEK_FLAG_PRECISE 0x1 /**< Choose precise seeking even if slower */ |
| 131 | #define MMAL_PARAM_SEEK_FLAG_FORWARD 0x2 /**< Seek to the next keyframe following the specified offset */ |
| 132 | |
| 133 | } MMAL_PARAMETER_SEEK_T; |
| 134 | |
| 135 | /** Port statistics for debugging/test purposes. |
| 136 | * Ports may support query of this parameter to return statistics for debugging or |
| 137 | * test purposes. Not all values may be relevant for a given port. |
| 138 | */ |
| 139 | typedef struct MMAL_PARAMETER_STATISTICS_T |
| 140 | { |
| 141 | MMAL_PARAMETER_HEADER_T hdr; |
| 142 | |
| 143 | uint32_t buffer_count; /**< Total number of buffers processed */ |
| 144 | uint32_t frame_count; /**< Total number of frames processed */ |
| 145 | uint32_t frames_skipped; /**< Number of frames without expected PTS based on frame rate */ |
| 146 | uint32_t frames_discarded; /**< Number of frames discarded */ |
| 147 | uint32_t eos_seen; /**< Set if the end of stream has been reached */ |
| 148 | uint32_t maximum_frame_bytes; /**< Maximum frame size in bytes */ |
| 149 | int64_t total_bytes; /**< Total number of bytes processed */ |
| 150 | uint32_t corrupt_macroblocks; /**< Number of corrupt macroblocks in the stream */ |
| 151 | } MMAL_PARAMETER_STATISTICS_T; |
| 152 | |
| 153 | typedef enum |
| 154 | { |
| 155 | MMAL_CORE_STATS_RX, |
| 156 | MMAL_CORE_STATS_TX, |
| 157 | MMAL_CORE_STATS_MAX = 0x7fffffff /* Force 32 bit size for this enum */ |
| 158 | } MMAL_CORE_STATS_DIR; |
| 159 | |
| 160 | /** MMAL core statistics. These are collected by the core itself. |
| 161 | */ |
| 162 | typedef struct MMAL_PARAMETER_CORE_STATISTICS_T |
| 163 | { |
| 164 | MMAL_PARAMETER_HEADER_T hdr; |
| 165 | MMAL_CORE_STATS_DIR dir; |
| 166 | MMAL_BOOL_T reset; /**< Reset to zero after reading */ |
| 167 | MMAL_CORE_STATISTICS_T stats; /**< The statistics */ |
| 168 | } MMAL_PARAMETER_CORE_STATISTICS_T; |
| 169 | |
| 170 | /** |
| 171 | * Component memory usage statistics. |
| 172 | */ |
| 173 | typedef struct MMAL_PARAMETER_MEM_USAGE_T |
| 174 | { |
| 175 | MMAL_PARAMETER_HEADER_T hdr; |
| 176 | /**< The amount of memory allocated in image pools by the component */ |
| 177 | uint32_t pool_mem_alloc_size; |
| 178 | } MMAL_PARAMETER_MEM_USAGE_T; |
| 179 | |
| 180 | /** |
| 181 | * Logging control. |
| 182 | */ |
| 183 | typedef struct MMAL_PARAMETER_LOGGING_T |
| 184 | { |
| 185 | MMAL_PARAMETER_HEADER_T hdr; |
| 186 | uint32_t set; /**< Logging bits to set */ |
| 187 | uint32_t clear; /**< Logging bits to clear */ |
| 188 | } MMAL_PARAMETER_LOGGING_T; |
| 189 | |
| 190 | #endif /* MMAL_PARAMETERS_COMMON_H */ |
| 191 | |
| 192 | |