This file contains the definition of the pipeline object.
More...
|
enum | PipelineStateChange {
STATE_CHANGE_NULL_TO_READY = STATE_TRANSITION(STATE_NULL, STATE_READY)
,
STATE_CHANGE_READY_TO_PAUSED = STATE_TRANSITION(STATE_READY, STATE_PAUSED)
,
STATE_CHANGE_PAUSED_TO_PLAYING = STATE_TRANSITION(STATE_PAUSED, STATE_PLAYING)
,
STATE_CHANGE_PLAYING_TO_PAUSED = STATE_TRANSITION(STATE_PLAYING, STATE_PAUSED)
,
STATE_CHANGE_PAUSED_TO_READY = STATE_TRANSITION(STATE_PAUSED, STATE_READY)
,
STATE_CHANGE_READY_TO_NULL = STATE_TRANSITION(STATE_READY, STATE_NULL)
} |
|
|
int32_t | process_pipeline (PipelineHandle handle) |
| Process Pipeline.
|
|
int32_t | create_pipeline (PipelineHandle *handle, unsigned int index, osa_msgq_handle_t *app_mq) |
| create_pipeline
|
|
int32_t | destroy_pipeline (PipelineHandle handle) |
| destroy_pipeline
|
|
PipelineState | get_state_pipeline (PipelineHandle handle) |
| get_state_pipeline
|
|
int32_t | set_state_pipeline (PipelineHandle handle, PipelineState state) |
| set_state_pipeline
|
|
int32_t | seek_pipeline (PipelineHandle handle, uint32_t time_msec) |
| seek_pipeline
|
|
int32_t | seek_relative (PipelineHandle handle, int32_t time_msec) |
| seek_relative
|
|
int32_t | query_info_pipeline (PipelineHandle handle, StreamInfoType info_type, StreamData *data) |
| query_info_pipeline:
|
|
int32_t | add_element_pipeline (PipelineHandle pipeline_handle, ElementHandle element_handle, int8_t level) |
| add_element_pipeline
|
|
int32_t | remove_element_pipeline (PipelineHandle pipeline_handle, ElementHandle element_handle) |
| remove_element_pipeline
|
|
int32_t | get_element_pipeline (PipelineHandle pipeline_handle, StreamElementType type, int8_t key, ElementHandle *handle) |
| get_element_pipeline
|
|
int32_t | send_msg_pipeline (Pipeline *pipeline, StreamMessage *msg) |
| send_msg_pipeline
|
|
int32_t | set_repeat_pipeline (PipelineHandle handle, bool repeat) |
| Set pipeline repeat mode.
|
|
bool | get_repeat_pipeline (PipelineHandle handle) |
| Get pipeline repeat mode.
|
|
void | clear_pipeline_trackinfo (PipelineHandle handle) |
| Clears the pipeline track info cache.
|
|
◆ MAX_ELEMENT_LEVEL
#define MAX_ELEMENT_LEVEL (10) |
MAX_ELEMENT_LEVEL Specifies the maximum # of elements that can be present in a single pipeline path.
◆ STATE_TRANSITION
#define STATE_TRANSITION |
( |
| cur, |
|
|
| next ) (((cur) << 3) | (next)) |
STATE_TRANSITION
- Parameters
-
cur | A current state |
next | A next state |
Given a current state cur and a next state next, calculate the associated PipelineStateChange transition.
◆ STATE_TRANSITION_CURRENT
#define STATE_TRANSITION_CURRENT |
( |
| trans | ) |
((PipelineState)((trans) >> 3)) |
STATE_TRANSITION_CURRENT
- Parameters
-
trans | A PipelineStateChange |
Given a state transition trans, extract the current PipelineState.
◆ STATE_TRANSITION_NEXT
#define STATE_TRANSITION_NEXT |
( |
| trans | ) |
((PipelineState)((trans)&0x7)) |
STATE_TRANSITION_NEXT
- Parameters
-
trans | A PipelineStateChange |
Given a state transition trans, extract the next PipelineState.
◆ PipelineStateChange
PipelineStateChange The different state changes that are passed to the state change functions of elements.
Enumerator |
---|
STATE_CHANGE_NULL_TO_READY | NULL to READY.
|
STATE_CHANGE_READY_TO_PAUSED | READY to PAUSED.
|
STATE_CHANGE_PAUSED_TO_PLAYING | PAUSED to PLAYING.
|
STATE_CHANGE_PLAYING_TO_PAUSED | PLAYING to PAUSED.
|
STATE_CHANGE_PAUSED_TO_READY | PAUSED to READY.
|
STATE_CHANGE_READY_TO_NULL | READY to NULL.
|
◆ process_pipeline()
Iterate through the elements of a pipeline calling process handlers for non-blocked elements
- Parameters
-
[in] | handle | Pointer to pipeline |
- Returns
- Error Status
- Return values
-
STREAM_OK | Success |
STREAM_ERR_INVALID_ARGS | Invalid Pipeline specified |
◆ create_pipeline()
int32_t create_pipeline |
( |
PipelineHandle * | handle, |
|
|
unsigned int | index, |
|
|
osa_msgq_handle_t * | app_mq ) |
Create a pipeline object within the streamer task
- Parameters
-
[in] | handle | Pointer to pipeline |
[in] | index | Index of pipeline within streamer task |
[in] | app_mq | Application message queue |
- Returns
- Error Status
- Return values
-
STREAM_OK | Success |
STREAM_ERR_INVALID_ARGS | Invalid pipeline handle |
STREAM_ERR_NO_MEM | Unable to allocate memory |
◆ destroy_pipeline()
Sets the pipeline state to NULL and destroys the pipeline with all the elements added.
- Parameters
-
[in] | handle | Pointer to pipeline |
- Returns
- Error Status
- Return values
-
STREAM_OK | Success |
STREAM_ERR_INVALID_ARGS | Invalid Pipeline object |
◆ get_state_pipeline()
Get the current state of the pipeline
- Parameters
-
[in] | handle | Pointer to pipeline |
- Returns
- Current Pipeline State
- Return values
-
STATE_NULL | Pipeline is in NULL state |
STATE_READY | Pipeline is in Ready state |
STATE_PAUSED | Pipeline is in Paused state |
STATE_PLAYING | Pipeline is in Playing state |
◆ set_state_pipeline()
Sets a new state of the pipeline if not already in the same state. This takes care of any intermediate states like changing state from NULL to PLAYING.
The order of the states is NULL, READY, PAUSED and then PLAYING. Element can switch from any state to another, but in steps of one.
Once a state change is requested, the pipeline elements are iterated from the sink elements to the source elements. This makes sure that when changing the state of an element, the downstream elements are in the correct state to process the eventual buffers. In the case of a downwards state change, e.g. PLAYING ->NULL, the sink elements will shut down first which makes the upstream elements shutdown as well since the _push() function returns a FLOW_WRONG_STATE error.
- Parameters
-
handle | Pointer to pipeline |
state | New pipeline state |
- Returns
- Error Status
- Return values
-
STREAM_OK | State retrieved successfully. |
STREAM_ERR_INVALID_ARGS | Invalid pipeline object |
◆ seek_pipeline()
Seeks the playback position to a specified absolute time in msec. This is valid only in playing and paused state. Pipeline returns to the last when seek is done.
- Parameters
-
handle | Pipeline handle |
time_msec | Seek time specified in msec. |
- Returns
- Error Status
- Return values
-
STREAM_OK | Seek successful |
STREAM_ERR_INVALID_ARGS | Invalid Pipeline object |
STREAM_ERR_NOT_SEEKABLE | Pipeline does not support seeking |
◆ seek_relative()
Seeks the playback position to a time specified relative to the current playback position. This is valid only in playing and paused state. Pipeline returns to the last when seek is done.
- Parameters
-
handle | Pipeline handle |
time_msec | Seek time specified in msec. |
- Returns
- Error Status
- Return values
-
STREAM_OK | Seek successful |
STREAM_ERR_INVALID_ARGS | Invalid Pipeline object |
STREAM_ERR_INFO_ABSENT | Unable to determine current position |
STREAM_ERR_NOT_SEEKABLE | Pipeline does not support seeking |
◆ query_info_pipeline()
Function to return info of the current playing/paused stream.
- Parameters
-
handle | Pipeline handle |
info_type | Info type queried |
data | Holds return query value |
- Returns
- Error Status
- Return values
-
STREAM_OK | Query successful |
STREAM_ERR_INFO_ABSENT | Query unsuccessful. Info not present |
STREAM_ERR_INVALID_ARGS | Invalid pipeline object |
◆ add_element_pipeline()
Function to add element in a already created pipeline. If not already added in the pipeline then it is added in the pipeline so that it can be linked with other elements in the pipeline.
- Parameters
-
pipeline_handle | Pipeline handle |
element_handle | Element handle |
level | Level of the element |
- Returns
- Error Status
- Return values
-
STREAM_OK | Element successfully added to pipeline |
STREAM_ERR_INVALID_ARGS | Invalid pipeline or element object |
◆ remove_element_pipeline()
Function to remove element in a already created pipeline. This element should not be linked with any other pipeline before calling this function.
- Parameters
-
pipeline_handle | Pipeline handle |
element_handle | Element handle |
- Returns
- Error Status
- Return values
-
STREAM_OK | Element removed from pipeline |
STREAM_ERR_INVALID_ARGS | Invalid pipeline or element object |
◆ get_element_pipeline()
Function to return tag of the current playing/paused stream.
- Parameters
-
pipeline_handle | Pipeline handle |
type | Element type |
key | Unique key used in creating the element |
handle | Pointer to the element handle |
- Returns
- Error Status
- Return values
-
STREAM_OK | Element handle successfully retrieved |
STREAM_ERR_INVALID_ARGS | Invalid pipeline object or element not found |
◆ send_msg_pipeline()
int32_t send_msg_pipeline |
( |
Pipeline * | pipeline, |
|
|
StreamMessage * | msg ) |
The function sends the message to the callback function associated with the pipeline.
- Parameters
-
- Returns
- Error Status
- Return values
-
STREAM_OK | Message successfully sent |
STREAM_ERR_INVALID_ARGS | Invalid pipeline or message object |
◆ set_repeat_pipeline()
Set the repeat mode of a pipeline, if repeat mode is true, pipeline will play current stream repeatly when received a MSG_EOS event.
- Parameters
-
handle | Pointer to a pipeline object |
repeat | repeat true or false |
- Returns
- none
◆ get_repeat_pipeline()
- Parameters
-
handle | Pointer to a pipeline object |
- Returns
- repeat repeat true or false
◆ clear_pipeline_trackinfo()
Clears all track info from the pipeline cache
- Parameters
-
handle | Pointer to a pipeline object |
- Returns
- none