Valkka  1.6.1
OpenSource Video Management
Public Member Functions | Protected Attributes | List of all members
VideoDecoder Class Reference

Video decoder using FFmpeg/libav. More...

#include <decoder.h>

Inheritance diagram for VideoDecoder:
Inheritance graph
[legend]
Collaboration diagram for VideoDecoder:
Collaboration graph
[legend]

Public Member Functions

 VideoDecoder (AVCodecID av_codec_id, int n_threads=1)
 Default constructor.
 
virtual ~VideoDecoder ()
 Default destructor.
 
virtual Frameoutput ()
 Return a reference to the internal storage of the decoder where the decoded frame is.
 
virtual bool pull ()
 Decode in_frame to out_frame. Return true if decoder returned a new frame (into out_frame), otherwise false. Implementation depends on the decoder library.
 
- Public Member Functions inherited from AVDecoder
 AVDecoder (AVCodecID av_codec_id, int n_threads=1)
 Default constructor. More...
 
virtual void flush ()
 Reset decoder state. How to flush depends on the decoder library.
 
- Public Member Functions inherited from Decoder
 Decoder ()
 Default constructor.
 
virtual ~Decoder ()
 Default destructor.
 
void input (Frame *f)
 Create a copy of the frame into the internal storage of the decoder (i.e. to Decoder::in_frame)
 
long int getMsTimestamp ()
 
virtual void releaseOutput ()
 Decoder might want to know that it's ok to overwrite the frame.
 
virtual bool isOk ()
 The thread that uses this decoder can check if it has gone sour.
 
bool hasFrame ()
 

Protected Attributes

AVBitmapFrame out_frame
 
int width
 
int height
 
AVFrame * aux_av_frame
 
AVPixelFormat current_pixel_format
 
SwsContext * sws_ctx
 
float secs_per_frame
 
- Protected Attributes inherited from AVDecoder
int n_threads
 
- Protected Attributes inherited from Decoder
BasicFrame in_frame
 Payload data to be decoded.
 
bool has_frame
 

Additional Inherited Members

- Public Attributes inherited from AVDecoder
AVCodecID av_codec_id
 FFmpeg AVCodecId, identifying the codec.
 
AVPacket * av_packet
 FFmpeg internal data structure; encoded frame (say, H264)
 
AVCodecContext * av_codec_context
 FFmpeg internal data structure.
 
AVCodec * av_codec
 FFmpeg internal data structure.
 

Detailed Description

Video decoder using FFmpeg/libav.

Decode video with FFmpeg, place decoded data to out_frame. VideoDecoder.out_frame's Frame.frametype is set to FrameType::avframe, i.e. the consumer of this frame must immediately copy the data.

See also Code walkthrough: rendering


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