rfc8888

package
v0.1.37 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 5 Imported by: 7

Documentation

Overview

Package rfc8888 provides an interceptor that generates congestion control feedback reports as defined by RFC 8888.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*SenderInterceptor) error

An Option is a function that can be used to configure a SenderInterceptor

func SendInterval

func SendInterval(interval time.Duration) Option

SendInterval sets the feedback send interval for the interceptor

func SenderNow

func SenderNow(f func() time.Time) Option

SenderNow sets an alternative for the time.Now function.

func SenderTicker

func SenderTicker(f TickerFactory) Option

SenderTicker sets an alternative for time.Ticker.

type Recorder

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

Recorder records incoming RTP packets and their arrival times. Recorder can be used to create feedback reports as defined by RFC 8888.

func NewRecorder

func NewRecorder() *Recorder

NewRecorder creates a new Recorder

func (*Recorder) AddPacket

func (r *Recorder) AddPacket(ts time.Time, ssrc uint32, seq uint16, ecn uint8)

AddPacket writes a packet to the underlying stream.

func (*Recorder) BuildReport

func (r *Recorder) BuildReport(now time.Time, maxSize int) *rtcp.CCFeedbackReport

BuildReport creates a new rtcp.CCFeedbackReport containing all packets that were added by AddPacket and missing packets.

type SenderInterceptor

type SenderInterceptor struct {
	interceptor.NoOp
	// contains filtered or unexported fields
}

SenderInterceptor sends congestion control feedback as specified in RFC 8888.

func (*SenderInterceptor) BindRTCPWriter

BindRTCPWriter lets you modify any outgoing RTCP packets. It is called once per PeerConnection. The returned method will be called once per packet batch.

func (*SenderInterceptor) BindRemoteStream

BindRemoteStream lets you modify any incoming RTP packets. It is called once for per RemoteStream. The returned method will be called once per rtp packet.

func (*SenderInterceptor) Close

func (s *SenderInterceptor) Close() error

Close closes the interceptor.

type SenderInterceptorFactory

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

SenderInterceptorFactory is a interceptor.Factory for a SenderInterceptor

func NewSenderInterceptor

func NewSenderInterceptor(opts ...Option) (*SenderInterceptorFactory, error)

NewSenderInterceptor returns a new SenderInterceptorFactory configured with the given options.

func (*SenderInterceptorFactory) NewInterceptor

NewInterceptor constructs a new SenderInterceptor

type TickerFactory

type TickerFactory func(d time.Duration) ticker

TickerFactory is a factory to create new tickers

Jump to

Keyboard shortcuts

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