|
#define | MMAL_OFFSET(TYPE, FIELD) ((size_t)((uint8_t *)&((TYPE*)0)->FIELD - (uint8_t *)0)) |
|
|
const char * | mmal_status_to_string (MMAL_STATUS_T status) |
|
uint32_t | mmal_encoding_stride_to_width (uint32_t encoding, uint32_t stride) |
|
uint32_t | mmal_encoding_width_to_stride (uint32_t encoding, uint32_t width) |
|
const char * | mmal_port_type_to_string (MMAL_PORT_TYPE_T type) |
|
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_port_parameter_free (MMAL_PARAMETER_HEADER_T *param) |
|
void | mmal_buffer_header_copy_header (MMAL_BUFFER_HEADER_T *dest, const MMAL_BUFFER_HEADER_T *src) |
|
MMAL_POOL_T * | mmal_port_pool_create (MMAL_PORT_T *port, unsigned int headers, uint32_t payload_size) |
|
void | mmal_port_pool_destroy (MMAL_PORT_T *port, MMAL_POOL_T *pool) |
|
void | mmal_log_dump_port (MMAL_PORT_T *port) |
|
void | mmal_log_dump_format (MMAL_ES_FORMAT_T *format) |
|
MMAL_PORT_T * | mmal_util_get_port (MMAL_COMPONENT_T *comp, MMAL_PORT_TYPE_T type, unsigned index) |
|
char * | mmal_4cc_to_string (char *buf, size_t len, uint32_t fourcc) |
|
The utility functions provide helpers for common functionality that is not part of the core MMAL API.
#define MMAL_OFFSET |
( |
|
TYPE, |
|
|
|
FIELD |
|
) |
| ((size_t)((uint8_t *)&((TYPE*)0)->FIELD - (uint8_t *)0)) |
Offset in bytes of FIELD in TYPE.
char* mmal_4cc_to_string |
( |
char * |
buf, |
|
|
size_t |
len, |
|
|
uint32_t |
fourcc |
|
) |
| |
Convert a 4cc into a string.
- Parameters
-
buf | Destination for result |
len | Size of result buffer |
fourcc | 4cc to be converted |
- Returns
- converted string (buf)
Copy buffer header metadata from source to destination.
- Parameters
-
dest | The destination buffer header. |
src | The source buffer header. |
uint32_t mmal_encoding_stride_to_width |
( |
uint32_t |
encoding, |
|
|
uint32_t |
stride |
|
) |
| |
Convert stride to pixel width for a given pixel encoding.
- Parameters
-
- Returns
- The width in pixels.
uint32_t mmal_encoding_width_to_stride |
( |
uint32_t |
encoding, |
|
|
uint32_t |
width |
|
) |
| |
Convert pixel width to stride for a given pixel encoding
- Parameters
-
- Returns
- The stride in bytes.
Log the content of a MMAL_ES_FORMAT_T structure.
- Parameters
-
format | Pointer to the format to dump. |
Log the content of a MMAL_PORT_T structure.
- Parameters
-
port | Pointer to the port to dump. |
Get a parameter from a port allocating the required amount of memory for the parameter (i.e. for variable length parameters like URI or arrays). The size field will be set on output to the actual size of the parameter allocated and retrieved.
The pointer returned must be released by a call to mmal_port_parameter_free().
- Parameters
-
port | port to send request to |
id | parameter id |
size | initial size hint for allocation (can be 0) |
status | status of the parameter get operation (can be 0) |
- Returns
- pointer to the header of the parameter or NULL on failure.
Create a pool of MMAL_BUFFER_HEADER_T associated with a specific port. This allows a client to allocate memory for the payload buffers based on the preferences of a port. This for instance will allow the port to allocate memory which can be shared between the host processor and videocore. After allocation, all allocated buffer headers will have been added to the queue.
It is valid to create a pool with no buffer headers, or with zero size payload buffers. The mmal_pool_resize() function can be used to increase or decrease the number of buffer headers, or the size of the payload buffers, after creation of the pool.
- Parameters
-
port | Port responsible for creating the pool. |
headers | Number of buffers which will be allocated with the pool. |
payload_size | Size of the payload buffer which will be allocated in each of the buffer headers. |
- Returns
- Pointer to the newly created pool or NULL on failure.
Destroy a pool of MMAL_BUFFER_HEADER_T associated with a specific port. This will also deallocate all of the memory which was allocated when creating or resizing the pool.
- Parameters
-
port | Pointer to the port responsible for creating the pool. |
pool | Pointer to the pool to be destroyed. |
Convert a port type to a string.
- Parameters
-
- Returns
- A NULL-terminated string describing the port type.
Convert a status to a statically-allocated string.
- Parameters
-
status | The MMAL status code. |
- Returns
- A C string describing the status code.
Return the nth port.
- Parameters
-
comp | component to query |
index | port index |
type | port type |
- Returns
- port or NULL if not found