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

ReturnNameDescription
AudioDecoderConstruct a decoder for the given stream. The codec parameters are read from the stream's codecpar.
voidcreate virtualInitialise the AVCodecContext from the stream's codec parameters.
voidclose virtualClose and free the AVCodecContext and associated resources.
booldecode virtualDecode the given compressed audio packet and emit the decoded samples.
voidflush virtualFlush 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

  • stream The 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

  • ipacket The 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.