Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::ffmpeg::Decoder Class Reference

RAII wrapper around an AVCodecContext set up for decoding. More...

#include <inviwo/ffmpeg/wrap/decoder.h>

+ Inheritance diagram for inviwo::ffmpeg::Decoder:

Public Member Functions

CodecID codecID () const
 
 Decoder (const AVStream *stream)
 Create and open a decoder matching the codec parameters of stream.
 
 Decoder (const Decoder &)=delete
 
 Decoder (Decoder &&)=delete
 
void flush () const
 
int height () const
 
Decoderoperator= (const Decoder &)=delete
 
Decoderoperator= (Decoder &&)=delete
 
enum AVPixelFormat pixelFormat () const
 
int receiveFrame (Frame &frame) const
 Retrieve the next decoded frame.
 
void reset () const
 Discard any buffered state, must be called after seeking.
 
void sendPacket (const Packet &pkt) const
 
int width () const
 

Public Attributes

AVCodecContext * ctx
 

Detailed Description

RAII wrapper around an AVCodecContext set up for decoding.

See also
Encoder for the encoding counterpart

Constructor & Destructor Documentation

◆ Decoder()

inviwo::ffmpeg::Decoder::Decoder ( const AVStream * stream)
explicit

Create and open a decoder matching the codec parameters of stream.

Exceptions
Exceptionif no decoder is available for the codec or if it cannot be opened

Member Function Documentation

◆ flush()

void inviwo::ffmpeg::Decoder::flush ( ) const

Signal end of stream to the decoder, any remaining frames can then be collected with receiveFrame()

◆ receiveFrame()

int inviwo::ffmpeg::Decoder::receiveFrame ( Frame & frame) const

Retrieve the next decoded frame.

Returns
0 on success, AVERROR(EAGAIN) if more packets are needed, AVERROR_EOF if the decoder has been fully drained

The documentation for this class was generated from the following file: