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
2022-03-07 14:59:01 +08:00
committed by GitHub
parent e5ffd38054
commit 608da4ba4b
11 changed files with 282 additions and 4 deletions
+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,