Support starting off with not forwarding video (#623)

This commit is contained in:
Raja Subramanian
2022-04-19 12:37:53 +05:30
committed by GitHub
parent 50bd08e551
commit 75ec31f237
4 changed files with 68 additions and 34 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ func (t *MediaTrackReceiver) Restart() {
t.lock.Unlock()
if receiver != nil {
receiver.SetMaxExpectedSpatialLayer(sfu.DefaultMaxLayerSpatial)
receiver.SetMaxExpectedSpatialLayer(SpatialLayerForQuality(livekit.VideoQuality_HIGH))
t.MediaTrackSubscriptions.Restart()
}
}
+5 -1
View File
@@ -24,6 +24,7 @@ type SubscribedTrackParams struct {
MediaTrack types.MediaTrack
DownTrack *sfu.DownTrack
}
type SubscribedTrack struct {
params SubscribedTrackParams
subMuted atomic.Bool
@@ -36,10 +37,13 @@ type SubscribedTrack struct {
}
func NewSubscribedTrack(params SubscribedTrackParams) *SubscribedTrack {
return &SubscribedTrack{
s := &SubscribedTrack{
params: params,
debouncer: debounce.New(subscriptionDebounceInterval),
}
s.params.DownTrack.SetMaxSpatialLayer(SpatialLayerForQuality(livekit.VideoQuality_HIGH))
return s
}
func (t *SubscribedTrack) OnBind(f func()) {