Skip to content

Commit

Permalink
fix track stats
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohan Totting committed Aug 19, 2024
1 parent 1a95617 commit 54a7f3e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion clienttrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ func (t *clientTrack) SetMaxQuality(_ QualityLevel) {
}

func (t *clientTrack) MaxQuality() QualityLevel {
return QualityHigh
if t.Kind() == webrtc.RTPCodecTypeVideo {
return QualityHigh
}

return QualityAudio
}

func (t *clientTrack) SSRC() webrtc.SSRC {
Expand Down
5 changes: 5 additions & 0 deletions clienttrackred.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,8 @@ func extractPrimaryEncodingForRED(payload []byte) ([]byte, error) {
func (t *clientTrackRed) Quality() QualityLevel {
return QualityAudioRed
}

func (t *clientTrackRed) MaxQuality() QualityLevel {

return QualityAudioRed
}
4 changes: 4 additions & 0 deletions clienttracksvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ func (t *scaleableClientTrack) setLastQuality(quality QualityLevel) {
t.lastQuality = quality
}

func (t *scaleableClientTrack) Quality() QualityLevel {
return t.LastQuality()
}

func (t *scaleableClientTrack) LastQuality() QualityLevel {
t.mu.RLock()
defer t.mu.RUnlock()
Expand Down

0 comments on commit 54a7f3e

Please sign in to comment.