fm.liveswitch.BitrateMonitor Class Reference

A bitrate monitor. More...

Public Member Functions

 BitrateMonitor (fm.liveswitch.ISystemClock systemClock)
 Initializes a new instance of the fm.liveswitch.BitrateMonitor class. More...
 
double getBitrate ()
 Gets the bitrate, in kbps. More...
 
double getSmoothedBitrate ()
 Gets the smoothed bitrate, in kbps. More...
 
fm.liveswitch.ISystemClock getSystemClock ()
 Gets the system clock. More...
 
void reset ()
 Resets this instance. More...
 
double testBitrate (long bitCount)
 Returns the new bitrate if a new sample is added. More...
 
double testSmoothedBitrate (long bitCount)
 Returns the new bitrate if a new sample is added. More...
 
void update (long bitCount)
 Adds a sample. More...
 

Detailed Description

A bitrate monitor.

Constructor & Destructor Documentation

◆ BitrateMonitor()

fm.liveswitch.BitrateMonitor.BitrateMonitor ( fm.liveswitch.ISystemClock  systemClock)

Initializes a new instance of the fm.liveswitch.BitrateMonitor class.

Parameters
systemClockThe system clock.

Member Function Documentation

◆ getBitrate()

double fm.liveswitch.BitrateMonitor.getBitrate ( )

Gets the bitrate, in kbps.

◆ getSmoothedBitrate()

double fm.liveswitch.BitrateMonitor.getSmoothedBitrate ( )

Gets the smoothed bitrate, in kbps.

◆ getSystemClock()

fm.liveswitch.ISystemClock fm.liveswitch.BitrateMonitor.getSystemClock ( )

Gets the system clock.

◆ reset()

void fm.liveswitch.BitrateMonitor.reset ( )

Resets this instance.

◆ testBitrate()

double fm.liveswitch.BitrateMonitor.testBitrate ( long  bitCount)

Returns the new bitrate if a new sample is added.

Parameters
bitCountThe new bit count.

◆ testSmoothedBitrate()

double fm.liveswitch.BitrateMonitor.testSmoothedBitrate ( long  bitCount)

Returns the new bitrate if a new sample is added.

Parameters
bitCountThe new bit count.

◆ update()

void fm.liveswitch.BitrateMonitor.update ( long  bitCount)

Adds a sample.

This sample should be the total bits sent (or received) over the lifetime of the owning class. A sample should be added every time a packet is sent (or received).

Parameters
bitCountThe new bit count.