Update deque and friends. (#3276)
This commit is contained in:
@@ -153,7 +153,7 @@ func NewBuffer(ssrc uint32, maxVideoPkts, maxAudioPkts int) *Buffer {
|
||||
logger: l.WithComponent(sutils.ComponentPub).WithComponent(sutils.ComponentSFU),
|
||||
}
|
||||
b.readCond = sync.NewCond(&b.RWMutex)
|
||||
b.extPackets.SetMinCapacity(7)
|
||||
b.extPackets.SetBaseCap(128)
|
||||
return b
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ func NewProber(params ProberParams) *Prober {
|
||||
p := &Prober{
|
||||
params: params,
|
||||
}
|
||||
p.clusters.SetMinCapacity(2)
|
||||
p.clusters.SetBaseCap(2)
|
||||
return p
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ type BitrateCalculator struct {
|
||||
windowDuration time.Duration
|
||||
duration time.Duration
|
||||
|
||||
windows *deque.Deque[bitrateWindow]
|
||||
windows deque.Deque[bitrateWindow]
|
||||
active bitrateWindow
|
||||
|
||||
bytes int
|
||||
@@ -37,10 +37,10 @@ func NewBitrateCalculator(duration time.Duration, window time.Duration) *Bitrate
|
||||
c := &BitrateCalculator{
|
||||
duration: duration,
|
||||
windowDuration: window,
|
||||
windows: deque.New[bitrateWindow](windowCnt+1, windowCnt+1),
|
||||
start: now,
|
||||
active: bitrateWindow{start: now},
|
||||
}
|
||||
c.windows.SetBaseCap(windowCnt + 1)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ func NewLeakyBucket(logger logger.Logger, bwe bwe.BWE, interval time.Duration, b
|
||||
interval: interval,
|
||||
bitrate: bitrate,
|
||||
}
|
||||
l.packets.SetMinCapacity(9)
|
||||
l.packets.SetBaseCap(512)
|
||||
|
||||
go l.sendWorker()
|
||||
return l
|
||||
|
||||
@@ -40,7 +40,7 @@ func NewNoQueue(logger logger.Logger, bwe bwe.BWE) *NoQueue {
|
||||
logger: logger,
|
||||
wake: make(chan struct{}, 1),
|
||||
}
|
||||
n.packets.SetMinCapacity(9)
|
||||
n.packets.SetBaseCap(512)
|
||||
|
||||
go n.sendWorker()
|
||||
return n
|
||||
|
||||
Reference in New Issue
Block a user