Misc/minor clean up. (#3183)
Cosmetic. While thinking through how to structure probing better, noticing small things here and there. Cleaning up and making some small PRs along the way.
This commit is contained in:
@@ -89,6 +89,9 @@ type BWE interface {
|
||||
repeatedNacks uint32,
|
||||
)
|
||||
|
||||
// TWCC sequence number
|
||||
RecordPacketSendAndGetSequenceNumber(atMicro int64, size int, isRTX bool) uint16
|
||||
|
||||
HandleTWCCFeedback(report *rtcp.TransportLayerCC)
|
||||
|
||||
ProbingStart(expectedBandwidthUsage int64)
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
|
||||
package bwe
|
||||
|
||||
import "github.com/pion/rtcp"
|
||||
import (
|
||||
"github.com/pion/rtcp"
|
||||
)
|
||||
|
||||
type NullBWE struct {
|
||||
}
|
||||
@@ -25,6 +27,10 @@ func (n *NullBWE) Reset() {}
|
||||
|
||||
func (n *NullBWE) Stop() {}
|
||||
|
||||
func (n *NullBWE) RecordPacketSendAndGetSequenceNumber(_atMicro int64, _size int, _isRTX bool) uint16 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (n *NullBWE) HandleREMB(
|
||||
_receivedEstimate int64,
|
||||
_isProbeFinalizing bool,
|
||||
|
||||
@@ -17,7 +17,6 @@ package sendsidebwe
|
||||
import (
|
||||
"math/rand"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/livekit/protocol/logger"
|
||||
"github.com/livekit/protocol/utils/mono"
|
||||
@@ -51,18 +50,17 @@ func newPacketTracker(params packetTrackerParams) *packetTracker {
|
||||
}
|
||||
|
||||
// SSBWE-TODO: this potentially needs to take isProbe as argument?
|
||||
func (p *packetTracker) RecordPacketSendAndGetSequenceNumber(at time.Time, size int, isRTX bool) uint16 {
|
||||
func (p *packetTracker) RecordPacketSendAndGetSequenceNumber(atMicro int64, size int, isRTX bool) uint16 {
|
||||
p.lock.Lock()
|
||||
defer p.lock.Unlock()
|
||||
|
||||
sendTime := at.UnixMicro()
|
||||
if p.baseSendTime == 0 {
|
||||
p.baseSendTime = sendTime
|
||||
p.baseSendTime = atMicro
|
||||
}
|
||||
|
||||
pi := p.getPacketInfo(uint16(p.sequenceNumber))
|
||||
pi.sequenceNumber = p.sequenceNumber
|
||||
pi.sendTime = sendTime - p.baseSendTime
|
||||
pi.sendTime = atMicro - p.baseSendTime
|
||||
pi.recvTime = 0
|
||||
pi.size = uint16(size)
|
||||
pi.isRTX = isRTX
|
||||
|
||||
Reference in New Issue
Block a user