Deficient state handling when a track needs a change (#261)
* WIP commit * deficient handling * Add missing ProvisionalAllocatePrepare * adjust state on track removal * Increase test timeout * - Add comments about cooperative routines - Take down transition if available in cooperative scheme - Use layer comparison when taking down transition. Because of when the bitrate is measured, it is not always guaranteed bandwidthDelta is -ve when moving down. - Do not add track to stream allocator till bind. * make comment better * a bit more clear comments * Use OnBind on subscribed track
This commit is contained in:
@@ -24,6 +24,8 @@ type SubscribedTrack struct {
|
||||
pubMuted utils.AtomicFlag
|
||||
settings atomic.Value // *livekit.UpdateTrackSettings
|
||||
|
||||
onBind func()
|
||||
|
||||
debouncer func(func())
|
||||
}
|
||||
|
||||
@@ -36,6 +38,16 @@ func NewSubscribedTrack(mediaTrack types.MediaTrack, publisherIdentity string, d
|
||||
}
|
||||
}
|
||||
|
||||
func (t *SubscribedTrack) OnBind(f func()) {
|
||||
t.onBind = f
|
||||
}
|
||||
|
||||
func (t *SubscribedTrack) Bound() {
|
||||
if t.onBind != nil {
|
||||
t.onBind()
|
||||
}
|
||||
}
|
||||
|
||||
func (t *SubscribedTrack) ID() string {
|
||||
return t.dt.ID()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user