utils

package
v0.0.0-...-3182002 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 9 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 GetHeaderExtensionID

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

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

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

type WrapAround

type WrapAround[T number, ET extendedNumber] struct {
	// contains filtered or unexported fields
}

func NewWrapAround

func NewWrapAround[T number, ET extendedNumber](params WrapAroundParams) *WrapAround[T, ET]

func (*WrapAround[T, ET]) GetExtendedHighest

func (w *WrapAround[T, ET]) GetExtendedHighest() ET

func (*WrapAround[T, ET]) GetExtendedStart

func (w *WrapAround[T, ET]) GetExtendedStart() ET

func (*WrapAround[T, ET]) GetHighest

func (w *WrapAround[T, ET]) GetHighest() T

func (*WrapAround[T, ET]) GetStart

func (w *WrapAround[T, ET]) GetStart() T

func (*WrapAround[T, ET]) ResetHighest

func (w *WrapAround[T, ET]) ResetHighest(ev ET)

func (*WrapAround[T, ET]) RollbackRestart

func (w *WrapAround[T, ET]) RollbackRestart(ev ET)

func (*WrapAround[T, ET]) Seed

func (w *WrapAround[T, ET]) Seed(from *WrapAround[T, ET])

func (*WrapAround[T, ET]) Update

func (w *WrapAround[T, ET]) Update(val T) (result WrapAroundUpdateResult[ET])

type WrapAroundParams

type WrapAroundParams struct {
	IsRestartAllowed bool
}

type WrapAroundUpdateResult

type WrapAroundUpdateResult[ET extendedNumber] struct {
	IsUnhandled        bool // when set, other fields are invalid
	IsRestart          bool
	PreExtendedStart   ET // valid only if IsRestart = true
	PreExtendedHighest ET
	ExtendedVal        ET
}

Jump to

Keyboard shortcuts

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