Maestro Audio Framework v 1.4
NXP Semiconductors
eap.c File Reference

This file contains the implementation for the Eap integration. More...

#include <string.h>
#include "eap.h"
#include "pipeline.h"
#include "streamer_element_properties.h"

Functions

static uint8_t eap_sink_pad_activation_handler (StreamPad *pad, uint8_t active)
 This function activates the pad and allocates memory for the Eap element. More...
 
static FlowReturn eap_sink_pad_chain_handler (StreamPad *pad, StreamBuffer *buf)
 This pad function takes data from the source element and pushes it onto the EAP library. More...
 
static uint8_t eap_sink_pad_event_handler (StreamPad *pad, StreamEvent *event)
 This function processes the pad events. More...
 
static int32_t eap_change_state (StreamElement *element_ptr, PipelineState new_state)
 This function changes the EAP state and calls the appropriate apis for that state and takes the actions and then returns. PipelineState Transition: NULL to READY: Nothing to do READY to PAUSE: Activate sink pads and their peer pads PAUSE to PLAY: Start Writing PAUSE to READY: Deactivate sink pads and their peer pads READY to NULL: Nothing to do. More...
 
static uint8_t eap_sink_pad_query_handler (StreamPad *pad, StreamQuery *query)
 This pad function handles query from the pipeline. If not able to handle the query then it pushes the query to its peer. More...
 
static uint8_t eap_src_pad_query_handler (StreamPad *pad, StreamQuery *query)
 eap_src_pad_query_handler More...
 
static uint8_t eap_src_pad_event_handler (StreamPad *pad, StreamEvent *event)
 eap_src_pad_event_handler More...
 
static PadReturn eap_src_pull_handler (StreamPad *pad, StreamBuffer *buffer, uint32_t size, uint32_t offset)
 Empty EAP src pull handler function. More...
 
static int32_t eap_set_property (StreamElement *element_ptr, uint16_t prop, uint32_t val)
 This function sets EAP element's properties. More...
 
static int32_t eap_get_property (StreamElement *element_ptr, uint16_t prop, uint32_t *val_ptr)
 This function gets EAP element's properties. More...
 
int32_t eap_init_element (StreamElement *element_ptr)
 This function initializes the eap element and pads. More...
 
int32_t eap_set_buffer (ElementHandle element_hdl, char *location_ptr, uint32_t size)
 Set the location of the memory buffer to write to as well as the size. More...
 
int32_t eap_register_ext_processing (ElementHandle element, EapInitFunc init_func_ptr, EapPostProcFunc proc_func_ptr, EapDeinitFunc deinit_func_ptr, void *arg_ptr)
 Register function pointers and arguments. More...
 

Function Documentation

◆ eap_sink_pad_activation_handler()

static uint8_t eap_sink_pad_activation_handler ( StreamPad *  pad,
uint8_t  active 
)
static
Parameters
padpad handle
activeboolean activate/disactivate pad
Returns
true/false
Return values
truesuccess
falsefailed

◆ eap_sink_pad_chain_handler()

static FlowReturn eap_sink_pad_chain_handler ( StreamPad *  pad,
StreamBuffer buf 
)
static
Parameters
padpad handle
bufinput buffer
Returns
FlowReturn
Return values
FLOW_OKsuccess
FLOW_UNEXPECTEDbad paramesters
FLOW_ERRORwrite failed

◆ eap_sink_pad_event_handler()

static uint8_t eap_sink_pad_event_handler ( StreamPad *  pad,
StreamEvent event 
)
static
Parameters
padpad handle
eventevent enumeration
Returns
true/false
Return values
truesuccess
falsefailed

◆ eap_change_state()

static int32_t eap_change_state ( StreamElement *  element_ptr,
PipelineState  new_state 
)
static
Parameters
element_ptrelement
new_stateeap state to be changed
Returns
StreamReturnType
Return values
STREAM_OKsuccess
STREAM_ERR_INVALID_ARGSinvalid arguments

◆ eap_sink_pad_query_handler()

static uint8_t eap_sink_pad_query_handler ( StreamPad *  pad,
StreamQuery query 
)
static
Parameters
padpad handle
queryinput buffer
Returns
: true/false

◆ eap_src_pad_query_handler()

static uint8_t eap_src_pad_query_handler ( StreamPad *  pad,
StreamQuery query 
)
static

This pad function handles query from the pipeline. If not able to handle the query then it pushes the query to its peer.

Parameters
padpad handle
queryinput buffer
Returns
: true/false

◆ eap_src_pad_event_handler()

static uint8_t eap_src_pad_event_handler ( StreamPad *  pad,
StreamEvent event 
)
static

This pad function handles events from the pipeline. If not able to handle the event then it pushes the event to its peer.

Parameters
padpad handle
eventinput buffer
Returns
: true/false

◆ eap_src_pull_handler()

static PadReturn eap_src_pull_handler ( StreamPad *  pad,
StreamBuffer buffer,
uint32_t  size,
uint32_t  offset 
)
static
Parameters
padPad pointer
bufferBuffer pointer
sizeSize
offsetOffset
Returns
PadReturn

◆ eap_set_property()

static int32_t eap_set_property ( StreamElement *  element_ptr,
uint16_t  prop,
uint32_t  val 
)
static
Parameters
element_ptrEAP element instance
propeap element property
valvalue pointer
Returns
StreamReturnType
Return values
STREAM_OKsuccess
STREAM_ERR_INFO_ABSENTunknown property
STREAM_GENERALbad status to set the property

◆ eap_get_property()

static int32_t eap_get_property ( StreamElement *  element_ptr,
uint16_t  prop,
uint32_t *  val_ptr 
)
static
Parameters
element_ptrEAP element instance
propeap element property
val_ptrvalue pointer
Returns
AudioSinkStreamErrorType
Return values
STREAM_OKsuccess
STREAM_ERR_INVALID_ARGSbad arguments
STREAM_ERR_INFO_ABSENTunknown property

◆ eap_init_element()

int32_t eap_init_element ( StreamElement *  element_ptr)
Parameters
element_ptrpointer of eap element instance
Returns
StreamReturnType
Return values
STREAM_OKsuccess
STREAM_ERR_ELEMENT_NOT_FOUNDinvalid instance pointer of element_ptr

◆ eap_set_buffer()

int32_t eap_set_buffer ( ElementHandle  element_hdl,
char *  location_ptr,
uint32_t  size 
)
Parameters
element_hdlelement handle
location_ptrlocation path
sizebuffer size
Returns
StreamReturnType
Return values
STREAM_OKsuccess
STREAM_ERR_INVALID_ARGSinvalid parameters
STREAM_ERR_GENERALstatus is bigger than or eque to STATE_PAUSED

◆ eap_register_ext_processing()

int32_t eap_register_ext_processing ( ElementHandle  element,
EapInitFunc  init_func_ptr,
EapPostProcFunc  proc_func_ptr,
EapDeinitFunc  deinit_func_ptr,
void *  arg_ptr 
)
Parameters
elementeap element handle
init_func_ptrinitialization function pointer
proc_func_ptrprocessing function pointer
deinit_func_ptrdeinit function pointer
arg_ptrarguments pointer
Returns
STREAM_OK
STREAM_ERR_INVALID_ARGS