Check for multiple layers for managed track. (#3622)

The previous check was checking only for simulcast and would have made a
screen share track published with multiple layers using SVC as
unmanaged.
This commit is contained in:
Raja Subramanian
2025-04-24 10:02:38 +05:30
committed by GitHub
parent 4955ebe423
commit 34a2e2c107
3 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -1637,7 +1637,7 @@ func (t *PCTransport) AddTrackToStreamAllocator(subTrack types.SubscribedTrack)
t.streamAllocator.AddTrack(subTrack.DownTrack(), streamallocator.AddTrackParams{ t.streamAllocator.AddTrack(subTrack.DownTrack(), streamallocator.AddTrackParams{
Source: subTrack.MediaTrack().Source(), Source: subTrack.MediaTrack().Source(),
IsSimulcast: subTrack.MediaTrack().IsSimulcast(), IsMultiLayered: len(subTrack.MediaTrack().ToProto().GetLayers()) > 1,
PublisherID: subTrack.MediaTrack().PublisherID(), PublisherID: subTrack.MediaTrack().PublisherID(),
}) })
} }
+2 -2
View File
@@ -275,7 +275,7 @@ func (s *StreamAllocator) SetSendSideBWEInterceptor(sendSideBWEInterceptor cc.Ba
type AddTrackParams struct { type AddTrackParams struct {
Source livekit.TrackSource Source livekit.TrackSource
Priority uint8 Priority uint8
IsSimulcast bool IsMultiLayered bool
PublisherID livekit.ParticipantID PublisherID livekit.ParticipantID
} }
@@ -284,7 +284,7 @@ func (s *StreamAllocator) AddTrack(downTrack *sfu.DownTrack, params AddTrackPara
return return
} }
track := NewTrack(downTrack, params.Source, params.IsSimulcast, params.PublisherID, s.params.Logger) track := NewTrack(downTrack, params.Source, params.IsMultiLayered, params.PublisherID, s.params.Logger)
track.SetPriority(params.Priority) track.SetPriority(params.Priority)
trackID := livekit.TrackID(downTrack.ID()) trackID := livekit.TrackID(downTrack.ID())
+4 -4
View File
@@ -25,7 +25,7 @@ import (
type Track struct { type Track struct {
downTrack *sfu.DownTrack downTrack *sfu.DownTrack
source livekit.TrackSource source livekit.TrackSource
isSimulcast bool isMultiLayered bool
priority uint8 priority uint8
publisherID livekit.ParticipantID publisherID livekit.ParticipantID
logger logger.Logger logger logger.Logger
@@ -43,14 +43,14 @@ type Track struct {
func NewTrack( func NewTrack(
downTrack *sfu.DownTrack, downTrack *sfu.DownTrack,
source livekit.TrackSource, source livekit.TrackSource,
isSimulcast bool, isMultiLayered bool,
publisherID livekit.ParticipantID, publisherID livekit.ParticipantID,
logger logger.Logger, logger logger.Logger,
) *Track { ) *Track {
t := &Track{ t := &Track{
downTrack: downTrack, downTrack: downTrack,
source: source, source: source,
isSimulcast: isSimulcast, isMultiLayered: isMultiLayered,
publisherID: publisherID, publisherID: publisherID,
logger: logger, logger: logger,
streamState: StreamStateInactive, streamState: StreamStateInactive,
@@ -110,7 +110,7 @@ func (t *Track) DownTrack() *sfu.DownTrack {
} }
func (t *Track) IsManaged() bool { func (t *Track) IsManaged() bool {
return t.source != livekit.TrackSource_SCREEN_SHARE || t.isSimulcast return t.source != livekit.TrackSource_SCREEN_SHARE || t.isMultiLayered
} }
func (t *Track) ID() livekit.TrackID { func (t *Track) ID() livekit.TrackID {