rtc: add GetSubscribedDataTracks to LocalParticipant (#4862)

SubscriptionManager tracks data-track subscriptions but exposed no accessor
for the active ones, so callers could see subscribed and published media tracks
and published data tracks, but not subscribed data tracks. Add
GetSubscribedDataTracks(), returning the bound data down-tracks, mirroring
GetSubscribedTracks() for media, so a participant's full track set can be
accounted for. Regenerated the LocalParticipant fake.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Raja Subramanian
2026-09-12 20:00:53 +05:30
committed by GitHub
co-authored by Claude Opus 4.8
parent a487105a64
commit 1d3ff5621c
3 changed files with 77 additions and 0 deletions
+13
View File
@@ -307,6 +307,19 @@ func (m *SubscriptionManager) GetSubscribedTracks() []types.SubscribedTrack {
return tracks
}
func (m *SubscriptionManager) GetSubscribedDataTracks() []types.DataDownTrack {
m.lock.RLock()
defer m.lock.RUnlock()
tracks := make([]types.DataDownTrack, 0, len(m.dataTrackSubscriptions))
for _, s := range m.dataTrackSubscriptions {
if dt := s.getDataDownTrack(); dt != nil {
tracks = append(tracks, dt)
}
}
return tracks
}
func (m *SubscriptionManager) IsTrackNameSubscribed(publisherIdentity livekit.ParticipantIdentity, trackName string) bool {
m.lock.RLock()
defer m.lock.RUnlock()