utils

package
v0.0.0-...-5f592e6 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRTPVersion      = errors.New("invalid RTP version")
	ErrRTPPayloadTypeMismatch = errors.New("RTP payload type mismatch")
	ErrRTPSSRCMismatch        = errors.New("RTP SSRC mismatch")
)

Functions

func CodecParametersFuzzySearch

func CodecParametersFuzzySearch(needle webrtc.RTPCodecParameters, haystack []webrtc.RTPCodecParameters) (webrtc.RTPCodecParameters, error)

Do a fuzzy find for a codec in the list of codecs Used for lookup up a codec in an existing list to find a match

func FindRTXPayloadType

func FindRTXPayloadType(needle webrtc.PayloadType, haystack []webrtc.RTPCodecParameters) webrtc.PayloadType

Given a CodecParameters find the RTX CodecParameters if one exists

func GetHeaderExtensionID

func GetHeaderExtensionID(extensions []interceptor.RTPHeaderExtension, extension webrtc.RTPHeaderExtensionCapability) int

GetHeaderExtensionID returns the ID of a header extension, or 0 if not found

func IsSimulcastMode

func IsSimulcastMode(m livekit.VideoLayer_Mode) bool

func ValidateRTPPacket

func ValidateRTPPacket(pkt *rtp.Packet, expectedPayloadType uint8, expectedSSRC uint32) error

ValidateRTPPacket checks for a valid RTP packet and returns an error if fields are incorrect

Types

type Debouncer

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

func NewDebouncer

func NewDebouncer(after time.Duration) *Debouncer

func (*Debouncer) Add

func (d *Debouncer) Add(f func())

func (*Debouncer) SetDuration

func (d *Debouncer) SetDuration(after time.Duration)

type DownTrackSpreader

type DownTrackSpreader[T sender] struct {
	// contains filtered or unexported fields
}

func NewDownTrackSpreader

func NewDownTrackSpreader[T sender](params DownTrackSpreaderParams) *DownTrackSpreader[T]

func (*DownTrackSpreader[T]) Broadcast

func (d *DownTrackSpreader[T]) Broadcast(writer func(T))

func (*DownTrackSpreader[T]) DownTrackCount

func (d *DownTrackSpreader[T]) DownTrackCount() int

func (*DownTrackSpreader[T]) Free

func (d *DownTrackSpreader[T]) Free(subscriberID livekit.ParticipantID)

func (*DownTrackSpreader[T]) GetDownTracks

func (d *DownTrackSpreader[T]) GetDownTracks() []T

func (*DownTrackSpreader[T]) HasDownTrack

func (d *DownTrackSpreader[T]) HasDownTrack(subscriberID livekit.ParticipantID) bool

func (*DownTrackSpreader[T]) ResetAndGetDownTracks

func (d *DownTrackSpreader[T]) ResetAndGetDownTracks() []T

func (*DownTrackSpreader[T]) Store

func (d *DownTrackSpreader[T]) Store(sender T)

type DownTrackSpreaderParams

type DownTrackSpreaderParams struct {
	Threshold int
	Logger    logger.Logger
}

type RangeMap

type RangeMap[RT rangeType, VT valueType] struct {
	// contains filtered or unexported fields
}

func NewRangeMap

func NewRangeMap[RT rangeType, VT valueType](size int) *RangeMap[RT, VT]

func (*RangeMap[RT, VT]) ClearAndResetValue

func (r *RangeMap[RT, VT]) ClearAndResetValue(start RT, val VT)

func (*RangeMap[RT, VT]) DecValue

func (r *RangeMap[RT, VT]) DecValue(end RT, dec VT)

func (*RangeMap[RT, VT]) ExcludeRange

func (r *RangeMap[RT, VT]) ExcludeRange(startInclusive RT, endExclusive RT) error

func (*RangeMap[RT, VT]) GetValue

func (r *RangeMap[RT, VT]) GetValue(key RT) (VT, error)

func (*RangeMap[RT, VT]) MarshalLogObject

func (r *RangeMap[RT, VT]) MarshalLogObject(e zapcore.ObjectEncoder) error

Jump to

Keyboard shortcuts

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