#include <MPGStream.hpp>
Inheritance diagram for MPGStream:
Public Methods | |
MPGStream (const QString &fname, bool preRead=true, uint numFrames=0) | |
virtual | ~MPGStream () |
GOP * | addNextGOP (uint numFrames) |
long | getFileSize () |
long | getAvgFrameSize () |
long | getAvgGOPSize () |
uint | getHeaderSize () |
bool | fillHeaderBuffer () |
char * | getHeaderBuffer () |
Private Methods | |
void | parseHeader () |
MPGFrame * | getNextFrame () |
Private Attributes | |
MPGFrame * | lastReadFrame |
MPGFrame * | lastRefFrame |
QByteArray | headerBuffer |
uint | headerSize |
|
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.
Definition at line 8 of file MPGStream.cpp. References addNextGOP(), ERR_FILE, Stream::file, Stream::fileSize, Stream::gopList, lastReadFrame, lastRefFrame, Stream::noFrames, and parseHeader(). |
|
The destructive part of this class ;-) Derived from Stream. Definition at line 3 of file MPGStream.cpp. References Stream::file. |
|
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.
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(). |
|
Fills the header buffer with the header data.
Definition at line 62 of file MPGStream.cpp. References Stream::file, headerBuffer, and headerSize. |
|
Returns the average byte size of all frames
Definition at line 240 of file MPGStream.cpp. References Stream::fileSize, and Stream::noFrames. |
|
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.
Definition at line 245 of file MPGStream.cpp. References Stream::fileSize, and Stream::gopList. |
|
Returns the byte size of the stream.
Implements Stream. Definition at line 235 of file MPGStream.cpp. References Stream::fileSize. |
|
Returns a char pointer to the header buffer.
Definition at line 254 of file MPGStream.cpp. References headerBuffer. |
|
Returns the byte size of the header.
Definition at line 250 of file MPGStream.cpp. References headerSize. |
|
Reads the next VOP from stream starting at the current file position.
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(). |
|
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(). |
|
Definition at line 113 of file MPGStream.hpp. Referenced by fillHeaderBuffer(), and getHeaderBuffer(). |
|
Byte size of the header. Definition at line 118 of file MPGStream.hpp. Referenced by fillHeaderBuffer(), getHeaderSize(), and parseHeader(). |
|
Definition at line 111 of file MPGStream.hpp. Referenced by addNextGOP(), getNextFrame(), and MPGStream(). |
|
Definition at line 111 of file MPGStream.hpp. Referenced by addNextGOP(), and MPGStream(). |