Maestro Audio Framework v 1.7
NXP Semiconductors
|
This file contains the decoder element functionality. More...
#include "streamer.h"
#include "decoder.h"
#include "decoder_pads.h"
#include "pipeline.h"
#include "streamer_element_properties.h"
#include "audio_cfg.h"
Functions | |
uint8_t | ccidec_src_pad_event_handler (StreamPad *, StreamEvent *) |
ccidec_src_pad_event_handler | |
uint8_t | ccidec_src_pad_query_handler (StreamPad *, StreamQuery *) |
ccidec_src_pad_query_handler | |
uint8_t | ccidec_sink_pad_activation_handler (StreamPad *, uint8_t) |
ccidec_sink_pad_activation_handler | |
uint8_t | ccidec_sink_pad_event_handler (StreamPad *, StreamEvent *) |
ccidec_sink_pad_event_handler | |
int32_t | ccidec_sink_pad_process_handler (StreamPad *) |
Process handler for the CCI decoder. | |
int32_t | decoder_change_state (StreamElement *element, PipelineState new_dec_state) |
This function changes the decoder state by calling STATE_TRANSITION pipeline macro. If the new state is NULL_TO_READY, it verifies the decoder type is known and handler is setup. | |
uint32_t | decoder_get_duration (ElementDecoder *element, StreamDataFormat format) |
Returns the duration of a source PadQueryFunc is called to return the element duration in the format defined by the StreamDataFormat parameter. | |
bool | decoder_is_source_seekable (ElementDecoder *decoder, StreamDataFormat format) |
Is current source seekable. | |
void | decoder_set_duration (ElementDecoder *element, uint32_t stream_size, uint32_t bit_rate) |
Calculate and set the duration of a source This function calculates the duration in bytes using the stream size and stream bitrate, and sets it in bytes in the ElementDecoder variable. | |
int32_t | decoder_init_element (StreamElement *element) |
This function initializes the decoder element, and loads the pad source and sink functions. | |
int32_t | decoder_set_type (ElementHandle element, DecoderType dec_type) |
Set the decoder type for the input element. This function maps the generic decoder element pad handlers to the specific decoder implementation using DecoderHandlersType. | |
int32_t | decoder_activate_parse_tag (ElementHandle element, uint8_t activate) |
Enable/Disable the tag parsing Sets the parse_tag variable to the value passed in via activate variable. | |
void | vUpdateAverageBitrate (ElementDecoder *element) |
Update a running average of bit rate. | |
int32_t | decoder_set_property (StreamElement *element, uint16_t prop_id, uint32_t prop_value) |
Set a property of a decoder element. | |
int32_t | decoder_get_property (StreamElement *element, uint16_t prop_id, uint32_t *prop_value) |
Get a property of a decoder element. | |
Variables | |
static const DecoderHandlersType | handlers_cci |
Decoder handler function pointers. | |
This file implements the Opus encoder stream element.
|
extern |
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.
pad | pad handle |
event | event enumeration |
|
extern |
This function handles the src queries for the cci decoder.
pad | pad handle |
query | event enumeration |
|
extern |
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.
pad | pad handle |
active | boolean o activate/disactivate pad |
|
extern |
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.
pad | pad handle |
event | event enumeration |
|
extern |
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.
pad | pad handle |
int32_t decoder_change_state | ( | StreamElement * | element, |
PipelineState | new_dec_state ) |
element | StreamElement will be used to create ElementDecoder |
new_dec_state | new decoder state to change to |
STREAM_ERR_INVALID_ARGS | invalid parameters |
STREAM_ERR_GENERAL | if moved to ready state and decoders not setup |
STREAM_OK | successful |
uint32_t decoder_get_duration | ( | ElementDecoder * | element, |
StreamDataFormat | data ) |
element | ElementDecoder pointer will be used to create StreamPad sink |
data | StreamDataFormat defines the format of the data to return. |
bool decoder_is_source_seekable | ( | ElementDecoder * | decoder, |
StreamDataFormat | format ) |
This function sends a query to sink pad of the decoder element to check if check if seek is possible in the specified format.
decoder | ElementDecoder pointer will be use to create a sink StreamPad |
format | format type used to create the query. |
true | source is seekable |
false | souce is not seekable |
void decoder_set_duration | ( | ElementDecoder * | element, |
uint32_t | stream_size, | ||
uint32_t | bit_rate ) |
element | ElementDecoder pointer will hold the calculated duration value |
stream_size | Size of the stream |
bit_rate | Bit rate of the stream |
int32_t decoder_init_element | ( | StreamElement * | element | ) |
The following Pad Functions are used in this implementation: SRC FUNCTIONS pad->event_handler = decoder_src_pad_event_handler() pad->query_handler = decoder_src_pad_query_handler() pad->activation_handler = NULL pad->activate_pull = pad->activate_push = decoder_src_pad_activation_handler() pad->process_handler = NULL pad->process_precheck = NULL pad->pull_handler = NULL SINK FUNCTIONS pad->event_handler = decoder_sink_pad_event_handler() pad->query_handler = NULL pad->activation_handler = decoder_sink_pad_activation_handler() pad->activate_pull = ??? pad->activate_push = ??? pad->process_handler = decoder_sink_pad_process_handler() pad->process_precheck = NULL pad->chain_handler = decoder_sink_pad_chain_handler() This function is loaded in the ElementInit element_list[] table and called during create_element()
element | StreamElement pointer will be used to create ElementDecoder |
STREAM_OK | if successful |
STREAM_ERR_INVALID_ARGS | means invalid arguments |
int32_t decoder_set_type | ( | ElementHandle | element, |
DecoderType | dec_type ) |
element | ElementHandle that will be used as ElementDecoder to set the handlers to the input decoder type |
dec_type | DecoderType value that will be used to map the appropriate handler functions. |
STREAM_OK | if successful |
STREAM_ERR_INVALID_ARGS | means invalid arguments |
STREAM_ERR_GENERAL | is returned if dec_type is not handled |
int32_t decoder_activate_parse_tag | ( | ElementHandle | element, |
uint8_t | activate ) |
element | ElementHandle that will be used as ElementDecoder |
activate | value used to set parse_tag in decoder element. |
STREAM_OK | if successful |
STREAM_ERR_INVALID_ARGS | means invalid arguments |
void vUpdateAverageBitrate | ( | ElementDecoder * | element | ) |
element | ElementDecoder pointer that will contain the calculated average bit rate. |
int32_t decoder_set_property | ( | StreamElement * | element, |
uint16_t | prop_id, | ||
uint32_t | prop_value ) |
This is a new interface to replace the original decoder_set_type().
element | StreamElement pointer |
prop_id | id number of a element's property |
prop_value | the property value to be set |
STREAM_OK | if successful |
STREAM_ERR_INVALID_ARGS | means invalid arguments |
int32_t decoder_get_property | ( | StreamElement * | element, |
uint16_t | prop_id, | ||
uint32_t * | prop_value ) |
element | StreamElement pointer that will be used as ElementHandle |
prop_id | id number of a element's property |
prop_value | the property value to be saved in |
STREAM_OK | if successful |
STREAM_ERR_INVALID_ARGS | means invalid arguments |
|
static |