|
OPAL
Version 3.14.3
|
#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< History > | m_history |
| PINDEX | m_historySize |
| PInt64 | m_totalSize |
| PINDEX | m_historyFrames |
| unsigned | m_quanta |
| unsigned | m_bitRate |
| bool | m_first |
| PInt64 | m_baseTimeStamp |
This class is used to calculate the instantaneous bit rate of a data stream using a one second sliding window
| OpalBitRateCalculator::OpalBitRateCalculator | ( | ) |
Create the calculator
| void OpalBitRateCalculator::AddPacket | ( | PINDEX | size, |
| bool | marker | ||
| ) |
Add a new packet to the bit rate calculations
| void OpalBitRateCalculator::Flush | ( | ) |
|
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
|
inline |
Return earlist timestamp in history
References m_history.
|
inline |
Return number of frames in history
References m_history.
| unsigned OpalBitRateCalculator::GetHistoryFrames | ( | ) | const |
Return number of marker bits in history
|
inline |
Return number of bytes in history
References m_historySize.
|
static |
|
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)
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by GetEarliestHistoryTime(), and GetHistoryCount().
|
protected |
|
protected |
Referenced by GetHistorySize().
|
protected |
Referenced by GetQuanta().
|
protected |