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

This class describes decoded audio data. More...

#include <AudioFrame.hpp>

Public Member Functions

 AudioFrame (const AudioFrameDesc &ref)
 
 AudioFrame (const Frame &otherFrame)
 
size_t getSampleRate () const
 
size_t getNbChannels () const
 
size_t getChannelLayout () const
 
AVSampleFormat getSampleFormat () const
 
size_t getNbSamplesPerChannel () const
 
AudioFrameDesc desc () const
 
size_t getSize () const
 in bytes More...
 
void setNbSamplesPerChannel (const size_t nbSamples)
 
void assign (const unsigned char value)
 Assign the given value to all the data of the audio frame. More...
 
void assign (const unsigned char *ptrValue)
 Assign the given ptr of data to the data of the audio frame. More...
 
- Public Member Functions inherited from avtranscoder::Frame
 Frame ()
 Allocate an empty frame. This only allocates the AVFrame itself, not the data buffers. More...
 
 Frame (const Frame &otherFrame)
 Copy properties and reference data of the other frame. More...
 
virtual ~Frame ()
 
unsigned char ** getData ()
 Get all the data of the frame. More...
 
int * getLineSize () const
 Returns the size in byte. For video, size in bytes of each picture line. For audio, size in bytes of each plane. More...
 
int getEncodedSize () const
 
void copyData (const Frame &frameToRef)
 Copy the data of the given Frame. More...
 
void copyProperties (const Frame &otherFrame)
 Copy all the fields that do not affect the data layout in the buffers. More...
 
void refFrame (const Frame &otherFrame)
 Copy frame properties and create a new reference to data of the given frame. More...
 
void clear ()
 Unreference all the buffers referenced by frame and reset the frame fields. More...
 
bool isAudioFrame () const
 
bool isVideoFrame () const
 
AVFrame & getAVFrame ()
 
const AVFrame & getAVFrame () const
 
const unsigned char ** getData () const
 

Private Member Functions

void allocateAVSample (const AudioFrameDesc &ref)
 Allocate the audio buffer of the frame. More...
 

Friends

class AudioGenerator
 

Additional Inherited Members

- Protected Attributes inherited from avtranscoder::Frame
AVFrame * _frame
 

Detailed Description

This class describes decoded audio data.

Definition at line 36 of file AudioFrame.hpp.

Constructor & Destructor Documentation

avtranscoder::AudioFrame::AudioFrame ( const AudioFrameDesc ref)
Note
Allocated data will be initialized to silence.

Definition at line 42 of file AudioFrame.cpp.

References allocateAVSample().

avtranscoder::AudioFrame::AudioFrame ( const Frame otherFrame)

Definition at line 48 of file AudioFrame.cpp.

Member Function Documentation

void avtranscoder::AudioFrame::allocateAVSample ( const AudioFrameDesc ref)
private
void avtranscoder::AudioFrame::assign ( const unsigned char  value)

Assign the given value to all the data of the audio frame.

Definition at line 100 of file AudioFrame.cpp.

References getSize().

void avtranscoder::AudioFrame::assign ( const unsigned char *  ptrValue)

Assign the given ptr of data to the data of the audio frame.

Warning
the given ptr should have the size of the audio frame..
See also
getSize

Definition at line 112 of file AudioFrame.cpp.

References avtranscoder::Frame::_frame, avtranscoder::getDescriptionFromErrorCode(), getNbChannels(), getNbSamplesPerChannel(), and getSampleFormat().

AudioFrameDesc avtranscoder::AudioFrame::desc ( ) const
inline

Definition at line 50 of file AudioFrame.hpp.

Referenced by avtranscoder::AudioGenerator::decodeNextFrame().

size_t avtranscoder::AudioFrame::getChannelLayout ( ) const
inline

Definition at line 47 of file AudioFrame.hpp.

Referenced by avtranscoder::FilterGraph::pushInBuffer().

size_t avtranscoder::AudioFrame::getNbChannels ( ) const
inline
size_t avtranscoder::AudioFrame::getNbSamplesPerChannel ( ) const
inline
AVSampleFormat avtranscoder::AudioFrame::getSampleFormat ( ) const
inline
size_t avtranscoder::AudioFrame::getSampleRate ( ) const
inline
size_t avtranscoder::AudioFrame::getSize ( ) const

in bytes

Definition at line 53 of file AudioFrame.cpp.

References getNbChannels(), getNbSamplesPerChannel(), getSampleFormat(), and LOG_WARN.

Referenced by assign().

void avtranscoder::AudioFrame::setNbSamplesPerChannel ( const size_t  nbSamples)
inline

Friends And Related Function Documentation

friend class AudioGenerator
friend
Note
To allocate new audio buffer if needed.
See also
allocateAVSample

Definition at line 78 of file AudioFrame.hpp.


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