pacer

package
v0.0.0-...-559fa5e Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	// contains filtered or unexported fields
}

func NewBase

func NewBase(logger logger.Logger) *Base

func (*Base) SendPacket

func (b *Base) SendPacket(p *Packet) (int, error)

func (*Base) SetBitrate

func (b *Base) SetBitrate(_bitrate int)

func (*Base) SetInterval

func (b *Base) SetInterval(_interval time.Duration)

type ExtensionData

type ExtensionData struct {
	ID      uint8
	Payload []byte
}

type Factory

type Factory interface {
	NewPacer() (Pacer, error)
}

func NewPacerFactory

func NewPacerFactory(pacerType PacerType, opts ...PacerFactoryOpt) Factory

type NoQueue

type NoQueue struct {
	*Base
	// contains filtered or unexported fields
}

func NewNoQueue

func NewNoQueue(logger logger.Logger) *NoQueue

func (*NoQueue) Enqueue

func (n *NoQueue) Enqueue(p *Packet)

func (*NoQueue) Start

func (n *NoQueue) Start()

func (*NoQueue) Stop

func (n *NoQueue) Stop()

type Pacer

type Pacer interface {
	Start()
	Enqueue(p *Packet)
	Stop()

	SetInterval(interval time.Duration)
	SetBitrate(bitrate int)
}

type PacerFactory

type PacerFactory struct {
	// contains filtered or unexported fields
}

func (*PacerFactory) NewPacer

func (f *PacerFactory) NewPacer() (Pacer, error)

type PacerFactoryOpt

type PacerFactoryOpt func(params *pacerFactoryParams)

func WithBitrate

func WithBitrate(bitrate int) PacerFactoryOpt

func WithMaxLatency

func WithMaxLatency(maxLatency time.Duration) PacerFactoryOpt

func WithSendInterval

func WithSendInterval(sendInterval time.Duration) PacerFactoryOpt

func Withlogger

func Withlogger(logger logger.Logger) PacerFactoryOpt

type PacerLeakyBucket

type PacerLeakyBucket struct {
	*Base
	// contains filtered or unexported fields
}

func NewPacerLeakyBucket

func NewPacerLeakyBucket(interval time.Duration, bitrate int, maxLatency time.Duration, logger logger.Logger) *PacerLeakyBucket

func (*PacerLeakyBucket) Enqueue

func (p *PacerLeakyBucket) Enqueue(pkt *Packet)

func (*PacerLeakyBucket) SetBitrate

func (p *PacerLeakyBucket) SetBitrate(bitrate int)

func (*PacerLeakyBucket) Start

func (p *PacerLeakyBucket) Start()

func (*PacerLeakyBucket) Stop

func (p *PacerLeakyBucket) Stop()

type PacerType

type PacerType int
const (
	PassThroughPacer PacerType = iota
	NoQueuePacer
	LeakyBucketPacer
)

type Packet

type Packet struct {
	Header             *rtp.Header
	Extensions         []ExtensionData
	Payload            []byte
	AbsSendTimeExtID   uint8
	TransportWideExtID uint8
	Writer             RTPWriter
	Pool               *sync.Pool
	PoolEntity         *[]byte
	// contains filtered or unexported fields
}

type PacketTime

type PacketTime struct {
	// contains filtered or unexported fields
}

func NewPacketTime

func NewPacketTime() *PacketTime

func (*PacketTime) Get

func (p *PacketTime) Get() time.Time

type PassThrough

type PassThrough struct {
	*Base
}

func NewPassThrough

func NewPassThrough(logger logger.Logger) *PassThrough

func (*PassThrough) Enqueue

func (p *PassThrough) Enqueue(pkt *Packet)

func (*PassThrough) Start

func (p *PassThrough) Start()

func (*PassThrough) Stop

func (p *PassThrough) Stop()

type RTPWriter

type RTPWriter func(*rtp.Header, []byte) (int, error)

Jump to

Keyboard shortcuts

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