|
#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) |
|
uint32_t | mmal_encoding_get_slice_variant (uint32_t encoding) |
|
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) |
|
int | mmal_util_rgb_order_fixed (MMAL_PORT_T *port) |
|
The utility functions provide helpers for common functionality that is not part of the core MMAL API.
◆ MMAL_OFFSET
#define MMAL_OFFSET |
( |
|
TYPE, |
|
|
|
FIELD |
|
) |
| ((size_t)((uint8_t *)&((TYPE*)0)->FIELD - (uint8_t *)0)) |
Offset in bytes of FIELD in TYPE.
Definition at line 40 of file mmal_util.h.
◆ mmal_4cc_to_string()
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)
◆ mmal_buffer_header_copy_header()
Copy buffer header metadata from source to destination.
- Parameters
-
dest | The destination buffer header. |
src | The source buffer header. |
◆ mmal_encoding_get_slice_variant()
uint32_t mmal_encoding_get_slice_variant |
( |
uint32_t |
encoding | ) |
|
Return the 16 line high sliced version of a given pixel encoding
- Parameters
-
- Returns
- The sliced equivalent, or MMAL_ENCODING_UNKNOWN if not supported.
◆ mmal_encoding_stride_to_width()
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.
◆ mmal_encoding_width_to_stride()
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.
◆ mmal_log_dump_format()
Log the content of a MMAL_ES_FORMAT_T structure.
- Parameters
-
format | Pointer to the format to dump. |
◆ mmal_log_dump_port()
Log the content of a MMAL_PORT_T structure.
- Parameters
-
port | Pointer to the port to dump. |
◆ mmal_port_parameter_alloc_get()
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.
◆ mmal_port_parameter_free()
◆ mmal_port_pool_create()
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.
◆ mmal_port_pool_destroy()
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. |
◆ mmal_port_type_to_string()
Convert a port type to a string.
- Parameters
-
- Returns
- A NULL-terminated string describing the port type.
◆ mmal_status_to_string()
Convert a status to a statically-allocated string.
- Parameters
-
status | The MMAL status code. |
- Returns
- A C string describing the status code.
◆ mmal_util_get_port()
Return the nth port.
- Parameters
-
comp | component to query |
index | port index |
type | port type |
- Returns
- port or NULL if not found
◆ mmal_util_rgb_order_fixed()
On FW prior to June 2016, camera and video_splitter had BGR24 and RGB24 support reversed. This is now fixed, and this function will return whether the FW has the fix or not.
- Parameters
-
port | MMAL port to check (on camera or video_splitter) |
- Returns
- 0 if old firmware, 1 if new.