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

This class describes decoded video data. More...

#include <VideoFrame.hpp>

Public Member Functions

 VideoFrame (const VideoFrameDesc &ref)
 
 VideoFrame (const Frame &otherFrame)
 
size_t getWidth () const
 
size_t getHeight () const
 
AVPixelFormat getPixelFormat () const
 
VideoFrameDesc desc () const
 
size_t getSize () const
 in bytes/** More...
 
void assign (const unsigned char value)
 Assign the given value to all the data of the picture. More...
 
void assign (const unsigned char *ptrValue)
 Assign the given ptr of data to the data of the picture. 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 allocateAVPicture (const VideoFrameDesc &desc)
 Allocate the image buffer of the frame. More...
 

Friends

class VideoGenerator
 

Additional Inherited Members

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

Detailed Description

This class describes decoded video data.

Definition at line 43 of file VideoFrame.hpp.

Constructor & Destructor Documentation

avtranscoder::VideoFrame::VideoFrame ( const VideoFrameDesc ref)

Definition at line 48 of file VideoFrame.cpp.

References allocateAVPicture().

avtranscoder::VideoFrame::VideoFrame ( const Frame otherFrame)

Definition at line 54 of file VideoFrame.cpp.

Member Function Documentation

void avtranscoder::VideoFrame::allocateAVPicture ( const VideoFrameDesc desc)
private
void avtranscoder::VideoFrame::assign ( const unsigned char  value)

Assign the given value to all the data of the picture.

Definition at line 90 of file VideoFrame.cpp.

References getSize().

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

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

Assign the given ptr of data to the data of the picture.

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

Definition at line 102 of file VideoFrame.cpp.

References avtranscoder::Frame::_frame, avtranscoder::getDescriptionFromErrorCode(), getHeight(), getPixelFormat(), getSize(), and getWidth().

VideoFrameDesc avtranscoder::VideoFrame::desc ( ) const
inline

Definition at line 52 of file VideoFrame.hpp.

size_t avtranscoder::VideoFrame::getHeight ( ) const
inline
AVPixelFormat avtranscoder::VideoFrame::getPixelFormat ( ) const
inline
size_t avtranscoder::VideoFrame::getSize ( ) const

in bytes/**

Definition at line 59 of file VideoFrame.cpp.

References AV_PIX_FMT_NONE, getHeight(), getPixelFormat(), getWidth(), and LOG_WARN.

Referenced by assign().

size_t avtranscoder::VideoFrame::getWidth ( ) const
inline

Friends And Related Function Documentation

friend class VideoGenerator
friend
Note
To allocate new image buffer if needed.
See also
allocateAVPicture

Definition at line 78 of file VideoFrame.hpp.


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