17#ifndef FFMPEG_AUDIOFIFO_H
18#define FFMPEG_AUDIOFIFO_H
46 FFmpeg_AudioFifo(AVSampleFormat sample_fmt,
int channels,
int nb_samples = 1);
76 int alloc(AVSampleFormat sample_fmt,
int channels,
int nb_samples = 1);
108 int write(
void **data,
int nb_samples);
116 int read(
void **data,
int nb_samples);
128 const AVAudioFifo*
get()
const;
139 operator AVAudioFifo*();
144 operator const AVAudioFifo*()
const;
RAII wrapper for AVAudioFifo.
int write(void **data, int nb_samples)
Write audio samples into the FIFO.
FFmpeg_AudioFifo()
Construct an empty FIFO wrapper.
AVAudioFifo * release()
Release ownership without freeing the FIFO.
void reset()
Free the owned FIFO and reset the wrapper to empty.
AVAudioFifo * m_fifo
Pointer to underlying AVAudioFifo.
AVAudioFifo * get()
Get the owned FFmpeg FIFO pointer.
int read(void **data, int nb_samples)
Read audio samples from the FIFO.
bool empty() const
Check whether the wrapper currently owns a FIFO.
~FFmpeg_AudioFifo()
Release the owned FIFO, if any.
int size() const
Return the number of samples currently stored in the FIFO.
int realloc(int nb_samples)
Resize the FIFO allocation.
int alloc(AVSampleFormat sample_fmt, int channels, int nb_samples=1)
Allocate a new audio FIFO, replacing any existing one.
Various FFmpegfs utility functions.