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

This class describes coded data. More...

#include <CodedData.hpp>

Public Member Functions

 CodedData ()
 Create an empty data buffer. More...
 
 CodedData (const size_t dataSize)
 Create a data buffer with a the given size. More...
 
 CodedData (const AVPacket &avPacket)
 Create a data buffer from the given AVPAcket (copy data of given packet) More...
 
 CodedData (const CodedData &other)
 Override copy constructor in order to copy AVPacket data. More...
 
CodedDataoperator= (const CodedData &other)
 Override operator = in order to copy AVPacket data. More...
 
 ~CodedData ()
 Free buffer of data. More...
 
void refAVStream (const AVStream &avStream)
 
void resize (const size_t newSize)
 Resize data buffer. More...
 
void copyData (unsigned char *buffer, const size_t size)
 Copy external data buffer. More...
 
void assign (const size_t size, const int value)
 Resize the buffer with the given size, and copy the given value. More...
 
void clear ()
 Clear existing data and set size to 0. More...
 
unsigned char * getData ()
 
const unsigned char * getData () const
 
size_t getSize () const
 
const AVStream * getAVStream () const
 
AVPacket & getAVPacket ()
 
const AVPacket & getAVPacket () const
 
void refData (CodedData &frame)
 
void refData (unsigned char *buffer, const size_t size)
 

Private Member Functions

void initAVPacket ()
 
void copyAVPacket (const AVPacket &avPacket)
 

Private Attributes

AVPacket _packet
 
const AVStream * _avStream
 

Detailed Description

This class describes coded data.

Definition at line 18 of file CodedData.hpp.

Constructor & Destructor Documentation

avtranscoder::CodedData::CodedData ( )

Create an empty data buffer.

Definition at line 8 of file CodedData.cpp.

References initAVPacket().

avtranscoder::CodedData::CodedData ( const size_t  dataSize)

Create a data buffer with a the given size.

Definition at line 14 of file CodedData.cpp.

References _packet.

avtranscoder::CodedData::CodedData ( const AVPacket &  avPacket)

Create a data buffer from the given AVPAcket (copy data of given packet)

Definition at line 20 of file CodedData.cpp.

References copyAVPacket().

avtranscoder::CodedData::CodedData ( const CodedData other)

Override copy constructor in order to copy AVPacket data.

Definition at line 26 of file CodedData.cpp.

References _avStream, copyAVPacket(), getAVPacket(), and getAVStream().

avtranscoder::CodedData::~CodedData ( )

Free buffer of data.

Definition at line 39 of file CodedData.cpp.

References _packet.

Member Function Documentation

void avtranscoder::CodedData::assign ( const size_t  size,
const int  value 
)

Resize the buffer with the given size, and copy the given value.

Note
Use this function to check if we can modify the buffer

Definition at line 77 of file CodedData.cpp.

References _packet, and resize().

void avtranscoder::CodedData::clear ( )

Clear existing data and set size to 0.

Definition at line 71 of file CodedData.cpp.

References _packet, and initAVPacket().

Referenced by avtranscoder::AudioDecoder::decodeNextFrame(), avtranscoder::VideoDecoder::decodeNextFrame(), and avtranscoder::InputFile::readNextPacket().

void avtranscoder::CodedData::copyAVPacket ( const AVPacket &  avPacket)
private

Definition at line 90 of file CodedData.cpp.

References _packet, copyData(), and initAVPacket().

Referenced by CodedData(), and operator=().

void avtranscoder::CodedData::copyData ( unsigned char *  buffer,
const size_t  size 
)

Copy external data buffer.

Definition at line 58 of file CodedData.cpp.

References _packet, and resize().

Referenced by copyAVPacket(), and avtranscoder::InputStream::readNextPacket().

const AVPacket& avtranscoder::CodedData::getAVPacket ( ) const
inline

Definition at line 79 of file CodedData.hpp.

const AVStream* avtranscoder::CodedData::getAVStream ( ) const
inline
Returns
the AVStream which contains the packet
Note
may be NULL in case of generated packets

Definition at line 77 of file CodedData.hpp.

Referenced by CodedData(), operator=(), and avtranscoder::OutputFile::wrap().

unsigned char* avtranscoder::CodedData::getData ( )
inline

Definition at line 65 of file CodedData.hpp.

Referenced by refData(), and avtranscoder::OutputFile::wrap().

const unsigned char* avtranscoder::CodedData::getData ( ) const
inline

Definition at line 67 of file CodedData.hpp.

size_t avtranscoder::CodedData::getSize ( ) const
inline
void avtranscoder::CodedData::initAVPacket ( )
private

Definition at line 83 of file CodedData.cpp.

References _packet.

Referenced by clear(), CodedData(), and copyAVPacket().

CodedData & avtranscoder::CodedData::operator= ( const CodedData other)

Override operator = in order to copy AVPacket data.

Definition at line 32 of file CodedData.cpp.

References _avStream, copyAVPacket(), getAVPacket(), and getAVStream().

void avtranscoder::CodedData::refAVStream ( const AVStream &  avStream)
inline

Definition at line 42 of file CodedData.hpp.

Referenced by avtranscoder::InputFile::readNextPacket().

void avtranscoder::CodedData::refData ( CodedData frame)

Ref to external data buffer

Definition at line 65 of file CodedData.cpp.

References _packet, getData(), and getSize().

void avtranscoder::CodedData::refData ( unsigned char *  buffer,
const size_t  size 
)

Definition at line 52 of file CodedData.cpp.

References _packet.

void avtranscoder::CodedData::resize ( const size_t  newSize)

Resize data buffer.

Definition at line 44 of file CodedData.cpp.

References _packet.

Referenced by assign(), and copyData().

Field Documentation

const AVStream* avtranscoder::CodedData::_avStream
private

Definition at line 90 of file CodedData.hpp.

Referenced by CodedData(), and operator=().

AVPacket avtranscoder::CodedData::_packet
private

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