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

#include <AudioReader.hpp>

Public Member Functions

 ~AudioReader ()
 
void updateOutput (const size_t sampleRate, const size_t nbChannels, const std::string &sampleFormat)
 Update sample rate, number of channels and sample format of the output. More...
 
const AudioPropertiesgetSourceAudioProperties () const
 
 AudioReader (const std::string &filename, const size_t streamIndex=0, const int channelIndex=-1)
 
 AudioReader (InputFile &inputFile, const size_t streamIndex=0, const int channelIndex=-1)
 
size_t getOutputSampleRate () const
 
size_t getOutputNbChannels () const
 
AVSampleFormat getOutputSampleFormat () const
 
- Public Member Functions inherited from avtranscoder::IReader
 IReader (const std::string &filename, const size_t streamIndex=0, const int channelIndex=-1)
 Create a new InputFile and prepare to read the stream at the given index. More...
 
 IReader (InputFile &inputFile, const size_t streamIndex=0, const int channelIndex=-1)
 Get the existing InputFile and prepare to read the stream at the given index. More...
 
virtual ~IReader ()=0
 
FramereadNextFrame ()
 
FramereadPrevFrame ()
 
FramereadFrameAt (const size_t frame)
 
const StreamPropertiesgetSourceProperties () const
 Get the properties of the source stream read. More...
 
void continueWithGenerator (const bool continueWithGenerator=true)
 Set the reader state to generate data (ie silence or black) when there is no more data to decode. More...
 

Private Member Functions

void init ()
 

Private Attributes

const AudioProperties_audioStreamProperties
 Properties of the source audio stream read (no ownership, has link) More...
 
size_t _outputSampleRate
 
size_t _outputNbChannels
 
AVSampleFormat _outputSampleFormat
 

Additional Inherited Members

- Protected Attributes inherited from avtranscoder::IReader
InputFile_inputFile
 
const StreamProperties_streamProperties
 
IDecoder_decoder
 
IDecoder_generator
 
IDecoder_currentDecoder
 Link to _inputDecoder or _generator. More...
 
Frame_srcFrame
 
Frame_dstFrame
 
ITransform_transform
 
size_t _streamIndex
 
int _channelIndex
 

Detailed Description

Definition at line 12 of file AudioReader.hpp.

Constructor & Destructor Documentation

avtranscoder::AudioReader::AudioReader ( const std::string &  filename,
const size_t  streamIndex = 0,
const int  channelIndex = -1 
)

Definition at line 13 of file AudioReader.cpp.

References init().

avtranscoder::AudioReader::AudioReader ( InputFile inputFile,
const size_t  streamIndex = 0,
const int  channelIndex = -1 
)

Definition at line 23 of file AudioReader.cpp.

References init().

Member Function Documentation

size_t avtranscoder::AudioReader::getOutputNbChannels ( ) const
inline

Definition at line 33 of file AudioReader.hpp.

AVSampleFormat avtranscoder::AudioReader::getOutputSampleFormat ( ) const
inline

Definition at line 34 of file AudioReader.hpp.

size_t avtranscoder::AudioReader::getOutputSampleRate ( ) const
inline

Definition at line 32 of file AudioReader.hpp.

const AudioProperties* avtranscoder::AudioReader::getSourceAudioProperties ( ) const
inline

Definition at line 38 of file AudioReader.hpp.

void avtranscoder::AudioReader::updateOutput ( const size_t  sampleRate,
const size_t  nbChannels,
const std::string &  sampleFormat 
)

Update sample rate, number of channels and sample format of the output.

Note
Will transform the decoded data when read the stream.

Definition at line 71 of file AudioReader.cpp.

References avtranscoder::IReader::_dstFrame, _outputNbChannels, _outputSampleFormat, _outputSampleRate, and avtranscoder::getAVSampleFormat().

Field Documentation

const AudioProperties* avtranscoder::AudioReader::_audioStreamProperties
private

Properties of the source audio stream read (no ownership, has link)

Definition at line 44 of file AudioReader.hpp.

Referenced by init().

size_t avtranscoder::AudioReader::_outputNbChannels
private

Definition at line 49 of file AudioReader.hpp.

Referenced by init(), and updateOutput().

AVSampleFormat avtranscoder::AudioReader::_outputSampleFormat
private

Definition at line 50 of file AudioReader.hpp.

Referenced by init(), and updateOutput().

size_t avtranscoder::AudioReader::_outputSampleRate
private

Definition at line 48 of file AudioReader.hpp.

Referenced by init(), and updateOutput().


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