Report publish & subscribe RTPStats as Telemetry events (#1506)

This commit is contained in:
David Zhao
2023-03-10 10:28:54 -08:00
committed by GitHub
parent e7e8bbe72c
commit 5ff72a99b9
10 changed files with 184 additions and 25 deletions
+14 -2
View File
@@ -543,6 +543,20 @@ func (m *SubscriptionManager) handleSubscribedTrackClose(s *trackSubscription, w
&livekit.TrackInfo{Sid: string(s.trackID), Type: subTrack.MediaTrack().Kind()},
!willBeResumed && !m.params.Participant.IsClosed(),
)
dt := subTrack.DownTrack()
if dt != nil {
stats := dt.GetTrackStats()
if stats != nil {
m.params.Telemetry.TrackSubscribeRTPStats(
context.Background(),
m.params.Participant.ID(),
s.trackID,
subTrack.DownTrack().Codec().MimeType,
stats,
)
}
}
}
if !willBeResumed {
@@ -564,9 +578,7 @@ func (m *SubscriptionManager) handleSubscribedTrackClose(s *trackSubscription, w
}
}
}
}
if !willBeResumed {
m.params.Participant.Negotiate(false)
}
m.queueReconcile(s.trackID)