103 int i, ret, buf_size;
109 if (buf_size > cur_size) {
127 if (INT_MAX / 2 - current_size < nb_samples)
151 int nb_samples,
int offset)
#define i(width, name, range_min, range_max)
int av_audio_fifo_peek(const AVAudioFifo *af, void *const *data, int nb_samples)
Peek data from an AVAudioFifo.
AVAudioFifo * av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels, int nb_samples)
Allocate an AVAudioFifo.
int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples)
Reallocate an AVAudioFifo.
int av_audio_fifo_peek_at(const AVAudioFifo *af, void *const *data, int nb_samples, int offset)
Peek data from an AVAudioFifo.
int av_audio_fifo_space(AVAudioFifo *af)
Get the current number of samples in the AVAudioFifo available for writing.
void av_audio_fifo_reset(AVAudioFifo *af)
Reset the AVAudioFifo buffer.
int av_audio_fifo_write(AVAudioFifo *af, void *const *data, int nb_samples)
Write data to an AVAudioFifo.
int av_audio_fifo_read(AVAudioFifo *af, void *const *data, int nb_samples)
Read data from an AVAudioFifo.
void av_audio_fifo_free(AVAudioFifo *af)
Free an AVAudioFifo.
int av_audio_fifo_size(AVAudioFifo *af)
Get the current number of samples in the AVAudioFifo available for reading.
int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples)
Drain data from an AVAudioFifo.
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
AVFifo * av_fifo_alloc2(size_t nb_elems, size_t elem_size, unsigned int flags)
Allocate and initialize an AVFifo with a given element size.
void av_fifo_freep2(AVFifo **f)
Free an AVFifo and reset pointer to NULL.
void av_fifo_reset2(AVFifo *f)
size_t av_fifo_can_write(const AVFifo *f)
size_t av_fifo_can_read(const AVFifo *f)
int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset)
Read data from a FIFO without modifying FIFO state.
int av_fifo_grow2(AVFifo *f, size_t inc)
Enlarge an AVFifo.
int av_fifo_write(AVFifo *f, const void *buf, size_t nb_elems)
Write data into a FIFO.
void av_fifo_drain2(AVFifo *f, size_t size)
Discard the specified amount of data from an AVFifo.
int av_fifo_read(AVFifo *f, void *buf, size_t nb_elems)
Read data from a FIFO.
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
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.
AVSampleFormat
Audio sample formats.
Utility Preprocessor macros.
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
Context for an Audio FIFO Buffer.
int allocated_samples
current allocated size, in samples
enum AVSampleFormat sample_fmt
sample format
int nb_buffers
number of buffers
int nb_samples
number of samples currently in the FIFO
int sample_size
size, in bytes, of one sample in a buffer
AVFifo ** buf
single buffer for interleaved, per-channel buffers for planar
int channels
number of channels
static void error(const char *err)