Push track quality to poor on a bandwidth constrained pause. (#1867)

* Push track quality to poor on a bandwidth constrained pause.

* add tests

* scale distance by divisor

* fix test distance to desired

* wait longer for subscription manager to reconcile
This commit is contained in:
Raja Subramanian
2023-07-11 15:29:35 +05:30
committed by GitHub
parent 9abc580e8b
commit 5459bd2931
7 changed files with 118 additions and 40 deletions
+8 -1
View File
@@ -526,6 +526,13 @@ func (f *Forwarder) IsDeficient() bool {
return f.isDeficientLocked()
}
func (f *Forwarder) PauseReason() VideoPauseReason {
f.lock.RLock()
defer f.lock.RUnlock()
return f.lastAllocation.PauseReason
}
func (f *Forwarder) BandwidthRequested(brs Bitrates) int64 {
f.lock.RLock()
defer f.lock.RUnlock()
@@ -1865,7 +1872,7 @@ done:
((adjustedMaxLayer.Spatial - adjustedTargetLayer.Spatial) * (maxSeenLayer.Temporal + 1)) +
(adjustedMaxLayer.Temporal - adjustedTargetLayer.Temporal)
if !targetLayer.IsValid() {
distance++
distance += (maxSeenLayer.Temporal + 1)
}
return float64(distance) / float64(maxSeenLayer.Temporal+1)