Return ServerInfo to clients on join (#904)

* checkpoint

* Return ServerInfo in join response

* also include node information

* less verbose quality score

* update go modules
This commit is contained in:
David Zhao
2022-08-10 17:04:17 -07:00
committed by GitHub
parent 1b7c8ddba4
commit f09885825e
11 changed files with 183 additions and 99 deletions
+9 -3
View File
@@ -41,6 +41,7 @@ type ConnectionStats struct {
lock sync.RWMutex
score float32
lastUpdate time.Time
isLowQuality atomic.Bool
maxExpectedLayer int32
done chan struct{}
@@ -162,10 +163,15 @@ func (cs *ConnectionStats) updateScore(streams map[uint32]*buffer.StreamStatsWit
params.ExpectedWidth = expectedWidth
params.ExpectedHeight = expectedHeight
cs.score = VideoTrackScore(params)
}
if cs.score < 4.0 {
cs.params.Logger.Debugw("low connection quality score", "score", cs.score, "params", params)
if cs.score < 3.5 {
if !cs.isLowQuality.Swap(true) {
// changed from good to low quality, log
cs.params.Logger.Debugw("low connection quality", "score", cs.score, "params", params)
}
} else {
cs.isLowQuality.Store(false)
}
}
return cs.score