AvTranscoder  0.9.4
C++APIforLibav/FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
avtranscoder::VideoDecoder Class Reference

#include <VideoDecoder.hpp>

Public Member Functions

 VideoDecoder (InputStream &inputStream)
 
 ~VideoDecoder ()
 
void setupDecoder (const ProfileLoader::Profile &profile=ProfileLoader::Profile())
 Setup the decoder. More...
 
bool decodeNextFrame (Frame &frameBuffer)
 Decode next frame. More...
 
bool decodeNextFrame (Frame &frameBuffer, const size_t subStreamIndex)
 Decode substream of next frame. More...
 
void flushDecoder ()
 Reset the internal decoder state / flush internal buffers. More...
 
- Public Member Functions inherited from avtranscoder::IDecoder
virtual ~IDecoder ()
 
virtual void setNextFrame (Frame &inputFrame)
 Set the next frame of the input stream (which bypass the work of decoding) More...
 

Private Attributes

InputStream_inputStream
 Stream from which we read next frames (no ownership, has link) More...
 
bool _isSetup
 

Detailed Description

Definition at line 11 of file VideoDecoder.hpp.

Constructor & Destructor Documentation

avtranscoder::VideoDecoder::VideoDecoder ( InputStream inputStream)

Definition at line 19 of file VideoDecoder.cpp.

avtranscoder::VideoDecoder::~VideoDecoder ( )

Definition at line 25 of file VideoDecoder.cpp.

Member Function Documentation

bool avtranscoder::VideoDecoder::decodeNextFrame ( Frame frameBuffer)
virtual

Decode next frame.

Parameters
frameBufferthe frame decoded the frameBuffer reference belongs to the decoder and is valid only until the next call to this function or until closing or flushing the decoder. The caller may not write to it.
Returns
status of decoding

Implements avtranscoder::IDecoder.

Definition at line 76 of file VideoDecoder.cpp.

References _inputStream, _isSetup, avtranscoder::CodedData::clear(), avtranscoder::ICodec::getAVCodecContext(), avtranscoder::Frame::getAVFrame(), avtranscoder::CodedData::getAVPacket(), avtranscoder::getDescriptionFromErrorCode(), avtranscoder::InputStream::getVideoCodec(), avtranscoder::InputStream::readNextPacket(), and setupDecoder().

bool avtranscoder::VideoDecoder::decodeNextFrame ( Frame frameBuffer,
const size_t  channelIndex 
)
virtual

Decode substream of next frame.

Parameters
frameBufferthe frame decoded
channelIndexindex of channel to extract
Returns
status of decoding

Implements avtranscoder::IDecoder.

Definition at line 117 of file VideoDecoder.cpp.

void avtranscoder::VideoDecoder::flushDecoder ( )
virtual

Reset the internal decoder state / flush internal buffers.

Note
Should be called when seeking or when switching to a different stream.
Not sense for generators.

Reimplemented from avtranscoder::IDecoder.

Definition at line 122 of file VideoDecoder.cpp.

References _inputStream, avtranscoder::ICodec::getAVCodecContext(), and avtranscoder::InputStream::getVideoCodec().

Field Documentation

InputStream* avtranscoder::VideoDecoder::_inputStream
private

Stream from which we read next frames (no ownership, has link)

Definition at line 25 of file VideoDecoder.hpp.

Referenced by decodeNextFrame(), flushDecoder(), and setupDecoder().

bool avtranscoder::VideoDecoder::_isSetup
private

Definition at line 27 of file VideoDecoder.hpp.

Referenced by decodeNextFrame(), and setupDecoder().


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