Introduce DISCONNECTED connection quality. (#2265)
* Introduce `DISCONNECTED` connection quality. Currently, this state happens when any up stream track does not send any packets in an analysis window when it is expected to send packets. This can be used by participants to know the quality of a potentially disconnected participant. Previously, it took 20 - 30 seconds for the stale timeout to kick in and disconnect the limbo participant which triggered a participant update through which other participants knew about it. Previously, `POOR` quality was also overloaded to denote that the up stream is not sending any packets. With this change, that is a separate indicator, i. e. `DISCONNECTED`. * clean up * Update deps * spelling
This commit is contained in:
@@ -931,8 +931,7 @@ func (p *ParticipantImpl) GetConnectionQuality() *livekit.ConnectionQualityInfo
|
||||
numTracks++
|
||||
|
||||
score, quality := pt.(types.LocalMediaTrack).GetConnectionScoreAndQuality()
|
||||
if quality < minQuality {
|
||||
// WARNING NOTE: comparing protobuf enums directly
|
||||
if utils.IsConnectionQualityLower(minQuality, quality) {
|
||||
minQuality = quality
|
||||
minScore = score
|
||||
} else if quality == minQuality && score < minScore {
|
||||
@@ -942,8 +941,7 @@ func (p *ParticipantImpl) GetConnectionQuality() *livekit.ConnectionQualityInfo
|
||||
p.lock.Lock()
|
||||
trackID := pt.ID()
|
||||
if prevQuality, ok := p.tracksQuality[trackID]; ok {
|
||||
// WARNING NOTE: comparing protobuf enums directly
|
||||
if prevQuality > quality {
|
||||
if utils.IsConnectionQualityLower(prevQuality, quality) {
|
||||
numUpDrops++
|
||||
}
|
||||
}
|
||||
@@ -958,8 +956,7 @@ func (p *ParticipantImpl) GetConnectionQuality() *livekit.ConnectionQualityInfo
|
||||
numTracks++
|
||||
|
||||
score, quality := subTrack.DownTrack().GetConnectionScoreAndQuality()
|
||||
if quality < minQuality {
|
||||
// WARNING NOTE: comparing protobuf enums directly
|
||||
if utils.IsConnectionQualityLower(minQuality, quality) {
|
||||
minQuality = quality
|
||||
minScore = score
|
||||
} else if quality == minQuality && score < minScore {
|
||||
@@ -969,8 +966,7 @@ func (p *ParticipantImpl) GetConnectionQuality() *livekit.ConnectionQualityInfo
|
||||
p.lock.Lock()
|
||||
trackID := subTrack.ID()
|
||||
if prevQuality, ok := p.tracksQuality[trackID]; ok {
|
||||
// WARNING NOTE: comparing protobuf enums directly
|
||||
if prevQuality > quality {
|
||||
if utils.IsConnectionQualityLower(prevQuality, quality) {
|
||||
numDownDrops++
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user