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

#include <AudioDecoder.hpp>

Public Member Functions

 AudioDecoder (InputStream &inputStream)
 
 ~AudioDecoder ()
 
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 channelIndex)
 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 AudioDecoder.hpp.

Constructor & Destructor Documentation

avtranscoder::AudioDecoder::AudioDecoder ( InputStream inputStream)

Definition at line 21 of file AudioDecoder.cpp.

avtranscoder::AudioDecoder::~AudioDecoder ( )

Definition at line 27 of file AudioDecoder.cpp.

Member Function Documentation

bool avtranscoder::AudioDecoder::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 78 of file AudioDecoder.cpp.

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

Referenced by decodeNextFrame().

bool avtranscoder::AudioDecoder::decodeNextFrame ( Frame frameBuffer,
const size_t  channelIndex 
)
virtual
void avtranscoder::AudioDecoder::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 175 of file AudioDecoder.cpp.

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

Field Documentation

InputStream* avtranscoder::AudioDecoder::_inputStream
private

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

Definition at line 25 of file AudioDecoder.hpp.

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

bool avtranscoder::AudioDecoder::_isSetup
private

Definition at line 27 of file AudioDecoder.hpp.

Referenced by decodeNextFrame(), and setupDecoder().


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