RTP Trace System
1.0
|
Trace Reader. More...
#include <tdtfreader.h>
Classes | |
struct | MediaCacheEntry |
Public Member Functions | |
TDTFReader () | |
virtual | ~TDTFReader () |
virtual bool | open (const char *name, const bool readWrite=false) |
virtual void | close () |
bool | hasResourceUtilizationLists () const |
card16 | getMediaType () const |
card16 | getMediaSubtype () const |
bool | isValidFrameRate (const double frameRate) const |
double | getNearestValidFrameRate (const double frameRate) const |
double | getMinFrameRate () const |
double | getMaxFrameRate () const |
double | getNextFrameRateForRate (const double frameRate) const |
double | getPrevFrameRateForRate (const double frameRate) const |
cardinal | getMaxByteCountForDelay (const card64 rtpPosition, const cardinal layer, const double frameRate, const cardinal delay) const |
cardinal | getMaxFrameCountForDelay (const card64 rtpPosition, const cardinal layer, const double frameRate, const cardinal delay) const |
cardinal | getPayloadFrameSizeForDelay (const card64 rtpPosition, const cardinal layer, const double frameRate, const cardinal bufferDelay) const |
cardinal | getTraceFrameSize (const card64 rtpPosition, const cardinal layer, const double frameRate) const |
cardinal | getTraceFrameID (const card64 rtpPosition, const cardinal layer, const double frameRate) const |
double | getLayerScalability (const card64 rtpPosition, const cardinal layer, const double frameRate) const |
cardinal | getLayerFlags (const card64 rtpPosition, const cardinal layer, const double frameRate) const |
cardinal | getFrames (const double frameRate) const |
cardinal | getLayers (const double frameRate) const |
cardinal | getMaxBufferDelay (const card64 rtpPosition, const double frameRate) const |
bool | checkAccess (const cardinal position, const cardinal length) const |
const TDTFPrefix * | TDTFReader::getTDTFPrefix () const |
const TDTFSuffix * | TDTFReader::getTDTFSuffix () const |
const MainIndexEntry * | getMainIndexEntry (const double frameRate) const |
const TraceHeader * | getTraceHeader (const double frameRate) const |
const PositionLengthIntervalIndexHeader * | getIPLIHeader (const double frameRate) const |
const IntervalHeader * | getIntervalHeader (const cardinal position, const double frameRate) const |
const LayerHeader * | getLayerHeader (const cardinal position, const cardinal layer, const double frameRate) const |
const EmpiricalEnvelope * | getEmpiricalEnvelope (const cardinal position, const cardinal layer, const double frameRate, const bool frameCount=false) const |
const ResourceUtilizationHeader * | getResourceUtilizationHeader (const cardinal position, const double frameRate) const |
const UtilizationHeader * | getFrameSizeUtilizationHeader (const cardinal position, const cardinal layer, const double frameRate) const |
const UtilizationHeader * | getFrameRateUtilizationHeader (const cardinal position, const double frameRate) const |
cardinal | positionToFramePosition (const double frameRate, const card64 rtpPosition) const |
card64 | framePositionToPosition (const double frameRate, const cardinal framePosition) const |
void | printEmpiricalEnvelope (ostream &os, const cardinal position, const double frameRate, const bool frameCount, const bool compact) const |
void | print (ostream &os, const double frameRate, const bool printEE, const bool compactEE, const bool printRUL, const bool printUC) const |
Public Attributes | |
int | InputFile |
char * | InputMemory |
cardinal | InputLength |
MediaCacheEntry * | InputEntry |
Protected Attributes | |
MainIndexHeader * | MainIndex |
cardinal | MainIndexEntries |
ResourceUtilizationListIndexHeader * | RULIndex |
cardinal | RULIndexEntries |
double | MinFrameRate |
double | MaxFrameRate |
card16 | MediaType |
card16 | MediaSubtype |
Static Private Attributes | |
static multimap< const String, MediaCacheEntry * > | MediaCache |
static Synchronizable | MediaCacheSync |
Trace Reader.
This class is a reader for a TDTF trace file. The file will be mapped to memory using mmap() to provide easy access to trace and interval data.
Constructor.
Coral::TDTFReader::~TDTFReader | ( | ) | [virtual] |
Destructor.
bool Coral::TDTFReader::checkAccess | ( | const cardinal | position, |
const cardinal | length | ||
) | const |
Check, if access to trace file at given position for given length is within valid range.
position | File position. |
length | Access length. |
void Coral::TDTFReader::close | ( | ) | [virtual] |
Close TDTF trace file.
Reimplemented in Coral::TDTFMediaReader.
card64 Coral::TDTFReader::framePositionToPosition | ( | const double | frameRate, |
const cardinal | framePosition | ||
) | const [inline] |
Convert frame position to RTP position.
frameRate | Frame rate. |
framePosition | Frame RTP position. |
const EmpiricalEnvelope * Coral::TDTFReader::getEmpiricalEnvelope | ( | const cardinal | position, |
const cardinal | layer, | ||
const double | frameRate, | ||
const bool | frameCount = false |
||
) | const |
Get empirical envelope for byterate or frame count for given frame rate, layer and position.
position | Position. |
layer | Layer. |
frameRate | Frame rate. |
frameCount | true to get empirical envelope for frameCount; false for byterate. |
const UtilizationHeader * Coral::TDTFReader::getFrameRateUtilizationHeader | ( | const cardinal | position, |
const double | frameRate | ||
) | const |
Get frame rate utilization constants for given frame rate, layer and position.
position | Position. |
frameRate | Frame rate. |
a | Reference to store constant A. |
b | Reference to store constant B. |
c | Reference to store constant C. |
cardinal Coral::TDTFReader::getFrames | ( | const double | frameRate | ) | const |
Get number of frames for given frame rate.
frameRate | Frame rate. |
const UtilizationHeader * Coral::TDTFReader::getFrameSizeUtilizationHeader | ( | const cardinal | position, |
const cardinal | layer, | ||
const double | frameRate | ||
) | const |
Get frame size utilization constants for given frame rate, layer and position.
position | Position. |
layer | Layer. |
frameRate | Frame rate. |
const IntervalHeader * Coral::TDTFReader::getIntervalHeader | ( | const cardinal | position, |
const double | frameRate | ||
) | const |
Get interval header for given frame rate and position.
position | Position. |
frameRate | Frame rate. |
const PositionLengthIntervalIndexHeader * Coral::TDTFReader::getIPLIHeader | ( | const double | frameRate | ) | const |
Get entry for given frame rate from Position/Length/Interval index.
frameRate | Frame rate. |
cardinal Coral::TDTFReader::getLayerFlags | ( | const card64 | rtpPosition, |
const cardinal | layer, | ||
const double | frameRate | ||
) | const |
Get layer flags.
rtpPosition | RTP position within media. |
layer | Layer number. |
frameRate | Frame rate. |
const LayerHeader * Coral::TDTFReader::getLayerHeader | ( | const cardinal | position, |
const cardinal | layer, | ||
const double | frameRate | ||
) | const |
Get layer header for given frame rate, position and layer.
position | Position. |
layer | Layer. |
frameRate | Frame rate. |
cardinal Coral::TDTFReader::getLayers | ( | const double | frameRate | ) | const |
Get number of layers for given frame rate.
frameRate | Frame rate. |
double Coral::TDTFReader::getLayerScalability | ( | const card64 | rtpPosition, |
const cardinal | layer, | ||
const double | frameRate | ||
) | const |
Get layer scalability.
rtpPosition | RTP position within media. |
layer | Layer number. |
frameRate | Frame rate. |
const MainIndexEntry * Coral::TDTFReader::getMainIndexEntry | ( | const double | frameRate | ) | const |
Get entry for given frame rate from main index.
frameRate | Frame rate. |
cardinal Coral::TDTFReader::getMaxBufferDelay | ( | const card64 | rtpPosition, |
const double | frameRate | ||
) | const |
Get maximum buffer delay for given position and frame rate.
rtpPosition | RTP position within media. |
frameRate | Frame rate. |
cardinal Coral::TDTFReader::getMaxByteCountForDelay | ( | const card64 | rtpPosition, |
const cardinal | layer, | ||
const double | frameRate, | ||
const cardinal | delay | ||
) | const |
Get maximum number of bytes for given buffer delay (in frame rate units).
rtpPosition | RTP position within media. |
layer | Layer number. |
frameRate | Frame rate. |
bufferDelay | Buffer delay in frame rate units. |
cardinal Coral::TDTFReader::getMaxFrameCountForDelay | ( | const card64 | rtpPosition, |
const cardinal | layer, | ||
const double | frameRate, | ||
const cardinal | delay | ||
) | const |
Get maximum number of frames for given buffer delay (in frame rate units).
rtpPosition | RTP position within media. |
layer | Layer number. |
frameRate | Frame rate. |
bufferDelay | Buffer delay in frame rate units. |
double Coral::TDTFReader::getMaxFrameRate | ( | ) | const [inline] |
Get maximum frame rate.
card16 Coral::TDTFReader::getMediaSubtype | ( | ) | const [inline] |
Get media subtype.
card16 Coral::TDTFReader::getMediaType | ( | ) | const [inline] |
double Coral::TDTFReader::getMinFrameRate | ( | ) | const [inline] |
Get minimum frame rate.
double Coral::TDTFReader::getNearestValidFrameRate | ( | const double | frameRate | ) | const |
Get nearest lower valid frame rate for given frame rate.
rate | Frame rate. |
double Coral::TDTFReader::getNextFrameRateForRate | ( | const double | frameRate | ) | const |
Get next higher valid frame rate for given frame rate.
frameRate | Frame rate. |
cardinal Coral::TDTFReader::getPayloadFrameSizeForDelay | ( | const card64 | rtpPosition, |
const cardinal | layer, | ||
const double | frameRate, | ||
const cardinal | bufferDelay | ||
) | const [inline] |
Get payload frame size for given buffer delay (in frame rate units).
rtpPosition | RTP position within media. |
layer | Layer number. |
frameRate | Frame rate. |
bufferDelay | Buffer delay in frame rate units. |
double Coral::TDTFReader::getPrevFrameRateForRate | ( | const double | frameRate | ) | const |
Get next lower valid frame rate for given frame rate.
frameRate | Frame rate. |
const ResourceUtilizationHeader * Coral::TDTFReader::getResourceUtilizationHeader | ( | const cardinal | position, |
const double | frameRate | ||
) | const |
Get resource/utilization header for given position and frame rate.
position | Position refering to *maximum* frame rate. |
frameRate | Frame rate. |
cardinal Coral::TDTFReader::getTraceFrameID | ( | const card64 | rtpPosition, |
const cardinal | layer, | ||
const double | frameRate | ||
) | const |
Get frame ID for given position, layer and frame rate from trace.
rtpPosition | RTP position within media. |
layer | Layer number. |
frameRate | Frame rate. |
cardinal Coral::TDTFReader::getTraceFrameSize | ( | const card64 | rtpPosition, |
const cardinal | layer, | ||
const double | frameRate | ||
) | const |
Get payload frame size for given position, layer and frame rate from trace.
rtpPosition | RTP position within media. |
layer | Layer number. |
frameRate | Frame rate. |
const TraceHeader * Coral::TDTFReader::getTraceHeader | ( | const double | frameRate | ) | const |
Get trace header for given frame rate.
frameRate | Frame rate. |
bool Coral::TDTFReader::hasResourceUtilizationLists | ( | ) | const [inline] |
Check, if TDTF file has got resource/utilization lists.
bool Coral::TDTFReader::isValidFrameRate | ( | const double | frameRate | ) | const |
Check, if given frame rate is a valid value.
frameRate | Frame rate to be checked. |
bool Coral::TDTFReader::open | ( | const char * | name, |
const bool | readWrite = false |
||
) | [virtual] |
Open TDTF trace file.
name | Name of TDTF trace file to open. |
writable | true, to open file in read/write mode; false otherwise. |
cardinal Coral::TDTFReader::positionToFramePosition | ( | const double | frameRate, |
const card64 | rtpPosition | ||
) | const [inline] |
Convert RTP position to frame position.
frameRate | Frame rate. |
rtpPosition | RTP position. |
void Coral::TDTFReader::print | ( | ostream & | os, |
const double | frameRate, | ||
const bool | printEE, | ||
const bool | compactEE, | ||
const bool | printRUL, | ||
const bool | printUC | ||
) | const |
Print complete TDTF trace for given frame rate.
os | Output stream. |
frameRate | Frame rate. |
printEE | true, to print empirical envelope; false otherwise. |
compactEE | true, to print Empirical envelope *without* approximations; false otherwise. |
printRUL | true, to print resource/utilization list; false otherwise. |
printUC | true, to print utilization constants; false otherwise. |
void Coral::TDTFReader::printEmpiricalEnvelope | ( | ostream & | os, |
const cardinal | position, | ||
const double | frameRate, | ||
const bool | frameCount, | ||
const bool | compact | ||
) | const |
Print empirical envelopes for all layers for byterate or frame count for given frame rate and position.
os | Output stream. |
frameRate | Frame rate. |
position | Position. |
compact | true, to print *without* EE approximations; false otherwise. |
frameCount | true to get empirical envelope for frameCount; false for byterate. |
const TDTFPrefix* Coral::TDTFReader::TDTFReader::getTDTFPrefix | ( | ) | const |
Get TDTF prefix.
const TDTFSuffix* Coral::TDTFReader::TDTFReader::getTDTFSuffix | ( | ) | const |
Get TDTF suffix.
MainIndexHeader* Coral::TDTFReader::MainIndex [protected] |
cardinal Coral::TDTFReader::MainIndexEntries [protected] |
double Coral::TDTFReader::MaxFrameRate [protected] |
multimap< const String, TDTFReader::MediaCacheEntry * > Coral::TDTFReader::MediaCache [static, private] |
Synchronizable Coral::TDTFReader::MediaCacheSync [static, private] |
card16 Coral::TDTFReader::MediaSubtype [protected] |
card16 Coral::TDTFReader::MediaType [protected] |
double Coral::TDTFReader::MinFrameRate [protected] |
cardinal Coral::TDTFReader::RULIndexEntries [protected] |