AV module
AudioDecoder
Decodes compressed audio packets into raw sample frames.
AudioDecoder
#include <icy/av/audiodecoder.h>Inherits:
AudioContext
Decodes compressed audio packets into raw sample frames.
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 | Initialise the AVCodecContext from the stream's codec parameters. |
void | close virtual | Close and free the AVCodecContext and associated resources. |
bool | decode virtual | Decode the given compressed audio packet and emit the decoded samples. |
void | flush virtual | Flush any frames buffered inside the decoder. Call this after the last packet to retrieve all remaining decoded output. |
AudioDecoder
AudioDecoder(AVStream * stream)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
virtual void create()Initialise the AVCodecContext from the stream's codec parameters.
close
virtual
virtual void close()Close and free the AVCodecContext and associated resources.
decode
virtual
virtual bool decode(AVPacket & ipacket)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.
flush
virtual
virtual void flush()Flush any frames buffered inside the decoder. Call this after the last packet to retrieve all remaining decoded output.
