OPAL  Version 3.14.3
OpalBitRateCalculator Class Reference

#include <ratectl.h>

Data Structures

struct  History
 

Public Member Functions

 OpalBitRateCalculator ()
 
void Reset ()
 
void SetQuanta (unsigned quanta_)
 
unsigned GetQuanta () const
 
void AddPacket (PINDEX size, bool marker)
 
unsigned GetBitRate ()
 
unsigned GetAverageBitRate ()
 
unsigned GetAveragePacketSize ()
 
unsigned GetTrialBitRate (PINDEX size)
 
PInt64 GetTotalSize () const
 
PInt64 GetTotalTime () const
 
size_t GetHistoryCount () const
 
unsigned GetHistorySize () const
 
PInt64 GetEarliestHistoryTime () const
 
unsigned GetHistoryFrames () const
 
void Flush ()
 

Static Public Member Functions

static PInt64 GetNow ()
 

Protected Member Functions

void Flush (PInt64 now)
 

Protected Attributes

std::deque< Historym_history
 
PINDEX m_historySize
 
PInt64 m_totalSize
 
PINDEX m_historyFrames
 
unsigned m_quanta
 
unsigned m_bitRate
 
bool m_first
 
PInt64 m_baseTimeStamp
 

Detailed Description

This class is used to calculate the instantaneous bit rate of a data stream using a one second sliding window

Constructor & Destructor Documentation

OpalBitRateCalculator::OpalBitRateCalculator ( )

Create the calculator

Member Function Documentation

void OpalBitRateCalculator::AddPacket ( PINDEX  size,
bool  marker 
)

Add a new packet to the bit rate calculations

void OpalBitRateCalculator::Flush ( )
void OpalBitRateCalculator::Flush ( PInt64  now)
protected
unsigned OpalBitRateCalculator::GetAverageBitRate ( )

Get the average bit rate since SetQuanta was called

unsigned OpalBitRateCalculator::GetAveragePacketSize ( )

Get the average bit rate since SetQuanta was called

unsigned OpalBitRateCalculator::GetBitRate ( )

Get the instantaneous bit rate

PInt64 OpalBitRateCalculator::GetEarliestHistoryTime ( ) const
inline

Return earlist timestamp in history

References m_history.

size_t OpalBitRateCalculator::GetHistoryCount ( ) const
inline

Return number of frames in history

References m_history.

unsigned OpalBitRateCalculator::GetHistoryFrames ( ) const

Return number of marker bits in history

unsigned OpalBitRateCalculator::GetHistorySize ( ) const
inline

Return number of bytes in history

References m_historySize.

static PInt64 OpalBitRateCalculator::GetNow ( )
static
unsigned OpalBitRateCalculator::GetQuanta ( ) const
inline

Get the quanta (usually the frame time)

References m_quanta.

PInt64 OpalBitRateCalculator::GetTotalSize ( ) const

Return total bytes sent since SetQuanta was called

PInt64 OpalBitRateCalculator::GetTotalTime ( ) const

Return total miliseconds since SetQuanta was called

unsigned OpalBitRateCalculator::GetTrialBitRate ( PINDEX  size)

return the bit rate if the specific data size was transmitted

void OpalBitRateCalculator::Reset ( )

Reset the statistics

void OpalBitRateCalculator::SetQuanta ( unsigned  quanta_)

Set the quanta (usually the frame time)

Field Documentation

PInt64 OpalBitRateCalculator::m_baseTimeStamp
protected
unsigned OpalBitRateCalculator::m_bitRate
protected
bool OpalBitRateCalculator::m_first
protected
std::deque<History> OpalBitRateCalculator::m_history
protected
PINDEX OpalBitRateCalculator::m_historyFrames
protected
PINDEX OpalBitRateCalculator::m_historySize
protected

Referenced by GetHistorySize().

unsigned OpalBitRateCalculator::m_quanta
protected

Referenced by GetQuanta().

PInt64 OpalBitRateCalculator::m_totalSize
protected

The documentation for this class was generated from the following file: