121 if (INT_MAX / 2 - current_size < nb_samples)
AVAudioFifo * av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels, int nb_samples)
Allocate an AVAudioFifo.
int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples)
Read data from an AVAudioFifo.
ptrdiff_t const GLvoid * data
memory handling functions
void av_audio_fifo_free(AVAudioFifo *af)
Free an AVAudioFifo.
int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size, void(*func)(void *, void *, int))
Feed data from an AVFifoBuffer to a user-supplied callback.
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int(*func)(void *, void *, int))
Feed data from a user-supplied callback to an AVFifoBuffer.
enum AVSampleFormat sample_fmt
sample format
int allocated_samples
current allocated size, in samples
void av_fifo_free(AVFifoBuffer *f)
Free an AVFifoBuffer.
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
int av_audio_fifo_space(AVAudioFifo *af)
Get the current number of samples in the AVAudioFifo available for writing.
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void(*func)(void *, void *, int))
Feed data from an AVFifoBuffer to a user-supplied callback.
Context for an Audio FIFO Buffer.
int nb_buffers
number of buffers
int av_audio_fifo_size(AVAudioFifo *af)
Get the current number of samples in the AVAudioFifo available for reading.
int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples)
Reallocate an AVAudioFifo.
AVFifoBuffer ** buf
single buffer for interleaved, per-channel buffers for planar
int nb_samples
number of samples currently in the FIFO
AVSampleFormat
Audio sample formats.
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int new_size)
Resize an AVFifoBuffer.
int channels
number of channels
a very simple circular buffer FIFO implementation
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
Get the required buffer size for the given audio parameters.
int sample_size
size, in bytes, of one sample in a buffer
int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples)
Write data to an AVAudioFifo.
int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples)
Drain data from an AVAudioFifo.
common internal and external API header
AVFifoBuffer * av_fifo_alloc(unsigned int size)
Initialize an AVFifoBuffer.
int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples)
Peek data from an AVAudioFifo.
static void * av_mallocz_array(size_t nmemb, size_t size)
void av_fifo_reset(AVFifoBuffer *f)
Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied...
void av_fifo_drain(AVFifoBuffer *f, int size)
Discard data from the FIFO.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
void av_audio_fifo_reset(AVAudioFifo *af)
Reset the AVAudioFifo buffer.