RAII AVAudioFifo for sample buffering (loudnorm / encoder).
More...
#include <StormByte/multimedia/ffmpeg/AudioFifo.hxx>
|
| | AudioFifo (AudioFifo &&other) noexcept=default |
| | Move constructor.
|
| | ~AudioFifo () noexcept override |
| | Destructor.
|
| AudioFifo & | operator= (AudioFifo &&other) noexcept=default |
| | Move assignment.
|
| | operator bool () const noexcept |
| | Whether a fifo is allocated.
|
| int | Size () const noexcept |
| | Samples currently stored.
|
| int | Space () const noexcept |
| | Free sample slots.
|
| bool | Write (const AVFrame &src) noexcept |
| | Appends src samples to the fifo.
|
| bool | Read (AVFrame &dst, int nb_samples) noexcept |
| | Reads nb_samples into dst (already allocated).
|
| bool | Realloc (int nb_samples) noexcept |
| | Grows the fifo so it can hold at least nb_samples.
|
| constexpr | AVPointer () noexcept=delete |
| | Default constructor (deleted).
|
| virtual | ~AVPointer () noexcept=default |
| | Destructor.
|
| constexpr AVPointer & | operator= (const AVPointer &) noexcept=delete |
| | Copy assignment (deleted).
|
|
| static AudioFifo | Open (int sample_fmt, int channels, int nb_samples) noexcept |
| | Allocates a fifo.
|
|
| constexpr const std::decay_t< ::AVAudioFifo > * | Get () const noexcept |
| | Const view of the raw FFmpeg pointer.
|
| constexpr std::decay_t< ::AVAudioFifo > * | Detach () noexcept |
| | Yields the raw pointer and leaves this wrapper empty.
|
| std::decay_t< ::AVAudioFifo > * | m_ptr |
| | Owned FFmpeg pointer.
|
RAII AVAudioFifo for sample buffering (loudnorm / encoder).
◆ AudioFifo()
| StormByte::Multimedia::FFmpeg::AudioFifo::AudioFifo |
( |
AudioFifo && | other | ) |
|
|
defaultnoexcept |
Move constructor.
Transfers the fifo.
- Parameters
-
| other | Source fifo; left empty. |
◆ ~AudioFifo()
| StormByte::Multimedia::FFmpeg::AudioFifo::~AudioFifo |
( |
| ) |
|
|
overridenoexcept |
Destructor.
Frees the AVAudioFifo.
◆ Open()
| AudioFifo StormByte::Multimedia::FFmpeg::AudioFifo::Open |
( |
int | sample_fmt, |
|
|
int | channels, |
|
|
int | nb_samples ) |
|
staticnoexcept |
Allocates a fifo.
Empty wrapper on failure.
- Parameters
-
| sample_fmt | AVSampleFormat as int. |
| channels | Channel count. |
| nb_samples | Initial capacity in samples. |
- Returns
- Open fifo, or empty on failure.
◆ operator bool()
| StormByte::Multimedia::FFmpeg::AudioFifo::operator bool |
( |
| ) |
const |
|
explicitnoexcept |
Whether a fifo is allocated.
- Returns
- true if Write / Read can run.
◆ operator=()
Move assignment.
Frees *this, then takes other.
- Parameters
-
| other | Source fifo; left empty. |
- Returns
- *this.
◆ Read()
| bool StormByte::Multimedia::FFmpeg::AudioFifo::Read |
( |
AVFrame & | dst, |
|
|
int | nb_samples ) |
|
noexcept |
Reads nb_samples into dst (already allocated).
- Parameters
-
| dst | Destination audio frame. |
| nb_samples | Samples to read. |
- Returns
- false on failure.
◆ Realloc()
| bool StormByte::Multimedia::FFmpeg::AudioFifo::Realloc |
( |
int | nb_samples | ) |
|
|
noexcept |
Grows the fifo so it can hold at least nb_samples.
- Parameters
-
| nb_samples | Minimum capacity in samples. |
- Returns
- false on failure.
◆ Size()
| int StormByte::Multimedia::FFmpeg::AudioFifo::Size |
( |
| ) |
const |
|
noexcept |
Samples currently stored.
- Returns
- Sample count, or 0.
◆ Space()
| int StormByte::Multimedia::FFmpeg::AudioFifo::Space |
( |
| ) |
const |
|
noexcept |
Free sample slots.
- Returns
- Remaining capacity, or 0.
◆ Write()
| bool StormByte::Multimedia::FFmpeg::AudioFifo::Write |
( |
const AVFrame & | src | ) |
|
|
noexcept |
Appends src samples to the fifo.
- Parameters
-
- Returns
- false on failure.
The documentation for this class was generated from the following file: