My Project
mmal_util.h
Go to the documentation of this file.
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_UTIL_H
29 #define MMAL_UTIL_H
30 
31 #include "interface/mmal/mmal.h"
32 
40 #define MMAL_OFFSET(TYPE, FIELD) ((size_t)((uint8_t *)&((TYPE*)0)->FIELD - (uint8_t *)0))
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
51 const char *mmal_status_to_string(MMAL_STATUS_T status);
52 
59 uint32_t mmal_encoding_stride_to_width(uint32_t encoding, uint32_t stride);
60 
67 uint32_t mmal_encoding_width_to_stride(uint32_t encoding, uint32_t width);
68 
74 uint32_t mmal_encoding_get_slice_variant(uint32_t encoding);
75 
82 
97  uint32_t id, uint32_t size, MMAL_STATUS_T *status);
98 
105 
112 
130  unsigned int headers, uint32_t payload_size);
131 
140 
145 void mmal_log_dump_port(MMAL_PORT_T *port);
146 
152 
162 
171 char *mmal_4cc_to_string(char *buf, size_t len, uint32_t fourcc);
172 
173 
184 
185 #ifdef __cplusplus
186 }
187 #endif
188 
191 #endif
const char * mmal_status_to_string(MMAL_STATUS_T status)
void mmal_log_dump_format(MMAL_ES_FORMAT_T *format)
int mmal_util_rgb_order_fixed(MMAL_PORT_T *port)
MMAL_PORT_T * mmal_util_get_port(MMAL_COMPONENT_T *comp, MMAL_PORT_TYPE_T type, unsigned index)
void mmal_port_parameter_free(MMAL_PARAMETER_HEADER_T *param)
MMAL_PORT_TYPE_T
Definition: mmal_port.h:45
char * mmal_4cc_to_string(char *buf, size_t len, uint32_t fourcc)
uint32_t mmal_encoding_stride_to_width(uint32_t encoding, uint32_t stride)
void mmal_buffer_header_copy_header(MMAL_BUFFER_HEADER_T *dest, const MMAL_BUFFER_HEADER_T *src)
const char * mmal_port_type_to_string(MMAL_PORT_TYPE_T type)
MMAL_POOL_T * mmal_port_pool_create(MMAL_PORT_T *port, unsigned int headers, uint32_t payload_size)
uint32_t mmal_encoding_width_to_stride(uint32_t encoding, uint32_t width)
MMAL_PARAMETER_HEADER_T * mmal_port_parameter_alloc_get(MMAL_PORT_T *port, uint32_t id, uint32_t size, MMAL_STATUS_T *status)
void mmal_log_dump_port(MMAL_PORT_T *port)
void mmal_port_pool_destroy(MMAL_PORT_T *port, MMAL_POOL_T *pool)
MMAL_STATUS_T
Definition: mmal_types.h:46
uint32_t mmal_encoding_get_slice_variant(uint32_t encoding)