Allow publishers to set layer availability (#51)
* support client message to update active layers * update to match new protocol
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/pion/rtcp"
|
||||
"github.com/pion/webrtc/v3"
|
||||
"github.com/pion/webrtc/v3/pkg/rtcerr"
|
||||
"github.com/thoas/go-funk"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
@@ -105,6 +106,17 @@ func (t *MediaTrack) SetMuted(muted bool) {
|
||||
t.lock.RUnlock()
|
||||
}
|
||||
|
||||
func (t *MediaTrack) SetSimulcastLayers(layers []livekit.VideoQuality) {
|
||||
t.lock.RLock()
|
||||
defer t.lock.RUnlock()
|
||||
if t.receiver != nil {
|
||||
layers16 := funk.Map(layers, func(l livekit.VideoQuality) uint16 {
|
||||
return uint16(spatialLayerForQuality(l))
|
||||
}).([]uint16)
|
||||
t.receiver.SetAvailableLayers(layers16)
|
||||
}
|
||||
}
|
||||
|
||||
func (t *MediaTrack) OnClose(f func()) {
|
||||
t.onClose = f
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user