make reception report public
This commit is contained in:
+14
-2
@@ -349,7 +349,7 @@ func (b *Buffer) buildTransportCCPacket() *rtcp.TransportLayerCC {
|
||||
return rtcpTCC
|
||||
}
|
||||
|
||||
func (b *Buffer) buildReceptionReport() rtcp.ReceptionReport {
|
||||
func (b *Buffer) BuildReceptionReport() rtcp.ReceptionReport {
|
||||
extMaxSeq := b.cycles | uint32(b.maxSeqNo)
|
||||
expected := extMaxSeq - uint32(b.baseSN) + 1
|
||||
lost := expected - b.packetCount
|
||||
@@ -402,7 +402,7 @@ func (b *Buffer) BuildRTCP() (rtcp.ReceptionReport, []rtcp.Packet) {
|
||||
var pkts []rtcp.Packet
|
||||
var report rtcp.ReceptionReport
|
||||
|
||||
report = b.buildReceptionReport()
|
||||
report = b.BuildReceptionReport()
|
||||
|
||||
if b.remb {
|
||||
pkts = append(pkts, b.buildREMBPacket())
|
||||
@@ -440,3 +440,15 @@ func (b *Buffer) onLostHandler(fn func(nack *rtcp.TransportLayerNack)) {
|
||||
b.pktQueue.onLost = fn
|
||||
}
|
||||
}
|
||||
|
||||
type BufferStats struct {
|
||||
TotalBytes uint64
|
||||
LastPacketTime int64
|
||||
}
|
||||
|
||||
func (b *Buffer) Stats() BufferStats {
|
||||
return BufferStats{
|
||||
TotalBytes: b.totalByte,
|
||||
LastPacketTime: b.lastPacketTime,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user