AvTranscoder
0.9.4
C++APIforLibav/FFmpeg
|
#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... | |
![]() | |
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 |
Definition at line 11 of file VideoDecoder.hpp.
avtranscoder::VideoDecoder::VideoDecoder | ( | InputStream & | inputStream | ) |
Definition at line 19 of file VideoDecoder.cpp.
avtranscoder::VideoDecoder::~VideoDecoder | ( | ) |
Definition at line 25 of file VideoDecoder.cpp.
|
virtual |
Decode next frame.
frameBuffer | the 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. |
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().
|
virtual |
Decode substream of next frame.
frameBuffer | the frame decoded |
channelIndex | index of channel to extract |
Implements avtranscoder::IDecoder.
Definition at line 117 of file VideoDecoder.cpp.
|
virtual |
Reset the internal decoder state / flush internal buffers.
Reimplemented from avtranscoder::IDecoder.
Definition at line 122 of file VideoDecoder.cpp.
References _inputStream, avtranscoder::ICodec::getAVCodecContext(), and avtranscoder::InputStream::getVideoCodec().
|
virtual |
Setup the decoder.
profile | set decoder parameters from the given profile |
Reimplemented from avtranscoder::IDecoder.
Definition at line 29 of file VideoDecoder.cpp.
References _inputStream, _isSetup, avtranscoder::constants::avProfileIdentificator, avtranscoder::constants::avProfileIdentificatorHuman, avtranscoder::constants::avProfileThreads, avtranscoder::constants::avProfileType, avtranscoder::ProfileLoader::checkVideoProfile(), avtranscoder::ICodec::getAVCodecContext(), avtranscoder::ICodec::getOption(), avtranscoder::InputStream::getVideoCodec(), LOG_ERROR, LOG_INFO, LOG_WARN, avtranscoder::ICodec::openCodec(), avtranscoder::Option::setInt(), and avtranscoder::Option::setString().
Referenced by decodeNextFrame().
|
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().
|
private |
Definition at line 27 of file VideoDecoder.hpp.
Referenced by decodeNextFrame(), and setupDecoder().