Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/config/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ type SDKSourceParams struct {
Identity string
TrackSource string
TrackKind string
ScreenShare bool
AudioInCodec types.MimeType
VideoInCodec types.MimeType
AudioTrack *TrackSource
Expand Down Expand Up @@ -302,6 +303,7 @@ func (p *PipelineConfig) Update(request *rpc.StartEgressRequest) error {
p.VideoEnabled = true
p.VideoDecoding = true
p.Identity = req.Participant.Identity
p.ScreenShare = req.Participant.ScreenShare
if p.Identity == "" {
return errors.ErrInvalidInput("identity")
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/pipeline/source/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (s *SDKSource) awaitParticipantTracks(identity string) (uint32, uint32, err
pubs := rp.TrackPublications()
expected := 0
for _, pub := range pubs {
if shouldSubscribe(pub) {
if s.shouldSubscribe(pub) {
expected++
}
}
Expand Down Expand Up @@ -525,7 +525,7 @@ func (s *SDKSource) onTrackPublished(pub *lksdk.RemoteTrackPublication, rp *lksd
return
}

if shouldSubscribe(pub) {
if s.shouldSubscribe(pub) {
if err := s.subscribe(pub); err != nil {
logger.Errorw("failed to subscribe to track", err, "trackID", pub.SID())
}
Expand All @@ -534,12 +534,12 @@ func (s *SDKSource) onTrackPublished(pub *lksdk.RemoteTrackPublication, rp *lksd
}
}

func shouldSubscribe(pub lksdk.TrackPublication) bool {
func (s *SDKSource) shouldSubscribe(pub lksdk.TrackPublication) bool {
switch pub.Source() {
case livekit.TrackSource_CAMERA, livekit.TrackSource_MICROPHONE:
return true
return !s.ScreenShare
default:
return false
return s.ScreenShare
}
}

Expand Down