Sound Open Firmware
Loading...
Searching...
No Matches

Circular audio buffer calculation and wrap utilities for processing modules. More...

Include dependency graph for audio_stream.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sof_audio_stream_params
 set of parameters describing audio stream this structure is shared between audio_stream.h and sink/source interface TODO: compressed formats More...
 
struct  cir_buf_source
 Read-only view of source data in a circular buffer. More...
 
struct  cir_buf_sink
 Writable view of sink data in a circular buffer. More...
 

Enumerations

enum  sof_audio_buffer_state { AUDIOBUF_STATE_INITIAL , AUDIOBUF_STATE_READY , AUDIOBUF_STATE_END_OF_STREAM , AUDIOBUF_STATE_END_OF_STREAM_FLUSH }
 Define states of an audio stream buffer connecting two components. More...
 

Functions

static size_t circ_buf_frames_without_wrap (const void *began, const void *end, size_t sample_bytes, size_t channels)
 Number of whole frames available before a circular buffer wraps.
 
static size_t cir_buf_samples_to_wrap_s16 (const int16_t *ptr, const int16_t *buf_start, size_t buf_samples)
 Calculates numbers of s16 samples to buffer wrap.
 
static size_t cir_buf_samples_to_wrap_s32 (const int32_t *ptr, const int32_t *buf_start, size_t buf_samples)
 Calculates numbers of s32 samples to buffer wrap.
 
static size_t cir_buf_samples_without_wrap_s16 (const void *ptr, const void *buf_end)
 Calculates numbers of s16 samples to buffer wrap when reading a circular buffer forward from current pointer towards the buffer end.
 
static size_t cir_buf_samples_without_wrap_s32 (const void *ptr, const void *buf_end)
 Calculates numbers of s32 samples to buffer wrap when reading a circular buffer forward from current pointer towards the buffer end.
 
static size_t cir_buf_bytes_without_wrap (const void *ptr, const void *buf_end)
 Calculates number of bytes to buffer wrap when reading a circular buffer forward from current pointer towards the buffer end.
 
static void * cir_buf_wrap (const void *ptr, const void *buf_addr, const void *buf_end)
 Verifies the pointer and performs rollover when reaching the end of the circular buffer.
 
static const void * source_cir_buf_wrap (const void *ptr, const void *buf_addr, const void *buf_end)
 Verifies a read pointer and performs rollover when reaching the end of the circular buffer.
 
static size_t cir_buf_bytes_without_wrap_rewind (const void *ptr, const void *buf_start)
 Calculates number of bytes to buffer wrap when reading a circular buffer backwards from current pointer towards the buffer start.
 
static const void * source_cir_buf_rewind_wrap (const void *ptr, const void *buf_start, const void *buf_end)
 Verifies the pointer and performs rollover when reading a read-only circular buffer backwards past its start address.
 

Detailed Description

Circular audio buffer calculation and wrap utilities for processing modules.