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

#include <AudioGenerator.hpp>

Public Member Functions

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

Private Member Functions

AudioGeneratoroperator= (const AudioGenerator &audioGenerator)
 
 AudioGenerator (const AudioGenerator &audioGenerator)
 

Private Attributes

Frame_inputFrame
 Has link (no ownership) More...
 
AudioFrame_silent
 The generated silent (has ownership) More...
 
const AudioFrameDesc _frameDesc
 The description of the silence (sampleRate, channels...) More...
 

Detailed Description

Definition at line 10 of file AudioGenerator.hpp.

Constructor & Destructor Documentation

avtranscoder::AudioGenerator::AudioGenerator ( const AudioGenerator audioGenerator)
private
avtranscoder::AudioGenerator::AudioGenerator ( const AudioFrameDesc frameDesc)

Definition at line 10 of file AudioGenerator.cpp.

avtranscoder::AudioGenerator::~AudioGenerator ( )

Definition at line 17 of file AudioGenerator.cpp.

References _silent.

Member Function Documentation

bool avtranscoder::AudioGenerator::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 22 of file AudioGenerator.cpp.

References _frameDesc, _inputFrame, _silent, avtranscoder::Frame::clear(), avtranscoder::Frame::copyData(), avtranscoder::AudioFrame::desc(), avtranscoder::Frame::getAVFrame(), avtranscoder::AudioFrame::getNbChannels(), avtranscoder::AudioFrame::getNbSamplesPerChannel(), avtranscoder::AudioFrame::getSampleFormat(), avtranscoder::getSampleFormatName(), avtranscoder::AudioFrame::getSampleRate(), avtranscoder::Frame::isAudioFrame(), LOG_DEBUG, LOG_INFO, LOG_WARN, and avtranscoder::AudioFrame::setNbSamplesPerChannel().

Referenced by decodeNextFrame().

bool avtranscoder::AudioGenerator::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 74 of file AudioGenerator.cpp.

References decodeNextFrame().

AudioGenerator& avtranscoder::AudioGenerator::operator= ( const AudioGenerator audioGenerator)
private
void avtranscoder::AudioGenerator::setNextFrame ( Frame inputFrame)
inlinevirtual

Set the next frame of the input stream (which bypass the work of decoding)

Note
Not yet implemented for VideoDecoder and AudioDecoder
Parameters
inputFramethe new next frame

Reimplemented from avtranscoder::IDecoder.

Definition at line 24 of file AudioGenerator.hpp.

Field Documentation

const AudioFrameDesc avtranscoder::AudioGenerator::_frameDesc
private

The description of the silence (sampleRate, channels...)

Definition at line 29 of file AudioGenerator.hpp.

Referenced by decodeNextFrame().

Frame* avtranscoder::AudioGenerator::_inputFrame
private

Has link (no ownership)

Definition at line 27 of file AudioGenerator.hpp.

Referenced by decodeNextFrame().

AudioFrame* avtranscoder::AudioGenerator::_silent
private

The generated silent (has ownership)

Definition at line 28 of file AudioGenerator.hpp.

Referenced by decodeNextFrame(), and ~AudioGenerator().


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