AudioDecoder
AudioDecoder
#include <icy/av/audiodecoder.h>struct AudioDecoderDefined in src/av/include/icy/av/audiodecoder.h:28
Inherits:
AudioContext
Decodes compressed audio packets into raw sample frames.
List of all members
| Name | Kind | Owner |
|---|---|---|
AudioDecoder | function | Declared here |
~AudioDecoder | function | Declared here |
create | function | Declared here |
close | function | Declared here |
decode | function | Declared here |
flush | function | Declared here |
emitter | variable | Inherited from AudioContext |
iparams | variable | Inherited from AudioContext |
oparams | variable | Inherited from AudioContext |
stream | variable | Inherited from AudioContext |
ctx | variable | Inherited from AudioContext |
codec | variable | Inherited from AudioContext |
frame | variable | Inherited from AudioContext |
resampler | variable | Inherited from AudioContext |
outputFrameSize | variable | Inherited from AudioContext |
time | variable | Inherited from AudioContext |
pts | variable | Inherited from AudioContext |
seconds | variable | Inherited from AudioContext |
error | variable | Inherited from AudioContext |
AudioContext | function | Inherited from AudioContext |
~AudioContext | function | Inherited from AudioContext |
AudioContext | function | Inherited from AudioContext |
operator= | function | Inherited from AudioContext |
AudioContext | function | Inherited from AudioContext |
operator= | function | Inherited from AudioContext |
create | function | Inherited from AudioContext |
open | function | Inherited from AudioContext |
close | function | Inherited from AudioContext |
decode | function | Inherited from AudioContext |
encode | function | Inherited from AudioContext |
encode | function | Inherited from AudioContext |
encode | function | Inherited from AudioContext |
flush | function | Inherited from AudioContext |
recreateResampler | function | Inherited from AudioContext |
Inherited from AudioContext
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
variable | iparams | input parameters |
variable | oparams | output parameters |
variable | stream | encoder or decoder stream |
variable | ctx | encoder or decoder context |
variable | codec | encoder or decoder codec |
variable | frame | last encoded or decoded frame |
variable | resampler | audio resampler |
variable | outputFrameSize | encoder or decoder output frame size |
variable | time | stream time in codec time base |
variable | pts | last packet pts value |
variable | seconds | audio time in seconds |
variable | error | error message |
function | AudioContext | |
function | ~AudioContext virtual noexcept | |
function | AudioContext | Deleted constructor. |
function | operator= | Deleted assignment operator. |
function | AudioContext | Deleted constructor. |
function | operator= | Deleted assignment operator. |
function | create virtual | Initialise the AVCodecContext with codec-specific defaults. Implemented by AudioEncoder and AudioDecoder. |
function | open virtual | Open the codec and create the resampler if input/output parameters differ. Throws std::runtime_error if the codec context has not been created. |
function | close virtual | Close the codec context, free the frame, and reset timestamps. |
function | decode virtual | Decode a compressed audio packet and emit the resulting samples. |
function | encode virtual | Encode a buffer of interleaved audio samples. |
function | encode virtual | Encode a buffer of planar audio samples. |
function | encode virtual | Encode a single AVFrame. |
function | flush virtual | Flush any frames buffered inside the codec and emit remaining output. |
function | recreateResampler virtual | Recreate the AudioResampler using the current iparams and oparams. Called automatically by open() when format conversion is required. |
Public Methods
| Return | Name | Description |
|---|---|---|
AudioDecoder | Construct a decoder for the given stream. The codec parameters are read from the stream's codecpar. | |
void | create virtual override | Initialise the AVCodecContext from the stream's codec parameters. |
void | close virtual override | Close and free the AVCodecContext and associated resources. |
bool | decode virtual override | Decode the given compressed audio packet and emit the decoded samples. |
void | flush virtual override | Flush any frames buffered inside the decoder. Call this after the last packet to retrieve all remaining decoded output. |
AudioDecoder
AudioDecoder(AVStream * stream)Defined in src/av/include/icy/av/audiodecoder.h:33
Construct a decoder for the given stream. The codec parameters are read from the stream's codecpar.
Parameters
streamThe AVStream to decode; must remain valid for the lifetime of this decoder.
create
virtual override
virtual void create() overrideDefined in src/av/include/icy/av/audiodecoder.h:37
Initialise the AVCodecContext from the stream's codec parameters.
Reimplements
close
virtual override
virtual void close() overrideDefined in src/av/include/icy/av/audiodecoder.h:40
Close and free the AVCodecContext and associated resources.
Reimplements
decode
virtual override
virtual bool decode(AVPacket & ipacket) overrideDefined in src/av/include/icy/av/audiodecoder.h:45
Decode the given compressed audio packet and emit the decoded samples.
Parameters
ipacketThe compressed audio packet to decode.
Returns
True if one or more output frames were decoded and emitted, false otherwise.
Reimplements
flush
virtual override
virtual void flush() overrideDefined in src/av/include/icy/av/audiodecoder.h:49
Flush any frames buffered inside the decoder. Call this after the last packet to retrieve all remaining decoded output.
