Maestro Audio Framework v 1.7
NXP Semiconductors
Loading...
Searching...
No Matches
ccidec.c File Reference

This file contains the CCI decoder element pad implementation. More...

#include <string.h>
#include "audio_cfg.h"
#include "ccidec.h"
#include "decoder.h"
#include "streamer.h"
#include "codec_interface_public_api.h"
#include "general_utils.h"
#include "audio_sink.h"
#include "cci_metadata.h"
#include "pipeline.h"

Functions

uint8_t cci_decoder_type_conversion (DecoderType audio_type)
 Convert Decoder type to CCI stream type.
 
int32_t _get_file_data (int32_t stream_num, uint8_t *decoder_buffer, int32_t size_to_read, int32_t update_tail, void *context)
 Get data from a file source.
 
static int32_t _seek_file_data (int32_t stream_num, int32_t offset, int32_t position, void *context)
 Callback used by CCI to seek within the file.
 
int32_t _get_file_position (int32_t stream_num, void *user_data)
 Callback to provide current position of the file to the CCI.
 
int32_t ccidec_decode_frame (ElementDecoder *element)
 Decode a frame using the CCI decoder function.
 
uint8_t get_cci_metadata (ElementDecoder *element)
 Get the cci metadata from the file header.
 
uint8_t ccidec_sink_pad_activation_handler (StreamPad *pad, uint8_t active)
 ccidec_sink_pad_activation_handler
 
uint8_t ccidec_sink_pad_event_handler (StreamPad *pad, StreamEvent *event)
 ccidec_sink_pad_event_handler
 
uint8_t ccidec_src_pad_event_handler (StreamPad *pad, StreamEvent *event)
 ccidec_src_pad_event_handler
 
uint8_t ccidec_src_pad_query_handler (StreamPad *pad, StreamQuery *query)
 ccidec_src_pad_query_handler
 
int32_t ccidec_sink_pad_process_handler (StreamPad *pad)
 Process handler for the CCI decoder.
 

Function Documentation

◆ cci_decoder_type_conversion()

uint8_t cci_decoder_type_conversion ( DecoderType decoder_type)
extern
Parameters
[in]decoder_typeDecoder type.
Return values
CCIStream Type

◆ _get_file_data()

int32_t _get_file_data ( int32_t stream_num,
uint8_t * decoder_buffer,
int32_t size_to_read,
int32_t update_tail,
void * context )
Parameters
stream_numStream number
decoder_bufferBuffer to be filled
size_to_readSize to be read
update_tailUpdate tail (currently unused)
contextPointer to the CCIDec context
Returns
int32_t

◆ _seek_file_data()

static int32_t _seek_file_data ( int32_t stream_num,
int32_t offset,
int32_t position,
void * context )
static
Parameters
stream_numStream number
offsetOffset
positionSeek type
contextCCIDecInfo context
Returns
int32_t

◆ _get_file_position()

int32_t _get_file_position ( int32_t stream_num,
void * user_data )
Parameters
stream_numStream number
user_dataPointer to CCIDecInfo structure
Returns
int32_t

◆ ccidec_decode_frame()

int32_t ccidec_decode_frame ( ElementDecoder * element)
Parameters
elementDecoder element
Returns
int32_t

◆ get_cci_metadata()

uint8_t get_cci_metadata ( ElementDecoder * element)
Parameters
elementDecoder element
Returns
uint8_t

◆ ccidec_sink_pad_activation_handler()

uint8_t ccidec_sink_pad_activation_handler ( StreamPad * pad,
uint8_t active )

This function activates the sink pad and allocates memory for the cci decoder structure and initializes this structure. Activates or deactivates the sink pad for incoming data.

Parameters
padpad handle
activeboolean o activate/disactivate pad
Returns
pad error return

◆ ccidec_sink_pad_event_handler()

uint8_t ccidec_sink_pad_event_handler ( StreamPad * pad,
StreamEvent * event )

This function handles the pipeline events for the cci decoder. These events are downstream events and all events will be pushed to the peer pad.

Parameters
padpad handle
eventevent enumeration
Returns
pad error return

◆ ccidec_src_pad_event_handler()

uint8_t ccidec_src_pad_event_handler ( StreamPad * pad,
StreamEvent * event )

This function handles the src events for the cci decoder. These events are upstream events and all events will be pushed to the peer pad.

Parameters
padpad handle
eventevent enumeration
Returns
pad error return

◆ ccidec_src_pad_query_handler()

uint8_t ccidec_src_pad_query_handler ( StreamPad * pad,
StreamQuery * query )

This function handles the src queries for the cci decoder.

Parameters
padpad handle
queryevent enumeration
Returns
pad error return

◆ ccidec_sink_pad_process_handler()

int32_t ccidec_sink_pad_process_handler ( StreamPad * pad)

Used in pull mode, the filesrc process handler should be NULL so this function will be called instead. This function will call the CCI functions to initialize and decode the file. The CCI callback will be used to pull data from the filesrc when needed.

Parameters
padpad handle
Returns
pad error return