Maestro Audio Framework v 1.7
NXP Semiconductors
|
Contains common types and functions used throughout the streamer. More...
Data Structures | |
struct | PacketHeader |
PacketHeader. More... | |
struct | AudioPacketHeader |
struct | RawPacketHeader |
Raw packet header. More... | |
struct | StreamBuffer |
Stream buffer information. More... | |
struct | STREAMER_MSG_HANDLER_T |
struct | StreamMessage |
struct | StreamQuery |
Macros | |
#define | DBG_ON (0x80) |
Flag enable debug messages. | |
#define | DBG_OFF (0x00) |
Flag disable debug messages. | |
#define | DBG_CORE DBG_ON |
Flag enable core debug messages. | |
#define | DBG_AUDIO_SINK DBG_ON |
Flag enable audio sink debug messages. | |
#define | DBG_AUDIO_SRC DBG_ON |
Flag enable audio source debug messages. | |
#define | DBG_QUEUE DBG_OFF |
Flag enable queue debug messages. | |
#define | DBG_FILESRC DBG_ON |
Flag enable file source debug messages. | |
#define | DBG_FILE_SINK DBG_ON |
Flag enable file sink debug messages. | |
#define | DBG_DECODER DBG_ON |
Flag enable decoder debug messages. | |
#define | DBG_ENCODER DBG_ON |
Flag enable encoder debug messages. | |
#define | DBG_MP3D DBG_ON |
Flag enable mp3 decoder debug messages. | |
#define | DBG_MEMSRC DBG_ON |
Flag enable memory source debug messages. | |
#define | DBG_NETBUFSRC DBG_ON |
Flag enable netbuf source debug messages. | |
#define | DBG_MEM_SINK DBG_ON |
Flag enable memory sink debug messages. | |
#define | DBG_VIT_SINK DBG_ON |
Flag enable vit sink debug messages. | |
#define | DBG_AUDIO_PROC DBG_ON |
Flag enable audio_proc debug messages. | |
#define | DBG_CCID DBG_ON |
Flag enable cci decoder debug messages. | |
#define | DBG_THREAD DBG_ON |
Flag enable thread debug messages. | |
#define | NUM_SINKS(type) ((type >> 14) & 0x3) |
Number of sink pads. | |
#define | NUM_SRCS(type) ((type >> 12) & 0x3) |
Number of source pads. | |
#define | IS_SRC_ELEMENT(type) (NUM_SRCS(type) > 0 && NUM_SINKS(type) == 0) |
Is source element. | |
#define | IS_SINK_ELEMENT(type) (NUM_SINKS(type) > 0 && NUM_SRCS(type) == 0) |
Is sink element. | |
#define | STREAMER_LOG_CATA(on, error, ...) |
#define | STREAMER_LOG_ERR(on, error, ...) |
Log error. | |
#define | STREAMER_LOG_WARN(on, error, ...) |
Log warning. | |
#define | STREAMER_LOG_DEBUG(on, ...) |
Log debug message. | |
#define | STREAMER_LOG_INFO(...) ilprintf(LOGMDL_STREAMER, __VA_ARGS__) |
Log information. | |
#define | STREAMER_FUNC_ENTER(on) |
Debug log function enter. | |
#define | STREAMER_FUNC_EXIT(on) |
Debug log function exit. | |
#define | MEM4_ALIGN(n) ((uintptr_t)(n) + (-(uintptr_t)(n)&3)) |
Macro for aligning memory. | |
#define | MEM_ALIGN(var, alignbytes) ((unsigned int)((var) + ((alignbytes)-1U)) & (unsigned int)(~(unsigned int)((alignbytes)-1U))) |
Macro to change a value to a given size aligned value. | |
#define | CHK_ARGS(check, error) |
Check arguments. | |
#define | AF_LITTLE_ENDIAN false |
Little endiannes. | |
#define | AF_BIG_ENDIAN true |
Big endiannes. | |
#define | FILE_RAW_WRITE 1 |
File raw write. | |
#define | STREAMER_DEFAULT_OUT_DEVICE AUDIO_SINK_DEVICE_TYPE_PCMRTOS |
#define | STREAMER_DEFAULT_CHUNK_SIZE (2048) |
#define | STREAMER_WAVE_FILE_CHUNK_SIZE (4096) |
#define | STREAMER_DEFAULT_UPDATE_DURATION (1000) |
#define | STREAMER_VERSION "1.7" |
Enumerations | |
enum | StreamDataType { DATA_TYPE_UINT32 = 1 , DATA_TYPE_UINT16 , DATA_TYPE_UINT8 , DATA_TYPE_INT32 , DATA_TYPE_INT16 , DATA_TYPE_INT8 , DATA_TYPE_bool , DATA_TYPE_STRING , DATA_TYPE_IMAGE , DATA_TYPE_LAST } |
enum | StreamDataFormat { DATA_FORMAT_UNDEFINED , DATA_FORMAT_BYTES , DATA_FORMAT_TIME , DATA_FORMAT_PERCENT , DATA_FORMAT_UNKNOWN } |
Functions | |
void | streamer_task (void *arg) |
Streamer Task. | |
void | streamer_init (STREAMER_T *streamer) |
Streamer Initialize. | |
int | streamer_msg_handler (STREAMER_T *streamer, STREAMER_MSG_T *msg) |
Streamer Message Handler. | |
int | streamer_process_pipelines (STREAMER_T *streamer) |
Streamer Process Pipelines. | |
int | streamer_msg_get_track_info (STREAMER_T *streamer, void *msg_data) |
Streamer Get Track Inforamtion from a pipeline. | |
int | streamer_msg_set_state (STREAMER_T *streamer, void *data) |
Streamer Set Pipeline State. | |
int | streamer_msg_get_state (STREAMER_T *streamer, void *data) |
Streamer Get State. | |
int | streamer_msg_send_query (STREAMER_T *streamer, void *data) |
Streamer Send Query. | |
int | streamer_msg_seek_pipeline (STREAMER_T *streamer, void *data) |
Streamer Seek Pipeline. | |
int | streamer_msg_set_property (STREAMER_T *streamer, void *data) |
Streamer Set Property. | |
int | streamer_msg_get_property (STREAMER_T *streamer, void *data) |
Streamer Get Property. | |
int | streamer_msg_set_file (STREAMER_T *streamer, void *data) |
Streamer message set file. | |
int | streamer_msg_set_repeat (STREAMER_T *streamer, void *msg_data) |
Streamer Set Pipeline State. | |
#define STREAMER_LOG_CATA | ( | on, | |
error, | |||
... ) |
Debug printf macros.
on | is one of the DBG_ categories listed above. If it has been defined as DBG_ON, then the message will print. |
error | Error to be print |
#define STREAMER_LOG_ERR | ( | on, | |
error, | |||
... ) |
#define STREAMER_LOG_WARN | ( | on, | |
error, | |||
... ) |
#define STREAMER_LOG_DEBUG | ( | on, | |
... ) |
#define STREAMER_FUNC_ENTER | ( | on | ) |
#define STREAMER_FUNC_EXIT | ( | on | ) |
#define CHK_ARGS | ( | check, | |
error ) |
#define STREAMER_DEFAULT_OUT_DEVICE AUDIO_SINK_DEVICE_TYPE_PCMRTOS |
Default output device
#define STREAMER_DEFAULT_CHUNK_SIZE (2048) |
Default source read chunk size for push mode
#define STREAMER_WAVE_FILE_CHUNK_SIZE (4096) |
Lossless formats need a bit large chunk size to play smoothly
#define STREAMER_DEFAULT_UPDATE_DURATION (1000) |
Automatically report duration
enum StreamDataType |
StreamDataType Specifies the datatype of query information
enum StreamDataFormat |
Standard predefined event data formats
void streamer_task | ( | void * | arg | ) |
This is the streamer task function that processes the main streamer loop. The loop will look to receive messages from the application and to initiate the processing of data through active pipelines.
[in] | arg | Pointer to input argument structure (STREAMER_ARGS_T) |
void streamer_init | ( | STREAMER_T * | streamer | ) |
Initialize data structure associated with Streamer Task
[in] | streamer | Pointer to streamer task data structure |
int streamer_msg_handler | ( | STREAMER_T * | streamer, |
STREAMER_MSG_T * | msg ) |
Processes a single message that was received in the streamer task message queue. Messages should follow the format defined in STREAMER_MSG_T structure.
[in] | streamer | Pointer to streamer task data structure |
[in] | msg | Pointer to message data. |
ERRCODE_NO_ERROR | Message was successfully processed |
ERRCODE_INVALID_ARGUMENT | Invalid Message |
int streamer_process_pipelines | ( | STREAMER_T * | streamer | ) |
Loops through the pipelines present in the streamer task and if the pipeline is in Playing state calls the process pipeline function to start the flow of data.
[in] | streamer | Pointer to streamer task data structure |
ERRCODE_NO_ERROR | Message was successfully processed |
ERRCODE_INVALID_ARGUMENT | Invalid Message |
int streamer_msg_get_track_info | ( | STREAMER_T * | streamer, |
void * | msg_data ) |
Handles request to get track information from a pipeline object.
[in] | streamer | Pointer to streamer structure |
[in] | msg_data | Pointer to Message Data |
STREAM_OK | State retrieved successfully. |
STREAM_ERR_INVALID_ARGS | Invalid pipeline object |
int streamer_msg_set_state | ( | STREAMER_T * | task_data, |
void * | msg_data ) |
Handles request to set the state of a pipeline object.
[in] | task_data | Pointer to task data structure |
[in] | msg_data | Pointer to Message Data |
STREAM_OK | State retrieved successfully. |
STREAM_ERR_INVALID_ARGS | Invalid pipeline object |
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.
[in] | task_data | Pointer to task data structure |
[in] | msg_data | Pointer to Message Data |
STREAM_OK | Success |
STREAM_ERR_INVALID_ARGS | Invalid argument |
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.
[in] | task_data | Pointer to task data structure |
[in] | msg_data | Pointer to Message Data |
STREAM_OK | Query successful |
STREAM_ERR_INFO_ABSENT | Query unsuccessful. Info not present |
STREAM_ERR_INVALID_ARGS | Invalid pipeline object |
int streamer_msg_seek_pipeline | ( | STREAMER_T * | task_data, |
void * | msg_data ) |
Handles request to seek to a specified time in an audio stream
[in] | task_data | Pointer to task data structure |
[in] | msg_data | Pointer to Message Data |
STREAM_OK | Seek successful |
STREAM_ERR_INVALID_ARGS | Invalid Pipeline object |
STREAM_ERR_NOT_SEEKABLE | Pipeline does not support seeking |
int streamer_msg_set_property | ( | STREAMER_T * | task_data, |
void * | msg_data ) |
Set an element specific property value
[in] | task_data | Pointer to task data structure |
[in] | msg_data | Pointer to Message Data |
STREAM_OK | Property successfully set. |
STREAM_ERR_INVALID_ARGS | Invalid arguments |
int streamer_msg_get_property | ( | STREAMER_T * | task_data, |
void * | msg_data ) |
Get an element specific property value
[in] | task_data | Pointer to task data structure |
[in] | msg_data | Pointer to Message Data |
STREAM_OK | Property successfully retrieved. |
STREAM_ERR_INVALID_ARGS | Invalid arguments |
int streamer_msg_set_file | ( | STREAMER_T * | task_data, |
void * | msg_data ) |
[in] | task_data | Pointer to task data structure |
[in] | msg_data | Pointer to Message Data |
STREAM_OK | Property successfully retrieved. |
STREAM_ERR_INVALID_ARGS | Invalid arguments |
int streamer_msg_set_repeat | ( | STREAMER_T * | task_data, |
void * | msg_data ) |
Handles request to set the state of a pipeline object.
[in] | task_data | Pointer to task data structure |
[in] | msg_data | Pointer to Message Data |
STREAM_OK | State retrieved successfully. |
STREAM_ERR_INVALID_ARGS | Invalid pipeline object |