Skip to content

Scoped speaker update - #280

Merged
boks1971 merged 2 commits into
masterfrom
raja_scroped_speaker_update
Dec 23, 2021
Merged

boks1971 merged 2 commits into
masterfrom
raja_scroped_speaker_update

Conversation

@boks1971

Copy link
Copy Markdown
Contributor

Include only participants a participant is subscribed to.

NOTE: Not doing this for active speaker changes for Protocol < 3.

Include only participants a participant is subscribed to.

NOTE: Not doing this for active speaker changes for Protocol < 3.
@boks1971
boks1971 requested a review from davidzhao December 22, 2021 11:44
Comment thread pkg/rtc/mediatrack.go
return err
}
subTrack := NewSubscribedTrack(SubscribedTrackParams{
PublisherID: t.params.ParticipantID,

@boks1971 boks1971 Dec 22, 2021 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once again, sid vs identity issues. Looks like we can swap out PublisherID for PublisherIdentity in SubscribedTrack. But, have left PublisherIdentity in there for now. Please let me know if it can be cleaned out and I will add a commit to this PR to clean that out.

Comment thread pkg/rtc/participant.go

var scopedSpeakers []*livekit.SpeakerInfo
for _, s := range speakers {
if p.IsSubscribedTo(s.Sid) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subscribedTo was keyed by identity, but SpeakerInfo only has SID. So, switching out the key to SID for the subscribedTo map which also necessitated the change in SubscribedTrack interface.

Comment thread pkg/rtc/participant.go
p.params.Logger.Debugw("added subscribedTrack",
"publisher", subTrack.PublisherIdentity(),
"publisherID", subTrack.PublisherID(),
"publisherIdentity", subTrack.PublisherIdentity(),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still using the PublisherIdentity just for logging. This and the log below are the only places where PublisherIdentity of SubscribedTrack is used.

@boks1971

Copy link
Copy Markdown
Contributor Author

excuse the misspelled branch name :-)

@davidzhao davidzhao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg, thanks for cleaning this up!

@boks1971
boks1971 merged commit 42a9b66 into master Dec 23, 2021
@boks1971
boks1971 deleted the raja_scroped_speaker_update branch December 23, 2021 03:43
aravindanve pushed a commit to aravindanve/livekit that referenced this pull request Sep 29, 2026
* Scoped speaker update

Include only participants a participant is subscribed to.

NOTE: Not doing this for active speaker changes for Protocol < 3.

* correct comment spelling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants