Header for Streamer Element.
More...
#include "streamer_api.h"
#include "pad.h"
|
| uint8_t | activate_pads_element (StreamElement *element, uint8_t activate) |
| | activate_pads_element More...
|
| |
| int32_t | create_element (ElementHandle *handle, StreamElementType type, int8_t key) |
| | create_element More...
|
| |
| int32_t | destroy_element (ElementHandle handle) |
| | destroy_element More...
|
| |
| int32_t | link_elements (ElementHandle src_handle, int8_t src_pad_index, ElementHandle sink_handle, int8_t sink_pad_index) |
| | link_elements More...
|
| |
| int32_t | unlink_elements (ElementHandle src_handle, int8_t src_pad_index, ElementHandle sink_handle, int8_t sink_pad_index) |
| | unlink_elements More...
|
| |
| int32_t | get_element_info (ElementHandle handle, StreamElementType *ptype, int8_t *pkey) |
| | get_element_info: More...
|
| |
| int32_t | send_msg_element (StreamElement *element, uint32_t msg, uintptr_t data) |
| | send_msg_element More...
|
| |
| int32_t | element_get_property (ElementHandle element_hdl, uint16_t prop, uint64_t *val_ptr) |
| | This function gets property value of element. More...
|
| |
| int32_t | element_set_property (ElementHandle element_hdl, uint16_t prop, uintptr_t val) |
| | this function sets property value of element More...
|
| |
◆ 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