Improve video quality selection by using publisher feedback (#238)
This commit is contained in:
+4
-10
@@ -5,6 +5,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/sfu"
|
||||
)
|
||||
|
||||
type pliThrottle struct {
|
||||
@@ -14,13 +15,6 @@ type pliThrottle struct {
|
||||
lastSent map[uint32]int64
|
||||
}
|
||||
|
||||
// github.com/livekit/livekit-server/pkg/sfu/simulcast.go
|
||||
const (
|
||||
fullResolution = "f"
|
||||
halfResolution = "h"
|
||||
quarterResolution = "q"
|
||||
)
|
||||
|
||||
func newPLIThrottle(conf config.PLIThrottleConfig) *pliThrottle {
|
||||
return &pliThrottle{
|
||||
config: conf,
|
||||
@@ -35,11 +29,11 @@ func (t *pliThrottle) addTrack(ssrc uint32, rid string) {
|
||||
|
||||
var duration time.Duration
|
||||
switch rid {
|
||||
case fullResolution:
|
||||
case sfu.FullResolution:
|
||||
duration = t.config.HighQuality
|
||||
case halfResolution:
|
||||
case sfu.HalfResolution:
|
||||
duration = t.config.MidQuality
|
||||
case quarterResolution:
|
||||
case sfu.QuarterResolution:
|
||||
duration = t.config.LowQuality
|
||||
default:
|
||||
duration = t.config.MidQuality
|
||||
|
||||
Reference in New Issue
Block a user