AV module

VideoDecoder

Decodes compressed video packets into raw frames.

VideoDecoder

#include <icy/av/videodecoder.h>

Inherits: VideoContext

Decodes compressed video packets into raw frames.

Public Methods

ReturnNameDescription
VideoDecoderConstruct 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.
voidopen virtualOpen the codec and initialise any required pixel format conversion context.
voidclose virtualClose and free the AVCodecContext and associated resources.
booldecode virtualDecode the given compressed video packet and emit the decoded frame. Input packets must use the raw AVStream time base; time base conversion to microseconds is performed internally.
voidflush virtualFlush any frames buffered inside the decoder. Call repeatedly after the last packet until false is returned.

VideoDecoder

VideoDecoder(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.


open

virtual

virtual void open()

Open the codec and initialise any required pixel format conversion context.


close

virtual

virtual void close()

Close and free the AVCodecContext and associated resources.


decode

virtual

virtual bool decode(AVPacket & ipacket)

Decode the given compressed video packet and emit the decoded frame. Input packets must use the raw AVStream time base; time base conversion to microseconds is performed internally.

Parameters

  • ipacket The compressed video packet to decode.

Returns

True if an output frame was decoded and emitted, false otherwise.


flush

virtual

virtual void flush()

Flush any frames buffered inside the decoder. Call repeatedly after the last packet until false is returned.