* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* Clean up

* Clean up

* Store RTT in stats

* spelling mistake

* Make tests compile

* Fix test compilation error

* fix tests

* clone

* latest protocol
This commit is contained in:
Raja Subramanian
2022-02-08 12:53:14 +05:30
committed by GitHub
parent a6eb4290d3
commit 36289bbca7
23 changed files with 913 additions and 639 deletions
+6 -4
View File
@@ -26,7 +26,7 @@ func NewNACKQueue() *NackQueue {
}
}
func (n *NackQueue) SetRTT(rtt int) {
func (n *NackQueue) SetRTT(rtt uint32) {
n.rtt = time.Duration(rtt) * time.Millisecond
}
@@ -52,9 +52,9 @@ func (n *NackQueue) Push(sn uint16) {
n.nacks = append(n.nacks, &nack{seqNum: sn, nacked: 0, lastNackTime: time.Now()})
}
func (n *NackQueue) Pairs() []rtcp.NackPair {
func (n *NackQueue) Pairs() ([]rtcp.NackPair, int) {
if len(n.nacks) == 0 {
return nil
return nil, 0
}
now := time.Now()
@@ -64,6 +64,7 @@ func (n *NackQueue) Pairs() []rtcp.NackPair {
snsToPurge := []uint16{}
numSeqNumsNacked := 0
isPairActive := false
var np rtcp.NackPair
var nps []rtcp.NackPair
@@ -77,6 +78,7 @@ func (n *NackQueue) Pairs() []rtcp.NackPair {
nack.nacked++
nack.lastNackTime = now
numSeqNumsNacked++
if (nack.seqNum - baseSN) > 16 {
// need a new nack pair
@@ -104,5 +106,5 @@ func (n *NackQueue) Pairs() []rtcp.NackPair {
n.Remove(sn)
}
return nps
return nps, numSeqNumsNacked
}