Frame Class Reference

<class description="" goes="" here=""> <short description=""> More...

#include <Frame.hpp>

Inheritance diagram for Frame:

AudioFrame VideoFrame CompressedAudioFrame UncompressedAudioFrame CompressedVideoFrame UncompressedVideoFrame List of all members.

Public Types

enum  FrameType {
  I_VOP, P_VOP, B_VOP, S_VOP,
  NN_VOP, YUV_VOP, RGB_VOP, MP3_AUDIO,
  AAC_AUDIO, RAW_AUDIO, VORBIS_AUDIO, HEADER_VOP,
  ERROR_VOP, UNKNOWN_VOP
}

Public Member Functions

 Frame (FrameType t)
 Constructor with type -----------.
void setType (FrameType t)
FrameType getType () const
u32 getMediaTimeScale () const
 returns the timescale of the stream measured in ticks/second
void setMediaTimeScale (u32 uiMediaTimeScale)
 set the mediaTimeScale
bool setAU (AU *au, bool detectType=true)
 fills the buffer with an AU.
bool unsetAU ()
 removes the previously set AU, so it will not be freed in Frame destructor.
AU * getAU () const
void setAUy (u8 *y)
void setAUu (u8 *u)
void setAUv (u8 *v)
void setCodecID (u32 id)
u32 getCodecID ()
void setStreamID (u32 id)
u32 getStreamID ()
void markForDelete (bool yes=true)
bool isMarkedForDelete ()
virtual FrameType detectFrameType ()
 Determines the correctness of the buffer and extracts the frametype of the frame On any problem: FrameType ERROR_VOP is returned.

Static Public Member Functions

const char * VOPTypeToChar (VOP_TYPE t)

Public Attributes

typedef VOP_TYPE

Protected Attributes

AU * accessUnit
u32 codecID
u32 streamID
u32 mediaTimeScale
bool markedForDelete

Detailed Description

<class description="" goes="" here=""> <short description="">

Author:
Michael Kropfberger and Peter Schojer
Version:
Id
Frame.hpp,v 1.11 2006/03/01 14:34:33 tkuglits Exp

Definition at line 63 of file Frame.hpp.


Member Function Documentation

bool Frame::setAU AU *  au,
bool  detectType = true
 

fills the buffer with an AU.

au != NULL must be true. Problem: calling resize on the buffer, is not advised.Definition at line 87 of file Frame.cpp.

References detectFrameType().

Referenced by VorbisEncoder::adapt(), TheoraEncoder::adapt(), PSNR::adapt(), MP4Encoder::adapt(), MP4Decoder::adapt(), MP4audioDecoder::adapt(), MP3Encoder::adapt(), MadMP3Decoder::adapt(), DataDump::adapt(), MP4Decoder::close(), MP3Encoder::close(), YUVStreamIO::getFrame(), VITMuxDemuxIO::getFrame(), Rtp::getFrame(), RawStreamIO::getFrame(), MPGStreamIO::getFrame(), DVDIO::getFrame(), BufferedMPGStreamReader::getFrame(), BufferedHttpMPGStreamReader::getFrame(), and MuxDemuxIO::processReadFrame().

00087 { 00088 if (!auTemp) 00089 return false; 00090 if (accessUnit) 00091 delete accessUnit; 00092 00093 accessUnit = auTemp; 00094 00095 00096 //default YUV pointers into payload, on WINCE will be overridden by setAUy/u/v() 00097 accessUnit->y = accessUnit->payload; 00098 accessUnit->u = accessUnit->payload; //FIXME: not known: + width+height 00099 accessUnit->v = accessUnit->payload; //FIXME: not known: + width+height *1.25 00100 00101 00102 if (detectType) 00103 detectFrameType(); 00104 00105 return true; 00106 }

bool Frame::unsetAU  ) 
 

removes the previously set AU, so it will not be freed in Frame destructor.

You must delete the AU outside the class, otherwise you'll have a massive memory leak!Definition at line 109 of file Frame.cpp.

Referenced by PSNR::adapt(), DataDump::adapt(), YUVStreamIO::getFrame(), and MuxDemuxIO::processReadFrame().

00109 { 00110 if (!accessUnit) 00111 return false; 00112 00113 accessUnit = NULL; 00114 return true; 00115 }


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