Warn on ops queue full (#481)

Pass logger so that we can log with proper context.
This commit is contained in:
Raja Subramanian
2022-03-02 19:08:07 +05:30
committed by GitHub
parent bfa350451e
commit c743d2ab3a
7 changed files with 38 additions and 16 deletions
+4 -2
View File
@@ -110,13 +110,14 @@ type Options struct {
// NewBuffer constructs a new Buffer
func NewBuffer(ssrc uint32, vp, ap *sync.Pool) *Buffer {
logger := logger.Logger(logger.GetLogger()) // will be reset with correct context via SetLogger
b := &Buffer{
mediaSSRC: ssrc,
videoPool: vp,
audioPool: ap,
pliThrottle: int64(500 * time.Millisecond),
logger: logger.Logger(logger.GetLogger()), // will be reset with correct context via SetLogger
callbacksQueue: utils.NewOpsQueue(),
logger: logger,
callbacksQueue: utils.NewOpsQueue(logger),
}
b.bitrate.Store(make([]int64, len(b.bitrateHelper)))
b.extPackets.SetMinCapacity(7)
@@ -125,6 +126,7 @@ func NewBuffer(ssrc uint32, vp, ap *sync.Pool) *Buffer {
func (b *Buffer) SetLogger(logger logger.Logger) {
b.logger = logger
b.callbacksQueue.SetLogger(logger)
}
func (b *Buffer) Bind(params webrtc.RTPParameters, codec webrtc.RTPCodecCapability, o Options) {