Server-driven connection quality detection (#167)

This commit is contained in:
David Zhao
2021-11-03 21:05:20 -07:00
committed by GitHub
parent 862a212b93
commit aa9534b7fb
14 changed files with 818 additions and 81 deletions
+6 -1
View File
@@ -19,7 +19,8 @@ type SubscribedTrack struct {
publisherIdentity string
subMuted utils.AtomicFlag
pubMuted utils.AtomicFlag
debouncer func(func())
debouncer func(func())
}
func NewSubscribedTrack(publisherIdentity string, dt *sfu.DownTrack) *SubscribedTrack {
@@ -42,6 +43,10 @@ func (t *SubscribedTrack) DownTrack() *sfu.DownTrack {
return t.dt
}
func (t *SubscribedTrack) SubscribeLossPercentage() uint32 {
return FixedPointToPercent(t.DownTrack().CurrentMaxLossFraction())
}
// has subscriber indicated it wants to mute this track
func (t *SubscribedTrack) IsMuted() bool {
return t.subMuted.Get()