mirror of
https://github.com/livekit/livekit.git
synced 2026-10-23 19:32:41 +00:00
Report publish & subscribe RTPStats as Telemetry events (#1506)
This commit is contained in:
1 parent
e7e8bbe72c
commit
5ff72a99b9
10 files changed
+184
-25
No files matched your search
@@ -87,6 +87,7 @@ type Buffer struct {
|
||||
onRtcpFeedback func([]rtcp.Packet)
|
||||
onRtcpSenderReport func(*RTCPSenderReportData)
|
||||
onFpsChanged func()
|
||||
onFinalRtpStats func(*RTPStats)
|
||||
|
||||
// logger
|
||||
logger logger.Logger
|
||||
@@ -321,6 +322,9 @@ func (b *Buffer) Close() error {
|
||||
if b.rtpStats != nil {
|
||||
b.rtpStats.Stop()
|
||||
b.logger.Infow("rtp stats", "direction", "upstream", "stats", b.rtpStats.ToString())
|
||||
if b.onFinalRtpStats != nil {
|
||||
b.onFinalRtpStats(b.rtpStats)
|
||||
}
|
||||
}
|
||||
|
||||
if b.onClose != nil {
|
||||
@@ -693,6 +697,10 @@ func (b *Buffer) OnRtcpSenderReport(fn func(srData *RTCPSenderReportData)) {
|
||||
b.onRtcpSenderReport = fn
|
||||
}
|
||||
|
||||
func (b *Buffer) OnFinalRtpStats(fn func(*RTPStats)) {
|
||||
b.onFinalRtpStats = fn
|
||||
}
|
||||
|
||||
// GetMediaSSRC returns the associated SSRC of the RTP stream
|
||||
func (b *Buffer) GetMediaSSRC() uint32 {
|
||||
return b.mediaSSRC
|
||||
|
||||
Reference in new issue
Block a user