OPAL  Version 3.10.4
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


Member Function Documentation

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

Add a new packet to the bit rate calculations

void OpalBitRateCalculator::Flush ( PInt64  now) [protected]

Get the average bit rate since SetQuanta was called

Get the average bit rate since SetQuanta was called

Get the instantaneous bit rate

Return earlist timestamp in history

References m_history.

size_t OpalBitRateCalculator::GetHistoryCount ( ) const [inline]

Return number of frames in history

References m_history.

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.

Return total bytes sent since SetQuanta was called

Return total miliseconds since SetQuanta was called

unsigned OpalBitRateCalculator::GetTrialBitRate ( PINDEX  size)

return the bit rate if the specific data size was transmitted

Reset the statistics

void OpalBitRateCalculator::SetQuanta ( unsigned  quanta_)

Set the quanta (usually the frame time)


Field Documentation

unsigned OpalBitRateCalculator::m_bitRate [protected]

Referenced by GetHistorySize().

unsigned OpalBitRateCalculator::m_quanta [protected]

Referenced by GetQuanta().


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