Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

MPGStream Class Reference

#include <MPGStream.hpp>

Inheritance diagram for MPGStream:

Stream List of all members.

Public Methods

 MPGStream (const QString &fname, bool preRead=true, uint numFrames=0)
virtual ~MPGStream ()
GOPaddNextGOP (uint numFrames)
long getFileSize ()
long getAvgFrameSize ()
long getAvgGOPSize ()
uint getHeaderSize ()
bool fillHeaderBuffer ()
char * getHeaderBuffer ()

Private Methods

void parseHeader ()
MPGFramegetNextFrame ()

Private Attributes

MPGFramelastReadFrame
MPGFramelastRefFrame
QByteArray headerBuffer
uint headerSize

Constructor & Destructor Documentation

MPGStream::MPGStream const QString &    fname,
bool    preRead = true,
uint    numFrames = 0
 

Creates a new MPG stream object. If preRead is set, the stream is opened and the whole data structure (incl. GOPs, frames, etc.) is created. The header buffer and all the frame buffers will be EMPTY.

Parameters:
fname  The file name of the MPG stream.
preRead  If set, the whole data structure is created.
numFrames  Determines the number of frames per GOP.

Definition at line 8 of file MPGStream.cpp.

References addNextGOP(), ERR_FILE, Stream::file, Stream::fileSize, Stream::gopList, lastReadFrame, lastRefFrame, Stream::noFrames, and parseHeader().

MPGStream::~MPGStream   [virtual]
 

The destructive part of this class ;-) Derived from Stream.

Definition at line 3 of file MPGStream.cpp.

References Stream::file.


Member Function Documentation

GOP * MPGStream::addNextGOP uint    numFrames [virtual]
 

Adds the next GOP to the GOP list. The methods starts reading from the current file position and adds numFrames frames to the GOP. If numFrames is 0, frames until the next I frame are added to this GOP.

Parameters:
numFrames  Number of frames for this GOP; 0 means add frames until next I_VOP.
Returns :
The newly added GOP.

Implements Stream.

Definition at line 135 of file MPGStream.cpp.

References GOP::addFrame(), B_VOP, GOP::calcByteSize(), Stream::file, GOP::getFrame(), GOP::getFrameCount(), getNextFrame(), Frame::getNoInDisplay(), Frame::getType(), Stream::gopList, I_VOP, MPGGOP::incNoBVOPs(), lastReadFrame, lastRefFrame, nl, Stream::noFrames, Frame::setGOP(), Frame::setNoInDisplay(), and Frame::setNoInGOP().

Referenced by PatGen::init(), and MPGStream().

bool MPGStream::fillHeaderBuffer  
 

Fills the header buffer with the header data.

Returns :
Returns false if an error occured, else true.

Definition at line 62 of file MPGStream.cpp.

References Stream::file, headerBuffer, and headerSize.

long MPGStream::getAvgFrameSize  
 

Returns the average byte size of all frames

Returns :
avg Byte size of all frames.

Definition at line 240 of file MPGStream.cpp.

References Stream::fileSize, and Stream::noFrames.

long MPGStream::getAvgGOPSize  
 

Returns the average byte size of all GOPs. If the GOP size equals the frame rate, this might be read as the needed bandwidth/sec.

Returns :
avg Byte size of all GOPs.

Definition at line 245 of file MPGStream.cpp.

References Stream::fileSize, and Stream::gopList.

long MPGStream::getFileSize   [virtual]
 

Returns the byte size of the stream.

Returns :
Byte size of the stream.

Implements Stream.

Definition at line 235 of file MPGStream.cpp.

References Stream::fileSize.

char * MPGStream::getHeaderBuffer  
 

Returns a char pointer to the header buffer.

Returns :
Pointer to the header buffer.

Definition at line 254 of file MPGStream.cpp.

References headerBuffer.

uint MPGStream::getHeaderSize  
 

Returns the byte size of the header.

Returns :
Byte size of the header.

Definition at line 250 of file MPGStream.cpp.

References headerSize.

MPGFrame * MPGStream::getNextFrame   [private]
 

Reads the next VOP from stream starting at the current file position.

Returns :
The newly read MPGFrame.

Definition at line 84 of file MPGStream.cpp.

References B_VOP, Stream::file, Stream::fileSize, FrameType, I_VOP, lastReadFrame, NN_VOP, Stream::noFrames, P_VOP, Frame::setByteSize(), Frame::setFileOffset(), Frame::setNoInStream(), VOP_START_CODE, and wmsg.

Referenced by addNextGOP().

void MPGStream::parseHeader   [private]
 

Parses the header. For now it's not a real parsing. The method just looks for the first VOP_START_CODE to determine the size of the header.

Definition at line 43 of file MPGStream.cpp.

References Stream::file, headerSize, and VOP_START_CODE.

Referenced by MPGStream().


Member Data Documentation

QByteArray MPGStream::headerBuffer [private]
 

Definition at line 113 of file MPGStream.hpp.

Referenced by fillHeaderBuffer(), and getHeaderBuffer().

uint MPGStream::headerSize [private]
 

Byte size of the header.

Definition at line 118 of file MPGStream.hpp.

Referenced by fillHeaderBuffer(), getHeaderSize(), and parseHeader().

MPGFrame* MPGStream::lastReadFrame [private]
 

Definition at line 111 of file MPGStream.hpp.

Referenced by addNextGOP(), getNextFrame(), and MPGStream().

MPGFrame * MPGStream::lastRefFrame [private]
 

Definition at line 111 of file MPGStream.hpp.

Referenced by addNextGOP(), and MPGStream().


The documentation for this class was generated from the following files:
Generated on Wed Mar 19 11:57:44 2003 for qctva4lv by doxygen1.2.17