Home
AV module

VideoDecoder

Decodes compressed video packets into raw frames.

VideoDecoder

#include <icy/av/videodecoder.h>
struct VideoDecoder

Defined in src/av/include/icy/av/videodecoder.h:28

Inherits: VideoContext

Decodes compressed video packets into raw frames.

List of all members

NameKindOwner
VideoDecoderfunctionDeclared here
~VideoDecoderfunctionDeclared here
createfunctionDeclared here
openfunctionDeclared here
closefunctionDeclared here
decodefunctionDeclared here
flushfunctionDeclared here
emittervariableInherited from VideoContext
iparamsvariableInherited from VideoContext
oparamsvariableInherited from VideoContext
streamvariableInherited from VideoContext
ctxvariableInherited from VideoContext
codecvariableInherited from VideoContext
framevariableInherited from VideoContext
convvariableInherited from VideoContext
timevariableInherited from VideoContext
ptsvariableInherited from VideoContext
secondsvariableInherited from VideoContext
errorvariableInherited from VideoContext
VideoContextfunctionInherited from VideoContext
~VideoContextfunctionInherited from VideoContext
VideoContextfunctionInherited from VideoContext
operator=functionInherited from VideoContext
VideoContextfunctionInherited from VideoContext
operator=functionInherited from VideoContext
createfunctionInherited from VideoContext
openfunctionInherited from VideoContext
closefunctionInherited from VideoContext
decodefunctionInherited from VideoContext
encodefunctionInherited from VideoContext
encodefunctionInherited from VideoContext
encodefunctionInherited from VideoContext
flushfunctionInherited from VideoContext
convertfunctionInherited from VideoContext
recreateConverterfunctionInherited from VideoContext

Inherited from VideoContext

KindNameDescription
variableemitter
variableiparamsinput parameters
variableoparamsoutput parameters
variablestreamencoder or decoder stream
variablectxencoder or decoder context
variablecodecencoder or decoder codec
variableframeencoder or decoder frame
variableconvvideo conversion context
variabletimestream time in codec time base
variableptslast packet pts value
variablesecondsvideo time in seconds
variableerrorerror message
functionVideoContext
function~VideoContext virtual noexcept
functionVideoContextDeleted constructor.
functionoperator=Deleted assignment operator.
functionVideoContextDeleted constructor.
functionoperator=Deleted assignment operator.
functioncreate virtualInitialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder.
functionopen virtualOpen the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created.
functionclose virtualClose the codec context, free the frame, and reset timestamps.
functiondecode virtualDecode a compressed video packet and emit the resulting frame.
functionencode virtualEncode a buffer of interleaved video data.
functionencode virtualEncode a planar video frame.
functionencode virtualEncode a single AVFrame.
functionflush virtualFlush any frames buffered inside the codec and emit remaining output.
functionconvert virtualConvert the video frame and return the result.
functionrecreateConverter virtualRecreate the VideoConverter if the input or output parameters have changed. Called automatically by open() and convert().

Public Methods

ReturnNameDescription
VideoDecoderConstruct a decoder for the given stream. The codec parameters are read from the stream's codecpar.
voidcreate virtual overrideInitialise the AVCodecContext from the stream's codec parameters.
voidopen virtual overrideOpen the codec and initialise any required pixel format conversion context.
voidclose virtual overrideClose and free the AVCodecContext and associated resources.
booldecode virtual overrideDecode 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 virtual overrideFlush any frames buffered inside the decoder. Call repeatedly after the last packet until false is returned.

VideoDecoder

VideoDecoder(AVStream * stream)

Defined in src/av/include/icy/av/videodecoder.h:33

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 override

virtual void create() override

Defined in src/av/include/icy/av/videodecoder.h:37

Initialise the AVCodecContext from the stream's codec parameters.

Reimplements

open

virtual override

virtual void open() override

Defined in src/av/include/icy/av/videodecoder.h:40

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

Reimplements

close

virtual override

virtual void close() override

Defined in src/av/include/icy/av/videodecoder.h:43

Close and free the AVCodecContext and associated resources.

Reimplements

decode

virtual override

virtual bool decode(AVPacket & ipacket) override

Defined in src/av/include/icy/av/videodecoder.h:50

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.

Reimplements

flush

virtual override

virtual void flush() override

Defined in src/av/include/icy/av/videodecoder.h:54

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

Reimplements