Header for Streamer Element.
More...
#include "streamer_api.h"
#include "pad.h"
|
#define | ELEMENT_PARENT_PIPELINE(pstelem) ((Pipeline *)((pstelem)->parent)) |
| Get element parent pipeline.
|
|
#define | ELEMENT_PARENT(pstelem) ((pstelem)->parent) |
| Get element parent (void)
|
|
#define | ELEMENT_KEY(pstelem) ((pstelem)->key) |
| Get element key.
|
|
#define | ELEMENT_DEPTH(pstelem) ((pstelem)->depth) |
| Get element depth.
|
|
#define | ELEMENT_TYPE(pstelem) ((pstelem)->type) |
| Get element type.
|
|
#define | ELEMENT_STATE(pstelem) ((pstelem)->state) |
| Get element state.
|
|
#define | ELEMENT_SIBLING(pstelem) ((pstelem)->sibling) |
| Get element sibling.
|
|
#define | ELEMENT_SRC_PAD(pstelem, i) ((StreamPad *)&(pstelem)->src_pad[i]) |
| Get element source pad.
|
|
#define | ELEMENT_SINK_PAD(pstelem, i) ((StreamPad *)&(pstelem)->sink_pad[i]) |
| Get element sink pad.
|
|
#define | MAX_NUM_PADS (3) |
| Maximum number of pads.
|
|
#define | MAX_LOCATION_PATH_LENGTH (255) |
| Maximum location path length.
|
|
#define | MAX_DEVICE_NAME_LENGTH (32) |
| Maximum device name length.
|
|
#define | AUDIO_SET_FORMAT(a, b, c, d) (((d << 4) & 0xFF0) | ((c << 2) & 0x4) | ((b << 1) & 0x2) | ((a << 0) & 0x1)) |
|
|
uint8_t | activate_pads_element (StreamElement *element, uint8_t activate) |
| activate_pads_element
|
|
int32_t | create_element (ElementHandle *handle, StreamElementType type, int8_t key) |
| create_element
|
|
int32_t | destroy_element (ElementHandle handle) |
| destroy_element
|
|
int32_t | link_elements (ElementHandle src_handle, int8_t src_pad_index, ElementHandle sink_handle, int8_t sink_pad_index) |
| link_elements
|
|
int32_t | unlink_elements (ElementHandle src_handle, int8_t src_pad_index, ElementHandle sink_handle, int8_t sink_pad_index) |
| unlink_elements
|
|
int32_t | get_element_info (ElementHandle handle, StreamElementType *ptype, int8_t *pkey) |
| get_element_info:
|
|
int32_t | send_msg_element (StreamElement *element, uint32_t msg, uintptr_t data) |
| send_msg_element
|
|
int32_t | element_get_property (ElementHandle element_hdl, uint16_t prop, uint64_t *val_ptr) |
| This function gets property value of element.
|
|
int32_t | element_set_property (ElementHandle element_hdl, uint16_t prop, uintptr_t val) |
| this function sets property value of element
|
|
◆ AUDIO_SET_FORMAT
#define AUDIO_SET_FORMAT |
( |
| a, |
|
|
| b, |
|
|
| c, |
|
|
| d ) (((d << 4) & 0xFF0) | ((c << 2) & 0x4) | ((b << 1) & 0x2) | ((a << 0) & 0x1)) |
AUDIO_SET_FORMAT: Set output format a- interleaved b- endianness c- signed d- word length
◆ activate_pads_element()
uint8_t activate_pads_element |
( |
StreamElement * | element, |
|
|
uint8_t | activate ) |
This function iterates through all the pads of the elements, first src pads and then sink, and calls the activate pad function.
- Parameters
-
element | Pointer to element handle |
activate | Activate or Deactivate the pads? |
- Returns
- bool
◆ create_element()
Creates a new element of the required type. A byte key which should be unique within the same type of element.
- Parameters
-
handle | Pointer to element handle |
type | Element type |
key | Unique key within the same type of elements to retrieve the handle from the pipeline later. |
- Returns
- Error Status
- Return values
-
STREAM_OK | Element created successfully |
STREAM_ERR_NO_MEM | Error allocating memory |
STREAM_ERR_ELEMENT_NOT_FOUND | Element type not found |
◆ destroy_element()
Function to destroy element. Make sure that this element is not linked to any other element and not a part of pipeline.
- Parameters
-
- Returns
- Error Status
- Return values
-
STREAM_OK | Element successfully destroyed |
STREAM_ERR_ELEMENT_NOT_FREE | Element still associated with a pipeline |
STREAM_ERR_INVALID_ARGS | Invalid element object |
◆ link_elements()
Link elements from the source pad to sink pad.
- Parameters
-
src_handle | Element with the source pad. |
src_pad_index | Index of the source pad of element. |
sink_handle | Element with the sink pad. |
sink_pad_index | Index of the sink pad of element. |
- Returns
- Error Status
- Return values
-
STREAM_OK | Elements linked successfully |
STREAM_ERR_INVALID_ARGS | Invalid argument |
STREAM_ERR_ELEMENT_LINKED | Element already linked |
◆ unlink_elements()
Unlink elements from the source pad to sink pad.
- Parameters
-
src_handle | Element with the source pad. |
src_pad_index | Index of the source pad of element. |
sink_handle | Element with the sink pad. |
sink_pad_index | Index of the sink pad of element. |
- Returns
- Error Status
- Return values
-
STREAM_OK | Elements unlinked successfully |
STREAM_ERR_ELEMENT_PADS_NOT_LINKED | Elements not linked |
STREAM_ERR_INVALID_ARGS | Invalid arguments |
◆ get_element_info()
Function to return the element info.
- Parameters
-
handle | Element handle |
ptype | ElementType pointer to return the element type |
pkey | int8_t pointer to return the uinque element key |
- Returns
- Error Status
- Return values
-
STREAM_OK | Element info successfully retrieved |
STREAM_ERR_INVALID_ARGS | Invalid argument provided |
◆ send_msg_element()
int32_t send_msg_element |
( |
StreamElement * | element, |
|
|
uint32_t | msg, |
|
|
uintptr_t | data ) |
The function creates and sends a message to the parent pipeline
- Parameters
-
element | Element from which the message is sent from |
msg | StreamMessage type |
data | Data associated with the message |
- Returns
- Error Status
- Return values
-
STREAM_OK | Message sent successfully |
STREAM_ERR_INVALID_ARGS | Invalid element/pipeline object |
◆ element_get_property()
int32_t element_get_property |
( |
ElementHandle | element_hdl, |
|
|
uint16_t | prop, |
|
|
uint64_t * | val_ptr ) |
- Parameters
-
element_hdl | element handle |
prop | property id |
val_ptr | pointer to the address of value |
- Returns
- int32_t error codes
◆ element_set_property()
int32_t element_set_property |
( |
ElementHandle | element_hdl, |
|
|
uint16_t | prop, |
|
|
uintptr_t | val ) |
- Parameters
-
element_hdl | element handle |
prop | property id |
val | value to be set |
- Returns
- int32_t error codes