Shaka Packager SDK
Classes | Public Member Functions | Static Public Attributes | List of all members
shaka::BandwidthEstimator Class Reference

Public Member Functions

 BandwidthEstimator (size_t num_blocks)
 
void AddBlock (uint64_t size, double duration)
 
uint64_t Estimate () const
 
uint64_t Max () const
 

Static Public Attributes

static constexpr size_t kUseAllBlocks = 0
 

Detailed Description

Definition at line 17 of file bandwidth_estimator.h.

Member Function Documentation

◆ AddBlock()

void shaka::BandwidthEstimator::AddBlock ( uint64_t  size,
double  duration 
)
Parameters
sizeis the size of the block in bytes. Should be positive.
durationis the length in seconds. Should be positive.

Definition at line 19 of file bandwidth_estimator.cc.

◆ Estimate()

uint64_t shaka::BandwidthEstimator::Estimate ( ) const
Returns
The estimate bandwidth, in bits per second, from the harmonic mean of the number of blocks specified in the constructor. The value is rounded up to the nearest integer.

Definition at line 28 of file bandwidth_estimator.cc.

◆ Max()

uint64_t shaka::BandwidthEstimator::Max ( ) const
Returns
The max bandwidth, in bits per second, of the number of blocks specified in the constructor. The value is rounded up to the nearest integer.

Definition at line 35 of file bandwidth_estimator.cc.

Member Data Documentation

◆ kUseAllBlocks

constexpr size_t shaka::BandwidthEstimator::kUseAllBlocks = 0
static
Parameters
num_blocksis the number of latest blocks to use. 0 uses all.

Definition at line 20 of file bandwidth_estimator.h.


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