AVIFile Class Reference

base class for all AVI type files More...

#include <avi.h>

Inheritance diagram for AVIFile:

AVI1File AVI2File List of all members.

Public Member Functions

 AVIFile ()
 The constructor.
 AVIFile (const AVIFile &)
 The copy constructor.
virtual ~AVIFile ()
 The destructor.
virtual AVIFileoperator= (const AVIFile &)
 The assignment operator.
virtual void Init (int format, int sampleFrequency, int indexType)
 Initialize the AVI structure to its initial state, either for PAL or NTSC format.
virtual int GetDVFrameInfo (off_t &offset, int &size, int frameNum)
 Find position and size of a given frame in the file.
virtual int GetFrameInfo (off_t &offset, int &size, int frameNum, FOURCC chunkID)
 Find position and size of a given frame in the file.
virtual int GetDVFrame (Frame &frame, int frameNum)
 Read in a frame.
virtual int getFrame (void *data, int frameNum, FOURCC chunkID)
 Read in a frame.
virtual int GetTotalFrames () const
virtual void PrintDirectoryEntryData (const RIFFDirEntry &entry) const
 prints out a directory entry in text form
virtual bool WriteFrame (const Frame &frame)
virtual void ParseList (int parent)
 If this is not a movi list, read its contents.
virtual void ParseRIFF (void)
virtual void ReadIndex (void)
virtual void WriteRIFF (void)
virtual void FlushIndx (int stream)
virtual void UpdateIndx (int stream, int chunk, int duration)
virtual void UpdateIdx1 (int chunk, int flags)
virtual bool verifyStreamFormat (FOURCC type)
virtual bool verifyStream (FOURCC type)
virtual bool isOpenDML (void)
virtual void setDVINFO (DVINFO &)
virtual void setFccHandler (FOURCC type, FOURCC handler)
virtual bool getStreamFormat (void *data, FOURCC type)

Protected Attributes

MainAVIHeader mainHdr
AVISimpleIndex * idx1
int file_list
int riff_list
int hdrl_list
int avih_chunk
int movi_list
int junk_chunk
int idx1_chunk
AVIStreamHeader streamHdr [2]
AVISuperIndex * indx [2]
AVIStdIndex * ix [2]
int indx_chunk [2]
int ix_chunk [2]
int strl_list [2]
int strh_chunk [2]
int strf_chunk [2]
int index_type
int current_ix00
DWORD dmlh [62]
int odml_list
int dmlh_chunk
bool isUpdateIdx1

Detailed Description

base class for all AVI type files

It contains methods and members which are the same in all AVI type files regardless of the particular compression, number of streams etc.

The AVIFile class also contains methods for handling several indexes to the video frame content.


Constructor & Destructor Documentation

AVIFile::AVIFile (  ) 

The constructor.

Todo:
mainHdr not initialized

add checking for NULL pointers

AVIFile::AVIFile ( const AVIFile avi  ) 

The copy constructor.

Todo:
add checking for NULL pointers

AVIFile::~AVIFile (  )  [virtual]

The destructor.


Member Function Documentation

void AVIFile::FlushIndx ( int  stream  )  [virtual]

int AVIFile::GetDVFrame ( Frame frame,
int  frameNum 
) [virtual]

Read in a frame.

Todo:
we actually don't need the frame here, we could use just a void pointer
Parameters:
frame a reference to the frame object that will receive the frame data
frameNum the frame number to read
Returns:
0 if the frame could be read, -1 otherwise

int AVIFile::GetDVFrameInfo ( off_t &  offset,
int &  size,
int  frameNum 
) [virtual]

Find position and size of a given frame in the file.

Depending on which index is available, search one of them to find position and frame size

Todo:
the size parameter is redundant. All frames have the same size, which is also in the mainHdr.

all index related operations should be isolated

Parameters:
offset the file offset to the start of the frame
size the size of the frame
frameNum the number of the frame we wish to find
Returns:
0 if the frame could be found, -1 otherwise

int AVIFile::getFrame ( void *  data,
int  frameNum,
FOURCC  chunkID 
) [virtual]

Read in a frame.

Parameters:
data a pointer to the audio buffer
frameNum the frame number to read
chunkID the ID of the type of chunk we want
Returns:
the size the of the frame data, 0 if could not be read

int AVIFile::GetFrameInfo ( off_t &  offset,
int &  size,
int  frameNum,
FOURCC  chunkID 
) [virtual]

Find position and size of a given frame in the file.

Depending on which index is available, search one of them to find position and frame size

Todo:
the size parameter is redundant. All frames have the same size, which is also in the mainHdr.

all index related operations should be isolated

Parameters:
offset the file offset to the start of the frame
size the size of the frame
frameNum the number of the frame we wish to find
chunkID the ID of the type of chunk we want
Returns:
0 if the frame could be found, -1 otherwise

bool AVIFile::getStreamFormat ( void *  data,
FOURCC  type 
) [virtual]

int AVIFile::GetTotalFrames (  )  const [virtual]

void AVIFile::Init ( int  format,
int  sampleFrequency,
int  indexType 
) [virtual]

Initialize the AVI structure to its initial state, either for PAL or NTSC format.

Initialize the AVIFile attributes: mainHdr, indx, ix00, idx1

Todo:
consolidate AVIFile::Init, AVI1File::Init, AVI2File::Init. They are somewhat redundant.
Parameters:
format pass AVI_PAL or AVI_NTSC
sampleFrequency the sample frequency of the audio content
indexType pass AVI_SMALL_INDEX or AVI_LARGE_INDEX

Reimplemented in AVI1File, and AVI2File.

bool AVIFile::isOpenDML ( void   )  [virtual]

AVIFile & AVIFile::operator= ( const AVIFile  )  [virtual]

The assignment operator.

void AVIFile::ParseList ( int  parent  )  [virtual]

If this is not a movi list, read its contents.

void AVIFile::ParseRIFF ( void   )  [virtual]

void AVIFile::PrintDirectoryEntryData ( const RIFFDirEntry &  entry  )  const [virtual]

prints out a directory entry in text form

Every subclass of RIFFFile is supposed to override this function and to implement it for the entry types it knows about. For all other entry types it should call its parent::PrintDirectoryData.

Todo:
use 64 bit routines
Parameters:
entry the entry to print

void AVIFile::ReadIndex ( void   )  [virtual]

virtual void AVIFile::setDVINFO ( DVINFO &   )  [inline, virtual]

Reimplemented in AVI1File, and AVI2File.

void AVIFile::setFccHandler ( FOURCC  type,
FOURCC  handler 
) [virtual]

void AVIFile::UpdateIdx1 ( int  chunk,
int  flags 
) [virtual]

void AVIFile::UpdateIndx ( int  stream,
int  chunk,
int  duration 
) [virtual]

bool AVIFile::verifyStream ( FOURCC  type  )  [virtual]

bool AVIFile::verifyStreamFormat ( FOURCC  type  )  [virtual]

virtual bool AVIFile::WriteFrame ( const Frame frame  )  [inline, virtual]

Reimplemented in AVI1File, and AVI2File.

virtual void AVIFile::WriteRIFF ( void   )  [inline, virtual]

Reimplemented in AVI1File, and AVI2File.


Member Data Documentation

int AVIFile::avih_chunk [protected]

int AVIFile::current_ix00 [protected]

DWORD AVIFile::dmlh[62] [protected]

int AVIFile::dmlh_chunk [protected]

int AVIFile::file_list [protected]

int AVIFile::hdrl_list [protected]

AVISimpleIndex* AVIFile::idx1 [protected]

int AVIFile::idx1_chunk [protected]

int AVIFile::index_type [protected]

AVISuperIndex* AVIFile::indx[2] [protected]

int AVIFile::indx_chunk[2] [protected]

bool AVIFile::isUpdateIdx1 [protected]

AVIStdIndex* AVIFile::ix[2] [protected]

int AVIFile::ix_chunk[2] [protected]

int AVIFile::junk_chunk [protected]

MainAVIHeader AVIFile::mainHdr [protected]

int AVIFile::movi_list [protected]

int AVIFile::odml_list [protected]

int AVIFile::riff_list [protected]

AVIStreamHeader AVIFile::streamHdr[2] [protected]

int AVIFile::strf_chunk[2] [protected]

int AVIFile::strh_chunk[2] [protected]

int AVIFile::strl_list[2] [protected]


The documentation for this class was generated from the following files:
Generated on Tue Jan 22 17:07:31 2008 for MUAN by  doxygen 1.4.7