Documentation
¶
Index ¶
- Constants
- func NewReceiver(id uint8, sendRtcp func(packet rtcp.Packet)) *receiver
- func NewSender(initialBitrate uint64) *sender
- type AimdRateControl
- func (c *AimdRateControl) FeedbackInterval() Duration
- func (c *AimdRateControl) GetExpectedBandwidthPeriod() Duration
- func (c *AimdRateControl) LatestEstimate() Bitrate
- func (c *AimdRateControl) SetEstimate(bitrate Bitrate, now int64)
- func (c *AimdRateControl) SetStartBitrate(startBitrate Bitrate)
- func (c *AimdRateControl) TimeToReduceFurther(ms int64, rate Bitrate) bool
- func (c *AimdRateControl) Update(input RateControllerInput, now int64) Bitrate
- func (c *AimdRateControl) ValidEstimate() bool
- type Bitrate
- type Clock
- type Cluster
- type DataSize
- type Duration
- type LinkCapacityEstimator
- func (l *LinkCapacityEstimator) Estimate() Bitrate
- func (l *LinkCapacityEstimator) HasEstimate() bool
- func (l *LinkCapacityEstimator) LowerBound() Bitrate
- func (l *LinkCapacityEstimator) OnOveruseDetected(throughput Bitrate)
- func (l *LinkCapacityEstimator) Reset()
- func (l *LinkCapacityEstimator) UpperBound() Bitrate
- type LinkCapacityTracker
- type NetworkStateEstimate
- type OveruseDetector
- type OveruseEstimator
- type Probe
- type RateControllerInput
- type RateStatistics
- type SendSideBandwidthEstimation
- type SimulatedClock
Constants ¶
View Source
const ( InitializationTime = 5000 // 5s FrameInterval = 1000 / 30 PacketSize = 1200 MinIncreaseRateBpsPerSecond = 4000 DefaultRTT = 200 )
View Source
const ( RcHold = 0 RcIncrease = 1 RcDecrease = 2 MinPeriod = Second * 2 DefaultPeriod = Second * 3 MaxPeriod = Second * 50 )
View Source
const ( BitPerSecond Bitrate = 1 BytePerSecond = 8 * BitPerSecond KilobitsPerSecond = 1000 * BitPerSecond )
View Source
const ( Microsecond Duration = 1 // 1μs Millisecond = 1000 * Microsecond Second = 1000 * Millisecond Minute = 60 * Second )
View Source
const ( Normal = 0 Overusing = 1 Underusing = 2 )
View Source
const ( MaxNumDeltas = 60 MaxAdaptOffsetMs = 15.0 )
View Source
const ( DeltaCounterMax = 1000 MinFramePeriodHistoryLength = 60 )
View Source
const ( AbsSendTimeInterArrivalUpshift = 8 UnlimitedRembNumPackets = 4 StreamTimeOutMs = 2000 InitialProbingIntervalMs = 2000 AbsSendTimeFraction = 18 InterArrivalShift = AbsSendTimeFraction + AbsSendTimeInterArrivalUpshift MaxProbePackets = 15 TimestampGroupLengthMs = 5 TimestampToMs = 1000.0 / (1 << InterArrivalShift) )
View Source
const ( BitrateWindowMs = 1000 NoUpdate = 0 Update = 1 ExpectedNumberOfProbes = 3 MinClusterDelta = 1 MinClusterSize = 4 )
View Source
const (
LimitNumPackets = 20
)
Variables ¶
This section is empty.
Functions ¶
func NewReceiver ¶
NewReceiver RemoteBitrate Estimator https://datatracker.ietf.org/doc/html/draft-alvestrand-rmcat-congestion-03
Types ¶
type AimdRateControl ¶
type AimdRateControl struct {
// contains filtered or unexported fields
}
func NewAimdRateControl ¶
func NewAimdRateControl() *AimdRateControl
func (*AimdRateControl) FeedbackInterval ¶
func (c *AimdRateControl) FeedbackInterval() Duration
func (*AimdRateControl) GetExpectedBandwidthPeriod ¶
func (c *AimdRateControl) GetExpectedBandwidthPeriod() Duration
func (*AimdRateControl) LatestEstimate ¶
func (c *AimdRateControl) LatestEstimate() Bitrate
func (*AimdRateControl) SetEstimate ¶
func (c *AimdRateControl) SetEstimate(bitrate Bitrate, now int64)
func (*AimdRateControl) SetStartBitrate ¶
func (c *AimdRateControl) SetStartBitrate(startBitrate Bitrate)
func (*AimdRateControl) TimeToReduceFurther ¶
func (c *AimdRateControl) TimeToReduceFurther(ms int64, rate Bitrate) bool
func (*AimdRateControl) Update ¶
func (c *AimdRateControl) Update(input RateControllerInput, now int64) Bitrate
func (*AimdRateControl) ValidEstimate ¶
func (c *AimdRateControl) ValidEstimate() bool
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
func (*Cluster) RecvBitrate ¶
func (*Cluster) SendBitrate ¶
type LinkCapacityEstimator ¶
type LinkCapacityEstimator struct {
// contains filtered or unexported fields
}
func NewLinkCapacityEstimator ¶
func NewLinkCapacityEstimator() *LinkCapacityEstimator
func (*LinkCapacityEstimator) Estimate ¶
func (l *LinkCapacityEstimator) Estimate() Bitrate
func (*LinkCapacityEstimator) HasEstimate ¶
func (l *LinkCapacityEstimator) HasEstimate() bool
func (*LinkCapacityEstimator) LowerBound ¶
func (l *LinkCapacityEstimator) LowerBound() Bitrate
func (*LinkCapacityEstimator) OnOveruseDetected ¶
func (l *LinkCapacityEstimator) OnOveruseDetected(throughput Bitrate)
func (*LinkCapacityEstimator) Reset ¶
func (l *LinkCapacityEstimator) Reset()
func (*LinkCapacityEstimator) UpperBound ¶
func (l *LinkCapacityEstimator) UpperBound() Bitrate
type LinkCapacityTracker ¶
type LinkCapacityTracker struct{}
type NetworkStateEstimate ¶
type NetworkStateEstimate struct {
}
Not implements.
func (*NetworkStateEstimate) LinkCapacityLower ¶
func (e *NetworkStateEstimate) LinkCapacityLower() Bitrate
type OveruseDetector ¶
type OveruseDetector struct {
// contains filtered or unexported fields
}
func NewOveruseDetector ¶
func NewOveruseDetector() *OveruseDetector
func (*OveruseDetector) State ¶
func (d *OveruseDetector) State() int
type OveruseEstimator ¶
type OveruseEstimator struct {
// contains filtered or unexported fields
}
func NewOveruseEstimator ¶
func NewOveruseEstimator() *OveruseEstimator
func (*OveruseEstimator) NumOfDeltas ¶
func (e *OveruseEstimator) NumOfDeltas() int
func (*OveruseEstimator) Offset ¶
func (e *OveruseEstimator) Offset() float64
type RateControllerInput ¶
type RateStatistics ¶
type RateStatistics struct {
// contains filtered or unexported fields
}
func NewRateStatistics ¶
func NewRateStatistics(windowSizeMs int64, scale float64) *RateStatistics
NewRateStatistics return a new RateStatistics. windowSizeMs: the calculate window. scale: the input size with bit and ms.
func (*RateStatistics) Rate ¶
func (r *RateStatistics) Rate(nowMs int64) *Bitrate
The Rate will return bit per second based on arrived time. The logic is quite simple, allPayloadSize / windowTime is the bitrate
func (*RateStatistics) Reset ¶
func (r *RateStatistics) Reset()
func (*RateStatistics) Update ¶
func (r *RateStatistics) Update(payloadSize int64, nowMs int64)
type SendSideBandwidthEstimation ¶
type SendSideBandwidthEstimation struct {
// contains filtered or unexported fields
}
func NewSendSideBandwidthEstimation ¶
func NewSendSideBandwidthEstimation() *SendSideBandwidthEstimation
func (*SendSideBandwidthEstimation) UpdatePacketsLost ¶
func (e *SendSideBandwidthEstimation) UpdatePacketsLost(packetsLost, numberOfPackets, nowMs int64)
func (*SendSideBandwidthEstimation) UpdateReceiverEstimate ¶
func (e *SendSideBandwidthEstimation) UpdateReceiverEstimate(nowMs int64, bitrate uint64)
type SimulatedClock ¶
type SimulatedClock struct {
// contains filtered or unexported fields
}
func (*SimulatedClock) Add ¶
func (c *SimulatedClock) Add(duration Duration)
func (*SimulatedClock) NowMs ¶
func (c *SimulatedClock) NowMs() int64
Click to show internal directories.
Click to hide internal directories.