RTP Trace System  1.0
Coral::TDTFReader Class Reference

Trace Reader. More...

#include <tdtfreader.h>

Inheritance diagram for Coral::TDTFReader:
Coral::TDTFMediaReader TDTFUtilizationUpdater

List of all members.

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 TDTFPrefixTDTFReader::getTDTFPrefix () const
const TDTFSuffixTDTFReader::getTDTFSuffix () const
const MainIndexEntrygetMainIndexEntry (const double frameRate) const
const TraceHeadergetTraceHeader (const double frameRate) const
const
PositionLengthIntervalIndexHeader
getIPLIHeader (const double frameRate) const
const IntervalHeadergetIntervalHeader (const cardinal position, const double frameRate) const
const LayerHeadergetLayerHeader (const cardinal position, const cardinal layer, const double frameRate) const
const EmpiricalEnvelopegetEmpiricalEnvelope (const cardinal position, const cardinal layer, const double frameRate, const bool frameCount=false) const
const ResourceUtilizationHeadergetResourceUtilizationHeader (const cardinal position, const double frameRate) const
const UtilizationHeadergetFrameSizeUtilizationHeader (const cardinal position, const cardinal layer, const double frameRate) const
const UtilizationHeadergetFrameRateUtilizationHeader (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
MediaCacheEntryInputEntry

Protected Attributes

MainIndexHeaderMainIndex
cardinal MainIndexEntries
ResourceUtilizationListIndexHeaderRULIndex
cardinal RULIndexEntries
double MinFrameRate
double MaxFrameRate
card16 MediaType
card16 MediaSubtype

Static Private Attributes

static multimap< const String,
MediaCacheEntry * > 
MediaCache
static Synchronizable MediaCacheSync

Detailed Description

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.

Author:
Thomas Dreibholz
Version:
1.0

Constructor & Destructor Documentation

Destructor.


Member Function Documentation

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.

Parameters:
positionFile position.
lengthAccess length.
Returns:
true, is access is valid; false otherwise.
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.

Parameters:
frameRateFrame rate.
framePositionFrame RTP position.
Returns:
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.

Parameters:
positionPosition.
layerLayer.
frameRateFrame rate.
frameCounttrue to get empirical envelope for frameCount; false for byterate.
Returns:
Pointer to empirical envelope header.
const UtilizationHeader * Coral::TDTFReader::getFrameRateUtilizationHeader ( const cardinal  position,
const double  frameRate 
) const

Get frame rate utilization constants for given frame rate, layer and position.

Parameters:
positionPosition.
frameRateFrame rate.
aReference to store constant A.
bReference to store constant B.
cReference to store constant C.
Returns:
true on success; false otherwise.
UtilizationHeader.
cardinal Coral::TDTFReader::getFrames ( const double  frameRate) const

Get number of frames for given frame rate.

Parameters:
frameRateFrame rate.
Returns:
Number of frames.
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.

Parameters:
positionPosition.
layerLayer.
frameRateFrame rate.
Returns:
UtilizationHeader.
const IntervalHeader * Coral::TDTFReader::getIntervalHeader ( const cardinal  position,
const double  frameRate 
) const

Get interval header for given frame rate and position.

Parameters:
positionPosition.
frameRateFrame rate.
Returns:
Pointer to trace header.
const PositionLengthIntervalIndexHeader * Coral::TDTFReader::getIPLIHeader ( const double  frameRate) const

Get entry for given frame rate from Position/Length/Interval index.

Parameters:
frameRateFrame rate.
Returns:
Pointer to entry.
cardinal Coral::TDTFReader::getLayerFlags ( const card64  rtpPosition,
const cardinal  layer,
const double  frameRate 
) const

Get layer flags.

Parameters:
rtpPositionRTP position within media.
layerLayer number.
frameRateFrame rate.
Returns:
Layer flags.
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.

Parameters:
positionPosition.
layerLayer.
frameRateFrame rate.
Returns:
Pointer to layer header.
cardinal Coral::TDTFReader::getLayers ( const double  frameRate) const

Get number of layers for given frame rate.

Parameters:
frameRateFrame rate.
Returns:
Number of layers.
double Coral::TDTFReader::getLayerScalability ( const card64  rtpPosition,
const cardinal  layer,
const double  frameRate 
) const

Get layer scalability.

Parameters:
rtpPositionRTP position within media.
layerLayer number.
frameRateFrame rate.
Returns:
Layer scalability.
const MainIndexEntry * Coral::TDTFReader::getMainIndexEntry ( const double  frameRate) const

Get entry for given frame rate from main index.

Parameters:
frameRateFrame rate.
Returns:
Pointer to entry.
cardinal Coral::TDTFReader::getMaxBufferDelay ( const card64  rtpPosition,
const double  frameRate 
) const

Get maximum buffer delay for given position and frame rate.

Parameters:
rtpPositionRTP position within media.
frameRateFrame rate.
Returns:
Maximum buffer delay
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).

Parameters:
rtpPositionRTP position within media.
layerLayer number.
frameRateFrame rate.
bufferDelayBuffer delay in frame rate units.
Returns:
Maximum number of bytes.
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).

Parameters:
rtpPositionRTP position within media.
layerLayer number.
frameRateFrame rate.
bufferDelayBuffer delay in frame rate units.
Returns:
Maximum number of frames.
double Coral::TDTFReader::getMaxFrameRate ( ) const [inline]

Get maximum frame rate.

Returns:
Maximum frame rate.

Get media subtype.

Returns:
Media subtype.

Get media type.

Returns:
Media type.
See also:
TDTFPrefix::MediaTypes
double Coral::TDTFReader::getMinFrameRate ( ) const [inline]

Get minimum frame rate.

Returns:
Minimum frame rate.
double Coral::TDTFReader::getNearestValidFrameRate ( const double  frameRate) const

Get nearest lower valid frame rate for given frame rate.

Parameters:
rateFrame rate.
Returns:
Valid frame rate nearest to given rate.
double Coral::TDTFReader::getNextFrameRateForRate ( const double  frameRate) const

Get next higher valid frame rate for given frame rate.

Parameters:
frameRateFrame rate.
Returns:
Next higher valid 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).

Parameters:
rtpPositionRTP position within media.
layerLayer number.
frameRateFrame rate.
bufferDelayBuffer delay in frame rate units.
Returns:
Payload frame size.
double Coral::TDTFReader::getPrevFrameRateForRate ( const double  frameRate) const

Get next lower valid frame rate for given frame rate.

Parameters:
frameRateFrame rate.
Returns:
Next lower valid frame rate.
const ResourceUtilizationHeader * Coral::TDTFReader::getResourceUtilizationHeader ( const cardinal  position,
const double  frameRate 
) const

Get resource/utilization header for given position and frame rate.

Parameters:
positionPosition refering to *maximum* frame rate.
frameRateFrame rate.
Returns:
ResourceUtilizationHeader.
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.

Parameters:
rtpPositionRTP position within media.
layerLayer number.
frameRateFrame rate.
Returns:
Frame ID.
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.

Parameters:
rtpPositionRTP position within media.
layerLayer number.
frameRateFrame rate.
Returns:
Frame size.
const TraceHeader * Coral::TDTFReader::getTraceHeader ( const double  frameRate) const

Get trace header for given frame rate.

Parameters:
frameRateFrame rate.
Returns:
Pointer to trace header.

Check, if TDTF file has got resource/utilization lists.

Returns:
true, if lists are included; false otherwise.
bool Coral::TDTFReader::isValidFrameRate ( const double  frameRate) const

Check, if given frame rate is a valid value.

Parameters:
frameRateFrame rate to be checked.
Returns:
true, if given rate is valid; false otherwise.
bool Coral::TDTFReader::open ( const char *  name,
const bool  readWrite = false 
) [virtual]

Open TDTF trace file.

Parameters:
nameName of TDTF trace file to open.
writabletrue, to open file in read/write mode; false otherwise.
Returns:
true, if open operation has been successful; false otherwise.
cardinal Coral::TDTFReader::positionToFramePosition ( const double  frameRate,
const card64  rtpPosition 
) const [inline]

Convert RTP position to frame position.

Parameters:
frameRateFrame rate.
rtpPositionRTP position.
Returns:
Frame 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.

Parameters:
osOutput stream.
frameRateFrame rate.
printEEtrue, to print empirical envelope; false otherwise.
compactEEtrue, to print Empirical envelope *without* approximations; false otherwise.
printRULtrue, to print resource/utilization list; false otherwise.
printUCtrue, 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.

Parameters:
osOutput stream.
frameRateFrame rate.
positionPosition.
compacttrue, to print *without* EE approximations; false otherwise.
frameCounttrue to get empirical envelope for frameCount; false for byterate.
const TDTFPrefix* Coral::TDTFReader::TDTFReader::getTDTFPrefix ( ) const

Get TDTF prefix.

Returns:
Pointer to TDTF prefix.
const TDTFSuffix* Coral::TDTFReader::TDTFReader::getTDTFSuffix ( ) const

Get TDTF suffix.

Returns:
Pointer to TDTF suffix.

Member Data Documentation

double Coral::TDTFReader::MaxFrameRate [protected]
multimap< const String, TDTFReader::MediaCacheEntry * > Coral::TDTFReader::MediaCache [static, private]
double Coral::TDTFReader::MinFrameRate [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines