Log rtp stats for debugging large gaps or all packets getting reported lost (#559)

This commit is contained in:
Raja Subramanian
2022-03-23 15:12:45 +05:30
committed by GitHub
parent 534cc01b85
commit 06ea1d2ad3
3 changed files with 42 additions and 2 deletions
+7
View File
@@ -109,8 +109,14 @@ func NewBuffer(ssrc uint32, vp, ap *sync.Pool) *Buffer {
}
func (b *Buffer) SetLogger(logger logger.Logger) {
b.Lock()
defer b.Unlock()
b.logger = logger
b.callbacksQueue.SetLogger(logger)
if b.rtpStats != nil {
b.rtpStats.SetLogger(logger)
}
}
func (b *Buffer) Bind(params webrtc.RTPParameters, codec webrtc.RTPCodecCapability, o Options) {
@@ -122,6 +128,7 @@ func (b *Buffer) Bind(params webrtc.RTPParameters, codec webrtc.RTPCodecCapabili
b.rtpStats = NewRTPStats(RTPStatsParams{
ClockRate: codec.ClockRate,
Logger: b.logger,
})
b.rrSnapshotId = b.rtpStats.NewSnapshotId()
b.connectionQualitySnapshotId = b.rtpStats.NewSnapshotId()