pacer

package
v0.0.0-...-3a52945 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 8 Imported by: 0

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

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) Run

func (p *LeakyBucketPacer) Run()

Run starts 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL