stats for pli and bitrate (#487)

* stats for pli and bitrate

* solve comments

* return 0 if no pli sent
This commit is contained in:
cnderrauber authored and GitHub committed 2022-03-07 14:59:01 +08:00
1 parent e5ffd38054
commit 608da4ba4b
11 files changed
+282 -4

No files matched your search

+5
View File
@@ -321,6 +321,10 @@ func (b *Buffer) SetRTT(rtt uint32) {
}
}
func (b *Buffer) LastPLI() int64 {
return b.lastPli
}
func (b *Buffer) calc(pkt []byte, arrivalTime int64) {
isRTX := false
@@ -638,6 +642,7 @@ func (b *Buffer) buildReceptionReport() *rtcp.ReceptionReport {
packetsLost: b.stats.TotalPacketsLost,
lastLossRate: lossRate,
}
b.stats.LostRate = lossRate
return &rtcp.ReceptionReport{
SSRC: b.mediaSSRC,