Stream Allocator Try 3 (#257)
* Stream Allocator Try 3 Making an intermediate PR to do - Special treatment for screen share tracks - When allocating all tracks, o try to stream all tracks by starting with the lowest layer o multi-pass across tracks to get a more even distribution Not yet done: ------------- In deficient state, o Allocate a specific track on a change o Steal from other tracks * Correct sense of managed track * have to range to copy * generate * fix VideoLayers compare * Use t.simulcasted
This commit is contained in:
@@ -96,6 +96,7 @@ func NewMediaTrack(track *webrtc.TrackRemote, params MediaTrackParams) *MediaTra
|
||||
|
||||
if params.TrackInfo != nil && t.Kind() == livekit.TrackType_VIDEO {
|
||||
t.UpdateVideoLayers(params.TrackInfo.Layers)
|
||||
// LK-TODO: maybe use this or simulcast flag in TrackInfo to set simulcasted here
|
||||
}
|
||||
return t
|
||||
}
|
||||
@@ -116,6 +117,14 @@ func (t *MediaTrack) Kind() livekit.TrackType {
|
||||
return t.params.TrackInfo.Type
|
||||
}
|
||||
|
||||
func (t *MediaTrack) Source() livekit.TrackSource {
|
||||
return t.params.TrackInfo.Source
|
||||
}
|
||||
|
||||
func (t *MediaTrack) IsSimulcast() bool {
|
||||
return t.simulcasted.Get()
|
||||
}
|
||||
|
||||
func (t *MediaTrack) Name() string {
|
||||
return t.params.TrackInfo.Name
|
||||
}
|
||||
@@ -391,6 +400,7 @@ func (t *MediaTrack) AddReceiver(receiver *webrtc.RTPReceiver, track *webrtc.Tra
|
||||
t.params.Telemetry.AddUpTrack(t.params.ParticipantID, buff)
|
||||
|
||||
atomic.AddUint32(&t.numUpTracks, 1)
|
||||
// LK-TODO: can remove this completely when VideoLayers protocol becomes the default as it has info from client or if we decide to use TrackInfo.Simulcast
|
||||
if atomic.LoadUint32(&t.numUpTracks) > 1 || track.RID() != "" {
|
||||
// cannot only rely on numUpTracks since we fire metadata events immediately after the first layer
|
||||
t.simulcasted.TrySet(true)
|
||||
|
||||
Reference in New Issue
Block a user