Sound Open Firmware
Loading...
Searching...
No Matches
sink_source_utils.h File Reference
Include dependency graph for sink_source_utils.h:

Go to the source code of this file.

Functions

int release_source_and_commit_sink (struct sof_source *source, size_t free_size, struct sof_sink *sink, size_t commit_size)
 release processed data from source and commit produced data to sink
 
int source_to_sink_copy (struct sof_source *source, struct sof_sink *sink, bool free, size_t size)
 copy bytes from source to sink
 
int sink_fill_with_silence (struct sof_sink *sink, size_t size)
 fill sink with silence (zeros)
 
int source_drop_data (struct sof_source *source, size_t size)
 drop data from source
 
static size_t source_sink_avail_frames_aligned (struct sof_source *source, struct sof_sink *sink)
 Computes maximum number of frames aligned with the source align criteria that can be copied from source to sink, verifying the number of available source frames vs.
 

Function Documentation

◆ release_source_and_commit_sink()

int release_source_and_commit_sink ( struct sof_source *  source,
size_t  free_size,
struct sof_sink *  sink,
size_t  commit_size 
)

release processed data from source and commit produced data to sink

Parameters
sourcethe data source to release data from
free_sizenumber of bytes to be released (freed) from the source
sinkthe data target to commit data to
commit_sizenumber of bytes to be committed to the sink
Returns
0 on success; on error, the error code returned by source_release_data() takes precedence, otherwise the error code returned by sink_commit_buffer() is returned. The sink is always committed regardless of the source release result.

◆ sink_fill_with_silence()

int sink_fill_with_silence ( struct sof_sink *  sink,
size_t  size 
)

fill sink with silence (zeros)

Parameters
sinkthe target to be filled with silence
sizenumber of bytes to be filled

◆ source_drop_data()

int source_drop_data ( struct sof_source *  source,
size_t  size 
)

drop data from source

Parameters
sourcethe source of data to be dropped
sizenumber of bytes to be dropped

◆ source_sink_avail_frames_aligned()

static size_t source_sink_avail_frames_aligned ( struct sof_source *  source,
struct sof_sink *  sink 
)
inlinestatic

Computes maximum number of frames aligned with the source align criteria that can be copied from source to sink, verifying the number of available source frames vs.

free space available in sink.

Parameters
sourcethe data source
sinkthe data sink
Returns
Number of aligned frames available for processing.

◆ source_to_sink_copy()

int source_to_sink_copy ( struct sof_source *  source,
struct sof_sink *  sink,
bool  free,
size_t  size 
)

copy bytes from source to sink

Parameters
sourcethe data source
sinkthe data target
freeif true, data from source will be freed if false, data will remain in the source
sizenumber of bytes to be copied