RTP Audio System
2.0.0
|
Abstract Layer Description. More...
#include <abstractlayerdescription.h>
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 |
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.
Layer flags.
Constructor.
AbstractLayerDescription::~AbstractLayerDescription | ( | ) | [virtual] |
Destructor.
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.
bandwidth | Input bandwidth. |
frameRate | Input frame rate. |
bufferDelay | Input buffer delay. |
newBufferDelay | Output buffer delay. |
static cardinal AbstractLayerDescription::bandwidthToFrameSize | ( | const double | frameRate, |
const card64 | bandwidth | ||
) | [inline, static] |
Translate bandwidth into frame size.
frameRate | Frame rate. |
bandwidth | Bandwidth. |
static card64 AbstractLayerDescription::frameSizeToBandwidth | ( | const double | frameRate, |
const cardinal | frameSize | ||
) | [inline, static] |
Translate frame size into bandwidth.
frameRate | Frame rate. |
frameSize | Frame size. |
cardinal AbstractLayerDescription::frameSizeToPacketRate | ( | const double | frameRate, |
const cardinal | frameSize | ||
) | const [virtual] |
Get packets per second for given frame size.
frameRate | Frame rate. |
frameSize | Frame size. |
card64 AbstractLayerDescription::getBandwidth | ( | ) | const [inline] |
Get bandwidth.
cardinal AbstractLayerDescription::getBufferDelay | ( | ) | const [inline] |
Get buffer delay.
InternetFlow AbstractLayerDescription::getDestination | ( | ) | const [inline] |
Get destination address.
cardinal AbstractLayerDescription::getFlags | ( | ) | const [inline] |
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).
frameRate | Frame rate. |
frameSize | Frame size. |
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).
frameRate | Frame rate and size. |
frameSize | Frame size. |
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.
frameRate | Frame rate. |
frameSize | Frame size. |
double AbstractLayerDescription::getFrameSizeUtilizationForSize | ( | const double | frameRate, |
const cardinal | frameSize | ||
) | const [inline] |
Get frame size utilization for given frame rate and size.
frameRate | Frame rate and size. |
frameSize | Frame size. |
cardinal AbstractLayerDescription::getMaxFrameSize | ( | const double | frameRate | ) | const [inline] |
Get maximum frame size for given frame rate.
frameRate | Frame rate. |
cardinal AbstractLayerDescription::getMaxFrameSizeForDelay | ( | const double | frameRate, |
const cardinal | bufferDelay | ||
) | const [inline] |
Get maximum frame size for given frame rate and buffer delay.
frameRate | Frame rate. |
double AbstractLayerDescription::getMaxJitter | ( | ) | const [inline] |
Get maximum jitter.
double AbstractLayerDescription::getMaxLossRate | ( | ) | const [inline] |
Get maximum loss rate.
double AbstractLayerDescription::getMaxTransferDelay | ( | ) | const [inline] |
Get maximum transfer delay.
cardinal AbstractLayerDescription::getMinFrameSize | ( | const double | frameRate | ) | const [inline] |
Get minimum frame size for given frame rate.
frameRate | Frame rate. |
cardinal AbstractLayerDescription::getMinFrameSizeForDelay | ( | const double | frameRate, |
const cardinal | bufferDelay | ||
) | const [inline] |
Get minimum frame size for given frame rate and buffer delay.
frameRate | Frame rate. |
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.
frameRate | Frame rate. |
bufferDelay | Buffer delay. |
size | FrameSize. |
cardinal AbstractLayerDescription::getNextBufferDelay | ( | const double | frameRate | ) | const [inline] |
Get next higher buffer delay.
frameRate | Frame rate. |
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.
frameRate | Frame rate. |
frameSize | Frame size. |
double AbstractLayerDescription::getNextFrameSizeForSize | ( | const double | frameRate, |
const cardinal | frameSize | ||
) | const [inline] |
Get next higher frame size for given frame rate and size.
frameRate | Frame rate and size. |
frameSize | 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.
frameRate | Frame rate. |
cardinal AbstractLayerDescription::getPacketCountForSize | ( | const double | frameRate, |
const cardinal | frameSize | ||
) | const [inline] |
Get number of packets (upper limit) for given frame rate and size.
frameRate | Frame rate. |
cardinal AbstractLayerDescription::getPacketRate | ( | const double | frameRate | ) | const [virtual] |
Get packet rate.
frameRate | Frame rate. |
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.
frameRate | Frame rate. |
cardinal AbstractLayerDescription::getPeakFrameSizeForSize | ( | const double | frameRate, |
const cardinal | frameSize | ||
) | const [inline] |
Get peak frame size for given frame rate and size.
frameRate | Frame rate. |
cardinal AbstractLayerDescription::getPrevBufferDelay | ( | const double | frameRate | ) | const [inline] |
Get next lower buffer delay.
frameRate | Frame rate. |
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.
frameRate | Frame rate. |
frameSize | 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.
frameRate | Frame rate. |
frameSize | Frame size. |
InternetAddress AbstractLayerDescription::getSource | ( | ) | const [inline] |
Get 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.
pktHeaderSize | Packet header size, e.g. 40 + 8 + 12 (IPv6 + UDP + RTP). |
pktMaxSize | Maximum packet size, e.g. 1500. |
maxTransferDelay | Maximum transfer delay in microseconds. |
maxBufferDelay | Maximum buffer delay in frame rate units. |
maxLossRate | Maximum loss rate (out of [0,1]). |
maxJitter | Maximum 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.
frameRate | Frame rate. |
bufferDelay | Buffer delay. |
size | FrameSize. |
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.
bandwidth | Input payload bandwidth. |
frameRate | Input frame rate. |
bufferDelay | Input buffer delay. |
newBufferDelay | Output buffer delay. |
cardinal AbstractLayerDescription::payloadToRaw | ( | const double | frameRate, |
const cardinal | payload, | ||
const cardinal | bufferDelay | ||
) | const [virtual] |
Translate payload frame size into raw frame size.
frameRate | Frame rate. |
payload | Payload frame size. |
bufferDelay | Buffer delay. |
cardinal AbstractLayerDescription::rawToPayload | ( | const double | frameRate, |
const cardinal | raw, | ||
const cardinal | bufferDelay | ||
) | const [virtual] |
Translate raw frame size into payload frame size.
frameRate | Frame rate. |
raw | Raw frame size. |
bufferDelay | Buffer delay. |
bool AbstractLayerDescription::setBandwidth | ( | const double | frameRate, |
const card64 | bandwidth | ||
) | [inline] |
Set bandwidth.
frameRate | Frame rate. |
bandwidth | Bandwidth. |
cardinal AbstractLayerDescription::setBufferDelay | ( | const cardinal | bufferDelay | ) |
Set buffer delay.
bufferDelay | Buffer delay in frame rate units. |
void AbstractLayerDescription::setDestination | ( | const InternetFlow & | destination | ) | [inline] |
Set destination address.
destination | Destination address |
void AbstractLayerDescription::setFlags | ( | const cardinal | flags | ) | [inline] |
Set flags.
void AbstractLayerDescription::setMaxJitter | ( | const double | maxJitter | ) | [inline] |
Get maximum jitter.
maxJitter | Maximum jitter in microseconds. |
void AbstractLayerDescription::setMaxLossRate | ( | const double | maxLossRate | ) | [inline] |
Set maximum loss rate.
maxLossRate | Maximum loss rate (out of [0,1]). |
void AbstractLayerDescription::setMaxTransferDelay | ( | const double | maxDelay | ) | [inline] |
Set maximum transfer delay.
maxDelay | Maximum transfer delay in microseconds. |
void AbstractLayerDescription::setSource | ( | const InternetAddress & | source | ) | [inline] |
Set source address.
source | Source address. |
card64 AbstractLayerDescription::Bandwidth [protected] |
cardinal AbstractLayerDescription::BufferDelay [protected] |
InternetFlow AbstractLayerDescription::Destination [protected] |
cardinal AbstractLayerDescription::Flags [protected] |
cardinal AbstractLayerDescription::MaxBufferDelay [protected] |
double AbstractLayerDescription::MaxJitter [protected] |
double AbstractLayerDescription::MaxLossRate [protected] |
double AbstractLayerDescription::MaxTransferDelay [protected] |
cardinal AbstractLayerDescription::PktHeaderSize [protected] |
cardinal AbstractLayerDescription::PktMaxSize [protected] |
InternetAddress AbstractLayerDescription::Source [protected] |