jitter

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 7 Imported by: 13 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

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

func NewBuffer

func NewBuffer(
	depacketizer rtp.Depacketizer,
	latency time.Duration,
	fnc PacketFunc,
	opts ...Option,
) *Buffer

func (*Buffer) Close

func (b *Buffer) Close()

func (*Buffer) Flush

func (b *Buffer) Flush()

Flush drops all incomplete samples and emits any complete samples immediately. Useful when no more packets will arrive (e.g. track unsubscribed).

func (*Buffer) Push

func (b *Buffer) Push(pkt *rtp.Packet)

func (*Buffer) PushAt

func (b *Buffer) PushAt(pkt *rtp.Packet, receivedAt time.Time)

func (*Buffer) PushExtPacket

func (b *Buffer) PushExtPacket(extPkt ExtPacket)

func (*Buffer) PushExtPacketBatch

func (b *Buffer) PushExtPacketBatch(extPktBatch []ExtPacket)

func (*Buffer) Size

func (b *Buffer) Size() int

func (*Buffer) Stats

func (b *Buffer) Stats() *BufferStats

func (*Buffer) UpdateLatency

func (b *Buffer) UpdateLatency(latency time.Duration)

func (*Buffer) WithLogger

func (b *Buffer) WithLogger(logger logger.Logger) *Buffer

type BufferStats

type BufferStats struct {
	PacketsPushed  uint64 // total packets pushed
	PaddingPushed  uint64 // padding packets pushed
	PacketsLost    uint64 // packets lost
	PacketsDropped uint64 // packets dropped (incomplete)
	PacketsPopped  uint64 // packets sent to handler
	SamplesPopped  uint64 // samples sent to handler
}

func (*BufferStats) PacketLoss

func (s *BufferStats) PacketLoss() float64

type ExtPacket

type ExtPacket struct {
	ReceivedAt time.Time
	*rtp.Packet
}

type Option

type Option func(*Buffer)

func WithLogger

func WithLogger(logger logger.Logger) Option

func WithPacketLossHandler

func WithPacketLossHandler(handler PacketLossFunc) Option

type PacketFunc

type PacketFunc func(packets []ExtPacket)

type PacketLossFunc

type PacketLossFunc func(packetsLost, packetsDropped uint64)

PacketLossFunc is called when packet loss or drops are detected. packetsLost and packetsDropped represent the number of packets lost and dropped up to the point of the call.

Jump to

Keyboard shortcuts

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