Documentation ¶
Overview ¶
modified version of pion interceptor leaky_bucket_pacer.go https://github.com/pion/interceptor/blob/master/pkg/gcc/leaky_bucket_pacer.go
Index ¶
- Variables
- type LeakyBucketPacer
- func (p *LeakyBucketPacer) AddStream(ssrc uint32, writer interceptor.RTPWriter)
- func (p *LeakyBucketPacer) Close() error
- func (p *LeakyBucketPacer) Run()
- func (p *LeakyBucketPacer) SetTargetBitrate(rate int)
- func (p *LeakyBucketPacer) Write(header *rtp.Header, payload []byte, attributes interceptor.Attributes) (int, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoQueueFound = errors.New("no queue found for ssrc") ErrDuplicate = errors.New("packet sequence already exists in the queue") )
Functions ¶
This section is empty.
Types ¶
type LeakyBucketPacer ¶
type LeakyBucketPacer struct {
// contains filtered or unexported fields
}
LeakyBucketPacer implements a leaky bucket pacing algorithm
func NewLeakyBucketPacer ¶
func NewLeakyBucketPacer(log logging.LeveledLogger, initialBitrate int, allowDuplicate bool) *LeakyBucketPacer
NewLeakyBucketPacer initializes a new LeakyBucketPacer
func (*LeakyBucketPacer) AddStream ¶
func (p *LeakyBucketPacer) AddStream(ssrc uint32, writer interceptor.RTPWriter)
AddStream adds a new stream and its corresponding writer to the pacer
func (*LeakyBucketPacer) Close ¶
func (p *LeakyBucketPacer) Close() error
Close closes the LeakyBucketPacer
func (*LeakyBucketPacer) SetTargetBitrate ¶
func (p *LeakyBucketPacer) SetTargetBitrate(rate int)
SetTargetBitrate updates the target bitrate at which the pacer is allowed to send packets. The pacer may exceed this limit by p.f
func (*LeakyBucketPacer) Write ¶
func (p *LeakyBucketPacer) Write(header *rtp.Header, payload []byte, attributes interceptor.Attributes) (int, error)
Write sends a packet with header and payload the a previously registered stream.
Click to show internal directories.
Click to hide internal directories.