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

This file contains the streamer element pad implementation. More...

#include "streamer.h"
#include "streamer_api.h"
#include "pad.h"

Functions

static FlowReturn pad_chain (StreamPad *pad, StreamBuffer *buffer)
 Function for processing the pad chain handler. More...
 
static FlowReturn pad_pull (StreamPad *pad, uint32_t offset, uint32_t size, StreamBuffer *buffer)
 Function for processing the pad pull handler. More...
 
static void pre_activate (StreamPad *pad, PadScheduling new_mode)
 Pre activation function. More...
 
static void post_activate (StreamPad *pad, PadScheduling new_mode)
 Post activation function. More...
 
static FlowReturn event_create (StreamEvent *event, EventType type, StreamDataFormat format, uint32_t data)
 Create event to be sent to another pad. More...
 
FlowReturn init_pad (StreamPad *pad, void *parent, PadType type)
 Pad initialization function. More...
 
FlowReturn deinit_pad (StreamPad *pad)
 Pad deinitialization function. More...
 
FlowReturn pad_push (StreamPad *pad, StreamBuffer *buffer)
 Push the data buffer to the peer pad. More...
 
FlowReturn pad_pull_range (StreamPad *pad, uint32_t offset, uint32_t size, StreamBuffer *buffer)
 Pull the data buffer from the peer pad. More...
 
uint8_t pad_push_event (StreamPad *pad, StreamEvent *event)
 Push event to the peer pad. More...
 
uint8_t pad_send_event (StreamPad *pad, StreamEvent *event)
 Send the event to the element where it will be handled by a handler function. More...
 
uint8_t activate_pad (StreamPad *pad, uint8_t activate)
 Call the appropriate pad activation function. More...
 
uint8_t pad_activate_pull (StreamPad *pad, uint8_t active)
 Pad activation/deactivation in pull mode. More...
 
uint8_t pad_activate_push (StreamPad *pad, uint8_t active)
 Pad activation/deactivation in push mode. More...
 
FlowReturn event_create_flush_start (StreamEvent *event)
 Create flush start event. More...
 
FlowReturn event_create_flush_stop (StreamEvent *event)
 Create flush stop event. More...
 
FlowReturn event_create_eos (StreamEvent *event)
 Create end of stream event. More...
 
FlowReturn event_create_new_segment (StreamEvent *event, StreamDataFormat format, uint32_t data)
 Create new segment event. More...
 
FlowReturn event_create_seek (StreamEvent *event, StreamDataFormat format, uint32_t data)
 Create seek event. More...
 
uint8_t pad_query (StreamPad *pad, StreamQuery *query)
 Send a query to a pad. More...
 
FlowReturn query_create (StreamQuery *query, StreamInfoType type, StreamDataFormat format, StreamDataType data_type, StreamData *data)
 Create a query for element or pipeline. More...
 

Function Documentation

◆ pad_chain()

static FlowReturn pad_chain ( StreamPad *  pad,
StreamBuffer buffer 
)
static
Parameters
padsink pad that needs to process the chain handler
bufferbuffer to be processed
Returns
FlowReturn

◆ pad_pull()

static FlowReturn pad_pull ( StreamPad *  pad,
uint32_t  offset,
uint32_t  size,
StreamBuffer buffer 
)
static
Parameters
padsource pad that needs to process the pull handler
offsetposition in the source buffer
sizesize to be read
bufferbuffer to be filled
Returns
FlowReturn

◆ pre_activate()

static void pre_activate ( StreamPad *  pad,
PadScheduling  new_mode 
)
static
Parameters
padpad to be activated
new_modescheduling mode to be applied

◆ post_activate()

static void post_activate ( StreamPad *  pad,
PadScheduling  new_mode 
)
static
Parameters
padpad to be activated
new_modescheduling mode to be applied

◆ event_create()

static FlowReturn event_create ( StreamEvent event,
EventType  type,
StreamDataFormat  format,
uint32_t  data 
)
static
Parameters
eventevent object
typetype of event
formatevent format
dataevent data
Returns
FlowReturn

◆ init_pad()

FlowReturn init_pad ( StreamPad *  pad,
void *  parent,
PadType  type 
)
Parameters
padpad object
parentparent element object
typepad type
Returns
FlowReturn

◆ deinit_pad()

FlowReturn deinit_pad ( StreamPad *  pad)
Parameters
padpad object
Returns
FlowReturn

◆ pad_push()

FlowReturn pad_push ( StreamPad *  pad,
StreamBuffer buffer 
)
Parameters
padpad object
bufferdata buffer
Returns
FlowReturn

◆ pad_pull_range()

FlowReturn pad_pull_range ( StreamPad *  pad,
uint32_t  offset,
uint32_t  size,
StreamBuffer buffer 
)
Parameters
padpad object
offsetoffset position to be read from
sizesize to be read
bufferdata buffer to be filled
Returns
FlowReturn

◆ pad_push_event()

uint8_t pad_push_event ( StreamPad *  pad,
StreamEvent event 
)
Parameters
padpad object
eventevent object
Returns
uint8_t

◆ pad_send_event()

uint8_t pad_send_event ( StreamPad *  pad,
StreamEvent event 
)
Parameters
padpad object
eventevent object
Returns
uint8_t

◆ activate_pad()

uint8_t activate_pad ( StreamPad *  pad,
uint8_t  activate 
)
Parameters
padpad object
activateactivation/deactivation flag
Returns
uint8_t

◆ pad_activate_pull()

uint8_t pad_activate_pull ( StreamPad *  pad,
uint8_t  active 
)
Parameters
padpad object
activeactivation/deactivation flag
Returns
uint8_t

◆ pad_activate_push()

uint8_t pad_activate_push ( StreamPad *  pad,
uint8_t  active 
)
Parameters
padpad object
activeactivation/deactivation flag
Returns
uint8_t

◆ event_create_flush_start()

FlowReturn event_create_flush_start ( StreamEvent event)
Parameters
eventevent object
Returns
FlowReturn

◆ event_create_flush_stop()

FlowReturn event_create_flush_stop ( StreamEvent event)
Parameters
eventevent object
Returns
FlowReturn

◆ event_create_eos()

FlowReturn event_create_eos ( StreamEvent event)
Parameters
eventevent object
Returns
FlowReturn

◆ event_create_new_segment()

FlowReturn event_create_new_segment ( StreamEvent event,
StreamDataFormat  format,
uint32_t  data 
)
Parameters
eventevent object
formatdata format
datadata object
Returns
FlowReturn

◆ event_create_seek()

FlowReturn event_create_seek ( StreamEvent event,
StreamDataFormat  format,
uint32_t  data 
)
Parameters
eventevent object
formatdata format
datadata object
Returns
FlowReturn

◆ pad_query()

uint8_t pad_query ( StreamPad *  pad,
StreamQuery query 
)
Parameters
padpad object
queryquery object
Returns
uint8_t

◆ query_create()

FlowReturn query_create ( StreamQuery query,
StreamInfoType  type,
StreamDataFormat  format,
StreamDataType  data_type,
StreamData data 
)
Parameters
queryquery object to be created
typetype of information to be queried
formatdata format
data_typedata type
datadata object
Returns
FlowReturn