Maestro Audio Framework v 1.5
NXP Semiconductors
streamer_msg.c File Reference

Implementation of streamer message handlers. More...

#include <string.h>
#include "pipeline.h"
#include "streamer_fs.h"
#include "streamer_mic2file.h"
#include "streamer_vit.h"
#include "streamer_testeapfile2file.h"
#include "streamer_audiosrc.h"
#include "streamer_element_properties.h"
#include "streamer_pcm_speaker.h"
#include "streamer_opusmem2mem.h"

Data Structures

struct  ElementPropertyLookup
 Element index and property. More...
 
#define ELEMENT_NOT_USED   (-1)
 Element not used index.
 
static ElementPropertyLookup property_lookup_table []
 
int streamer_msg_create_pipeline (STREAMER_T *task_data, void *msg_data)
 Streamer Create Pipeline. More...
 
int streamer_msg_destroy_pipeline (STREAMER_T *task_data, void *msg_data)
 Streamer Destroy Pipeline. More...
 
int streamer_msg_get_track_info (STREAMER_T *streamer, void *msg_data)
 Streamer Get Track Inforamtion from a pipeline. More...
 
int streamer_msg_set_state (STREAMER_T *task_data, void *msg_data)
 Streamer Set Pipeline State. More...
 
int streamer_msg_get_state (STREAMER_T *task_data, void *msg_data)
 Streamer Get State. More...
 
int streamer_msg_send_query (STREAMER_T *task_data, void *msg_data)
 Streamer Send Query. More...
 
int streamer_msg_seek_pipeline (STREAMER_T *task_data, void *msg_data)
 Streamer Seek Pipeline. More...
 
static int streamer_get_element_index (STREAMER_T *task_data, ELEMENT_PROPERTY_T property)
 Streamer get element index. More...
 
int streamer_msg_set_property (STREAMER_T *task_data, void *msg_data)
 Streamer Set Property. More...
 
int streamer_msg_get_property (STREAMER_T *task_data, void *msg_data)
 Streamer Get Property. More...
 
int streamer_msg_set_file (STREAMER_T *task_data, void *msg_data)
 Streamer message set file. More...
 
int streamer_msg_set_repeat (STREAMER_T *task_data, void *msg_data)
 Streamer Set Pipeline State. More...
 

Function Documentation

◆ streamer_msg_create_pipeline()

int streamer_msg_create_pipeline ( STREAMER_T task_data,
void *  msg_data 
)

Handles request to create a pipeline object.

Parameters
[in]task_dataPointer to task data structure
[in]msg_dataPointer to Message Data
Returns
Error Status
Return values
STREAM_OKSuccess
STREAM_ERR_INVALID_ARGSInvalid argument
STREAM_ERR_NO_MEMOut of memory

◆ streamer_msg_destroy_pipeline()

int streamer_msg_destroy_pipeline ( STREAMER_T task_data,
void *  msg_data 
)

Handles request to destroy a pipeline object.

Parameters
[in]task_dataPointer to task data structure
[in]msg_dataPointer to Message Data
Returns
Error Status
Return values
STREAM_OKSuccess
STREAM_ERR_INVALID_ARGSInvalid value

◆ streamer_msg_get_track_info()

int streamer_msg_get_track_info ( STREAMER_T streamer,
void *  msg_data 
)

Handles request to get track information from a pipeline object.

Parameters
[in]streamerPointer to streamer structure
[in]msg_dataPointer to Message Data
Returns
Error Status
Return values
STREAM_OKState retrieved successfully.
STREAM_ERR_INVALID_ARGSInvalid pipeline object

◆ streamer_msg_set_state()

int streamer_msg_set_state ( STREAMER_T task_data,
void *  msg_data 
)

Handles request to set the state of a pipeline object.

Parameters
[in]task_dataPointer to task data structure
[in]msg_dataPointer to Message Data
Returns
Error Status
Return values
STREAM_OKState retrieved successfully.
STREAM_ERR_INVALID_ARGSInvalid pipeline object

◆ streamer_msg_get_state()

int streamer_msg_get_state ( STREAMER_T task_data,
void *  msg_data 
)

Handles request to get the state of a pipeline object. State will be sent back to the application through the callback function.

Parameters
[in]task_dataPointer to task data structure
[in]msg_dataPointer to Message Data
Returns
Error Status
Return values
STREAM_OKSuccess
STREAM_ERR_INVALID_ARGSInvalid argument

◆ streamer_msg_send_query()

int streamer_msg_send_query ( STREAMER_T task_data,
void *  msg_data 
)

Handles request to send a query to a pipeline object. Query data is returned through the callback function.

Parameters
[in]task_dataPointer to task data structure
[in]msg_dataPointer to Message Data
Returns
Error Status
Return values
STREAM_OKQuery successful
STREAM_ERR_INFO_ABSENTQuery unsuccessful. Info not present
STREAM_ERR_INVALID_ARGSInvalid pipeline object

◆ streamer_msg_seek_pipeline()

int streamer_msg_seek_pipeline ( STREAMER_T task_data,
void *  msg_data 
)

Handles request to seek to a specified time in an audio stream

Parameters
[in]task_dataPointer to task data structure
[in]msg_dataPointer to Message Data
Returns
Error Status
Return values
STREAM_OKSeek successful
STREAM_ERR_INVALID_ARGSInvalid Pipeline object
STREAM_ERR_NOT_SEEKABLEPipeline does not support seeking

◆ streamer_get_element_index()

static int streamer_get_element_index ( STREAMER_T task_data,
ELEMENT_PROPERTY_T  property 
)
static
Parameters
task_datastreamer object
propertyelement property
Returns
int

◆ streamer_msg_set_property()

int streamer_msg_set_property ( STREAMER_T task_data,
void *  msg_data 
)

Set an element specific property value

Parameters
[in]task_dataPointer to task data structure
[in]msg_dataPointer to Message Data
Returns
Error Status
Return values
STREAM_OKProperty successfully set.
STREAM_ERR_INVALID_ARGSInvalid arguments

◆ streamer_msg_get_property()

int streamer_msg_get_property ( STREAMER_T task_data,
void *  msg_data 
)

Get an element specific property value

Parameters
[in]task_dataPointer to task data structure
[in]msg_dataPointer to Message Data
Returns
Error Status
Return values
STREAM_OKProperty successfully retrieved.
STREAM_ERR_INVALID_ARGSInvalid arguments

◆ streamer_msg_set_file()

int streamer_msg_set_file ( STREAMER_T task_data,
void *  msg_data 
)
Parameters
[in]task_dataPointer to task data structure
[in]msg_dataPointer to Message Data
Returns
Error Status
Return values
STREAM_OKProperty successfully retrieved.
STREAM_ERR_INVALID_ARGSInvalid arguments

◆ streamer_msg_set_repeat()

int streamer_msg_set_repeat ( STREAMER_T task_data,
void *  msg_data 
)

Handles request to set the state of a pipeline object.

Parameters
[in]task_dataPointer to task data structure
[in]msg_dataPointer to Message Data
Returns
Error Status
Return values
STREAM_OKState retrieved successfully.
STREAM_ERR_INVALID_ARGSInvalid pipeline object

Variable Documentation

◆ property_lookup_table

ElementPropertyLookup property_lookup_table[]
static
Initial value:
= {{PROP_AUDIOSRC_MASK, ELEMENT_AUDIO_SRC_INDEX},
{PROP_NETBUFSRC_MASK, ELEMENT_NETBUF_SRC_INDEX},
{PROP_DECODER_MASK, ELEMENT_DECODER_INDEX},
{PROP_AUDIOSINK_MASK, ELEMENT_AUDIO_SINK_INDEX},
{PROP_ENCODER_MASK, ELEMENT_ENCODER_INDEX}}

This table is used to indentify which element in the pipeline a property is associated with. Properties can be used to configure the individual pipeline elements.