RTP Audio System  2.0.0
AbstractLayerDescription Class Reference

Abstract Layer Description. More...

#include <abstractlayerdescription.h>

Inheritance diagram for AbstractLayerDescription:
FrameSizeScalabilityInterface

List of all members.

Public Types

enum  LayerFlags { LF_BaseLayer = 0, LF_ExtensionLayer = (1 << 0) }

Public Member Functions

 AbstractLayerDescription ()
virtual ~AbstractLayerDescription ()
void initLayer (const cardinal pktHeaderSize, const cardinal pktMaxSize, const double maxTransferDelay, const cardinal maxBufferDelay, const double maxLossRate, const double maxJitter, const cardinal flags)
card64 getBandwidth () const
bool setBandwidth (const double frameRate, const card64 bandwidth)
virtual cardinal getPacketRate (const double frameRate) const
card64 bandwidthToBandwidth (const card64 bandwidth, const double frameRate, const cardinal bufferDelay, const cardinal newBufferDelay) const
card64 payloadBandwidthToBandwidth (const card64 bandwidth, const double frameRate, const cardinal bufferDelay, const cardinal newBufferDelay) const
virtual cardinal frameSizeToPacketRate (const double frameRate, const cardinal frameSize) const
double getMaxTransferDelay () const
void setMaxTransferDelay (const double maxDelay)
double getMaxLossRate () const
void setMaxLossRate (const double maxLossRate)
double getMaxJitter () const
void setMaxJitter (const double maxJitter)
bool isValidFrameSize (const double frameRate, const cardinal bufferDelay, const cardinal size) const
cardinal getNearestValidFrameSize (const double frameRate, const cardinal bufferDelay, const cardinal size) const
virtual cardinal payloadToRaw (const double frameRate, const cardinal payload, const cardinal bufferDelay) const
virtual cardinal rawToPayload (const double frameRate, const cardinal raw, const cardinal bufferDelay) const
cardinal getMinFrameSize (const double frameRate) const
cardinal getMaxFrameSize (const double frameRate) const
cardinal getPeakFrameSizeForSize (const double frameRate, const cardinal frameSize) const
cardinal getPacketCountForSize (const double frameRate, const cardinal frameSize) const
double getPrevFrameSizeForSize (const double frameRate, const cardinal frameSize) const
double getNextFrameSizeForSize (const double frameRate, const cardinal frameSize) const
double getFrameSizeScaleFactorForSize (const double frameRate, const cardinal frameSize) const
double getFrameSizeUtilizationForSize (const double frameRate, const cardinal frameSize) const
cardinal getMinFrameSizeForDelay (const double frameRate, const cardinal bufferDelay) const
cardinal getMaxFrameSizeForDelay (const double frameRate, const cardinal bufferDelay) const
cardinal getPeakFrameSizeForDelayAndSize (const double frameRate, const cardinal bufferDelay, const cardinal frameSize) const
cardinal getPacketCountForDelayAndSize (const double frameRate, const cardinal bufferDelay, const cardinal frameSize) const
double getPrevFrameSizeForDelayAndSize (const double frameRate, const cardinal bufferDelay, const cardinal frameSize) const
double getNextFrameSizeForDelayAndSize (const double frameRate, const cardinal bufferDelay, const cardinal frameSize) const
double getFrameSizeScaleFactorForDelayAndSize (const double frameRate, const cardinal bufferDelay, const cardinal frameSize) const
double getFrameSizeUtilizationForDelayAndSize (const double frameRate, const cardinal bufferDelay, const cardinal frameSize) const
cardinal getBufferDelay () const
cardinal setBufferDelay (const cardinal bufferDelay)
cardinal getPrevBufferDelay (const double frameRate) const
cardinal getNextBufferDelay (const double frameRate) const
InternetAddress getSource () const
InternetFlow getDestination () const
void setSource (const InternetAddress &source)
void setDestination (const InternetFlow &destination)
cardinal getFlags () const
void setFlags (const cardinal flags)

Static Public Member Functions

static card64 frameSizeToBandwidth (const double frameRate, const cardinal frameSize)
static cardinal bandwidthToFrameSize (const double frameRate, const card64 bandwidth)

Protected Attributes

cardinal PktHeaderSize
cardinal PktMaxSize
card64 Bandwidth
double MaxTransferDelay
double MaxLossRate
double MaxJitter
cardinal BufferDelay
cardinal MaxBufferDelay
cardinal Flags
InternetAddress Source
InternetFlow Destination

Detailed Description

Abstract Layer Description.

This class contains a layer's QoS requirements. Important node: All frames sizes in this class are *raw* frame sizes, the frames sizes in FrameSizeScalability are payload frame sizes. This class does necessary translation.

Author:
Thomas Dreibholz
Version:
1.0

Member Enumeration Documentation

Layer flags.

Enumerator:
LF_BaseLayer 
LF_ExtensionLayer 

Constructor & Destructor Documentation


Member Function Documentation

card64 AbstractLayerDescription::bandwidthToBandwidth ( const card64  bandwidth,
const double  frameRate,
const cardinal  bufferDelay,
const cardinal  newBufferDelay 
) const [inline]

Translate bandwidth into bandwidth using different buffer delay.

Parameters:
bandwidthInput bandwidth.
frameRateInput frame rate.
bufferDelayInput buffer delay.
newBufferDelayOutput buffer delay.
Returns:
Output bandwidth.
static cardinal AbstractLayerDescription::bandwidthToFrameSize ( const double  frameRate,
const card64  bandwidth 
) [inline, static]

Translate bandwidth into frame size.

Parameters:
frameRateFrame rate.
bandwidthBandwidth.
Returns:
Frame size.
static card64 AbstractLayerDescription::frameSizeToBandwidth ( const double  frameRate,
const cardinal  frameSize 
) [inline, static]

Translate frame size into bandwidth.

Parameters:
frameRateFrame rate.
frameSizeFrame size.
Returns:
Bandwidth.
cardinal AbstractLayerDescription::frameSizeToPacketRate ( const double  frameRate,
const cardinal  frameSize 
) const [virtual]

Get packets per second for given frame size.

Parameters:
frameRateFrame rate.
frameSizeFrame size.
Returns:
Packets per second.

Get bandwidth.

Returns:
Bandwidth.

Get buffer delay.

Returns:
Buffer delay in frame rate units.

Get destination address.

Returns:
Destination address.

Get flags.

double AbstractLayerDescription::getFrameSizeScaleFactorForDelayAndSize ( const double  frameRate,
const cardinal  bufferDelay,
const cardinal  frameSize 
) const [inline]

Get frame size scale factor for given frame rate, size and buffer delay. (size - MinFrameSize) / (MaxFrameSize - MinFrameSize).

Parameters:
frameRateFrame rate.
frameSizeFrame size.
Returns:
Scale factor (out of [0,1]).
double AbstractLayerDescription::getFrameSizeScaleFactorForSize ( const double  frameRate,
const cardinal  frameSize 
) const [inline]

Get frame size scale factor for given frame rate and size: (size - MinFrameSize) / (MaxFrameSize - MinFrameSize).

Parameters:
frameRateFrame rate and size.
frameSizeFrame size.
Returns:
Scale factor (out of [0,1]).
double AbstractLayerDescription::getFrameSizeUtilizationForDelayAndSize ( const double  frameRate,
const cardinal  bufferDelay,
const cardinal  frameSize 
) const [inline]

Get frame size utilization for given frame rate, size and buffer delay.

Parameters:
frameRateFrame rate.
frameSizeFrame size.
Returns:
Utilization (out of [0,1]).
double AbstractLayerDescription::getFrameSizeUtilizationForSize ( const double  frameRate,
const cardinal  frameSize 
) const [inline]

Get frame size utilization for given frame rate and size.

Parameters:
frameRateFrame rate and size.
frameSizeFrame size.
Returns:
Utilization (out of [0,1]).
cardinal AbstractLayerDescription::getMaxFrameSize ( const double  frameRate) const [inline]

Get maximum frame size for given frame rate.

Parameters:
frameRateFrame rate.
Returns:
Maximum frame size.
cardinal AbstractLayerDescription::getMaxFrameSizeForDelay ( const double  frameRate,
const cardinal  bufferDelay 
) const [inline]

Get maximum frame size for given frame rate and buffer delay.

Parameters:
frameRateFrame rate.
Returns:
Maximum frame size.
double AbstractLayerDescription::getMaxJitter ( ) const [inline]

Get maximum jitter.

Returns:
Maximum jitter in microseconds.
double AbstractLayerDescription::getMaxLossRate ( ) const [inline]

Get maximum loss rate.

Returns:
Maximum loss rate (out of [0,1]).

Get maximum transfer delay.

Returns:
Maximum transfer delay in microseconds.
cardinal AbstractLayerDescription::getMinFrameSize ( const double  frameRate) const [inline]

Get minimum frame size for given frame rate.

Parameters:
frameRateFrame rate.
Returns:
Minimum frame size.
cardinal AbstractLayerDescription::getMinFrameSizeForDelay ( const double  frameRate,
const cardinal  bufferDelay 
) const [inline]

Get minimum frame size for given frame rate and buffer delay.

Parameters:
frameRateFrame rate.
Returns:
Minimum frame size.
cardinal AbstractLayerDescription::getNearestValidFrameSize ( const double  frameRate,
const cardinal  bufferDelay,
const cardinal  size 
) const [inline]

Get nearest lower frame size for given frame rate and buffer delay.

Parameters:
frameRateFrame rate.
bufferDelayBuffer delay.
sizeFrameSize.
Returns:
Nearest lower frame size.
cardinal AbstractLayerDescription::getNextBufferDelay ( const double  frameRate) const [inline]

Get next higher buffer delay.

Parameters:
frameRateFrame rate.
Returns:
Buffer delay in frame rate units.
double AbstractLayerDescription::getNextFrameSizeForDelayAndSize ( const double  frameRate,
const cardinal  bufferDelay,
const cardinal  frameSize 
) const [inline]

Get next higher frame size for given frame rate, size and buffer delay.

Parameters:
frameRateFrame rate.
frameSizeFrame size.
Returns:
Next higher frame size.
double AbstractLayerDescription::getNextFrameSizeForSize ( const double  frameRate,
const cardinal  frameSize 
) const [inline]

Get next higher frame size for given frame rate and size.

Parameters:
frameRateFrame rate and size.
frameSizeFrame size.
Returns:
Next higher frame size.
cardinal AbstractLayerDescription::getPacketCountForDelayAndSize ( const double  frameRate,
const cardinal  bufferDelay,
const cardinal  frameSize 
) const [inline]

Get number of packets (upper limit) for given frame rate, size and buffer delay.

Parameters:
frameRateFrame rate.
Returns:
Number of packets.
cardinal AbstractLayerDescription::getPacketCountForSize ( const double  frameRate,
const cardinal  frameSize 
) const [inline]

Get number of packets (upper limit) for given frame rate and size.

Parameters:
frameRateFrame rate.
Returns:
Number of packets.
cardinal AbstractLayerDescription::getPacketRate ( const double  frameRate) const [virtual]

Get packet rate.

Parameters:
frameRateFrame rate.
Returns:
Bandwidth limit.
cardinal AbstractLayerDescription::getPeakFrameSizeForDelayAndSize ( const double  frameRate,
const cardinal  bufferDelay,
const cardinal  frameSize 
) const [inline]

Get peak frame size for given frame rate, size and buffer delay.

Parameters:
frameRateFrame rate.
Returns:
Peak frame size.
cardinal AbstractLayerDescription::getPeakFrameSizeForSize ( const double  frameRate,
const cardinal  frameSize 
) const [inline]

Get peak frame size for given frame rate and size.

Parameters:
frameRateFrame rate.
Returns:
Peak frame size.
cardinal AbstractLayerDescription::getPrevBufferDelay ( const double  frameRate) const [inline]

Get next lower buffer delay.

Parameters:
frameRateFrame rate.
Returns:
Buffer delay in frame rate units.
double AbstractLayerDescription::getPrevFrameSizeForDelayAndSize ( const double  frameRate,
const cardinal  bufferDelay,
const cardinal  frameSize 
) const [inline]

Get next lower frame size for given frame rate, size and buffer delay.

Parameters:
frameRateFrame rate.
frameSizeFrame size.
Returns:
Next lower frame size.
double AbstractLayerDescription::getPrevFrameSizeForSize ( const double  frameRate,
const cardinal  frameSize 
) const [inline]

Get next lower frame size for given frame rate and size and size.

Parameters:
frameRateFrame rate.
frameSizeFrame size.
Returns:
Next lower frame size.

Get source address.

Returns:
Source address.
void AbstractLayerDescription::initLayer ( const cardinal  pktHeaderSize,
const cardinal  pktMaxSize,
const double  maxTransferDelay,
const cardinal  maxBufferDelay,
const double  maxLossRate,
const double  maxJitter,
const cardinal  flags 
) [inline]

Initialize layer description.

Parameters:
pktHeaderSizePacket header size, e.g. 40 + 8 + 12 (IPv6 + UDP + RTP).
pktMaxSizeMaximum packet size, e.g. 1500.
maxTransferDelayMaximum transfer delay in microseconds.
maxBufferDelayMaximum buffer delay in frame rate units.
maxLossRateMaximum loss rate (out of [0,1]).
maxJitterMaximum jitter in microseconds.
bool AbstractLayerDescription::isValidFrameSize ( const double  frameRate,
const cardinal  bufferDelay,
const cardinal  size 
) const [inline]

Check, if given frame size is valid for given frame rate and buffer delay.

Parameters:
frameRateFrame rate.
bufferDelayBuffer delay.
sizeFrameSize.
Returns:
true, if frame size is valid; false otherwise.
card64 AbstractLayerDescription::payloadBandwidthToBandwidth ( const card64  bandwidth,
const double  frameRate,
const cardinal  bufferDelay,
const cardinal  newBufferDelay 
) const

Translate *payload* bandwidth into bandwidth using different buffer delay.

Parameters:
bandwidthInput payload bandwidth.
frameRateInput frame rate.
bufferDelayInput buffer delay.
newBufferDelayOutput buffer delay.
Returns:
Output payload bandwidth.
cardinal AbstractLayerDescription::payloadToRaw ( const double  frameRate,
const cardinal  payload,
const cardinal  bufferDelay 
) const [virtual]

Translate payload frame size into raw frame size.

Parameters:
frameRateFrame rate.
payloadPayload frame size.
bufferDelayBuffer delay.
Returns:
Raw frame size.
cardinal AbstractLayerDescription::rawToPayload ( const double  frameRate,
const cardinal  raw,
const cardinal  bufferDelay 
) const [virtual]

Translate raw frame size into payload frame size.

Parameters:
frameRateFrame rate.
rawRaw frame size.
bufferDelayBuffer delay.
Returns:
Payload frame size.
bool AbstractLayerDescription::setBandwidth ( const double  frameRate,
const card64  bandwidth 
) [inline]

Set bandwidth.

Parameters:
frameRateFrame rate.
bandwidthBandwidth.
Returns:
true, if bandwidth is sufficient for minimum requirement.

Set buffer delay.

Parameters:
bufferDelayBuffer delay in frame rate units.
Returns:
Buffer delay set in frame rate units.
void AbstractLayerDescription::setDestination ( const InternetFlow destination) [inline]

Set destination address.

Parameters:
destinationDestination address
void AbstractLayerDescription::setFlags ( const cardinal  flags) [inline]

Set flags.

void AbstractLayerDescription::setMaxJitter ( const double  maxJitter) [inline]

Get maximum jitter.

Parameters:
maxJitterMaximum jitter in microseconds.
void AbstractLayerDescription::setMaxLossRate ( const double  maxLossRate) [inline]

Set maximum loss rate.

Parameters:
maxLossRateMaximum loss rate (out of [0,1]).
void AbstractLayerDescription::setMaxTransferDelay ( const double  maxDelay) [inline]

Set maximum transfer delay.

Parameters:
maxDelayMaximum transfer delay in microseconds.
void AbstractLayerDescription::setSource ( const InternetAddress source) [inline]

Set source address.

Parameters:
sourceSource address.

Member Data Documentation


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