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

This file implement the network buffer source fucntions. More...

#include <string.h>
#include "streamer_element.h"
#include "netbuf_src.h"
#include "pipeline.h"
#include "streamer_element_properties.h"

Functions

static int32_t netbufsrc_change_state (StreamElement *element, PipelineState state)
 Function handles the state change of the element in a pipeline.
 
static uint8_t netbufsrc_handle_src_event (StreamPad *pad, StreamEvent *event)
 Function handles the events of the element source pad.
 
static uint8_t netbufsrc_handle_src_query (StreamPad *pad, StreamQuery *query)
 Function Description: This function is the empty impl of the src pad query handler.
 
static uint8_t netbufsrc_src_activate_pull (StreamPad *pad, uint8_t active)
 Function activates or deactivates the netbufsrc source pad in PULL mode.
 
static uint8_t netbufsrc_src_activation_handler (StreamPad *pad, uint8_t active)
 queue src pad activatation handler. Activation is handled by the peer sink pad, this should just handle the deactivation.
 
static FlowReturn netbufsrc_pull (StreamPad *pad, StreamBuffer *buffer, uint32_t size, uint32_t offset)
 Function is the pull function of the netbufsrc source pad in SCHEDULING_PULL mode. It reads the size of data from the offset to buffer.
 
static int32_t netbufsrc_get_property (StreamElement *element_ptr, uint16_t prop, uint32_t *val_ptr)
 This function get memory source element properties.
 
static int32_t netbufsrc_set_property (StreamElement *element_ptr, uint16_t prop, uintptr_t val)
 This function set memory source element properties.
 
int32_t netbufsrc_init (StreamElement *element)
 this function initializes the netbuf source element and source pad. all the pad's handlers are intialized.
 
static FlowReturn netbufsrc_read (ElementNetbufSrc *netbufsrc, int32_t offset, int32_t length, StreamBuffer *buf)
 Reads the data from the memory array specified by the element. NOTE: Function may or may not be able to read the required length of data.
 

Function Documentation

◆ netbufsrc_change_state()

static int32_t netbufsrc_change_state ( StreamElement * element,
PipelineState state )
static
Parameters
elementPointer to element
statechanged state.

◆ netbufsrc_handle_src_event()

static uint8_t netbufsrc_handle_src_event ( StreamPad * pad,
StreamEvent * event )
static
Parameters
padElement pad
eventtype of event

◆ netbufsrc_handle_src_query()

static uint8_t netbufsrc_handle_src_query ( StreamPad * pad,
StreamQuery * query )
static
Parameters
padpad handle
queryquery
Returns
uint8_t

◆ netbufsrc_src_activate_pull()

static uint8_t netbufsrc_src_activate_pull ( StreamPad * pad,
uint8_t active )
static
Parameters
padElement pad
activetrue if pad is to be activated else false to deactivate

◆ netbufsrc_src_activation_handler()

static uint8_t netbufsrc_src_activation_handler ( StreamPad * pad,
uint8_t active )
static
Parameters
padQueue element src pad
activeTo activate or deactivate pad.

◆ netbufsrc_pull()

static FlowReturn netbufsrc_pull ( StreamPad * pad,
StreamBuffer * buffer,
uint32_t size,
uint32_t offset )
static
Parameters
padElement pad
bufferPointer of the buffer to read data
sizeNumber of bytes to read
offsetOffset to the file

◆ netbufsrc_get_property()

static int32_t netbufsrc_get_property ( StreamElement * element_ptr,
uint16_t prop,
uint32_t * val_ptr )
static
Parameters
element_ptrelement pointer
propproperties
val_ptrparameters
Returns
StreamErrorType

◆ netbufsrc_set_property()

static int32_t netbufsrc_set_property ( StreamElement * element_ptr,
uint16_t prop,
uintptr_t val )
static
Parameters
element_ptrelement pointer
propproperties
valparameters
Returns
StreamErrorType

◆ netbufsrc_init()

int32_t netbufsrc_init ( StreamElement * element)
Parameters
elementpointer to element
Returns
StreamReturnType
Return values
STREAM_OKif successful
STREAM_ERR_INVALID_ARGSmeans invalid arguments

◆ netbufsrc_read()

static FlowReturn netbufsrc_read ( ElementNetbufSrc * netbufsrc,
int32_t offset,
int32_t length,
StreamBuffer * buf )
static
Parameters
netbufsrcPointer to netbufsrc element
offsetOffset of the file to read data from
lengthNumber of bytes to read
bufPointer to buffer to read data
Return values
FLOW_EOSwhen EOF file is encountered.
FLOW_ERRORwhen read fails.