#include <icy/av/audioencoder.h>Inherits:
AudioContextSubclassed by:AudioPacketEncoder
Encodes raw audio samples into a compressed format.
av::AudioBuffer fifoAVFormatContext * format| Return | Name | Description |
|---|---|---|
AudioEncoder | Construct an encoder, optionally tied to an existing muxer context. | |
void | create virtual | Initialise the AVCodecContext using oparams. Adds an audio stream to format if one was provided at construction. |
void | close virtual | Close and free the AVCodecContext, FIFO buffer, and associated resources. |
bool | encode virtual | Encode interleaved audio samples. |
bool | encode virtual | Encode planar audio samples. |
bool | encode virtual | Encode a single AVFrame (typically from a decoder or resampler). |
void | flush virtual | Flush remaining packets to be encoded. This method should be called once before stream closure. |
AudioEncoder(AVFormatContext * format)Construct an encoder, optionally tied to an existing muxer context.
format The AVFormatContext that will receive encoded packets, or nullptr for standalone use.virtual
virtual void create()Initialise the AVCodecContext using oparams. Adds an audio stream to format if one was provided at construction.
virtual
virtual void close()Close and free the AVCodecContext, FIFO buffer, and associated resources.
virtual
virtual bool encode(uint8_t * samples, const int numSamples, const int64_t pts)Encode interleaved audio samples.
samples The input samples to encode.
numSamples The number of input samples per channel.
pts The input samples presentation timestamp.
virtual
virtual bool encode(uint8_t * samples, const int numSamples, const int64_t pts)Encode planar audio samples.
samples The input samples to encode.
numSamples The number of input samples per channel.
pts The input samples presentation timestamp.
virtual
virtual bool encode(AVFrame * iframe)Encode a single AVFrame (typically from a decoder or resampler).
iframe The source audio frame with all fields set.True if an encoded packet was produced and emitted.
virtual
virtual void flush()Flush remaining packets to be encoded. This method should be called once before stream closure.