twcc

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: 11 Imported by: 38

Documentation

Overview

Package twcc provides interceptors to implement transport wide congestion control.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeaderExtensionInterceptor

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

HeaderExtensionInterceptor adds transport wide sequence numbers as header extension to each RTP packet

func (*HeaderExtensionInterceptor) BindLocalStream

BindLocalStream returns a writer that adds a rtp.TransportCCExtension header with increasing sequence numbers to each outgoing packet.

type HeaderExtensionInterceptorFactory added in v0.1.0

type HeaderExtensionInterceptorFactory struct{}

HeaderExtensionInterceptorFactory is a interceptor.Factory for a HeaderExtensionInterceptor

func NewHeaderExtensionInterceptor

func NewHeaderExtensionInterceptor() (*HeaderExtensionInterceptorFactory, error)

NewHeaderExtensionInterceptor returns a HeaderExtensionInterceptorFactory

func (*HeaderExtensionInterceptorFactory) NewInterceptor added in v0.1.0

NewInterceptor constructs a new HeaderExtensionInterceptor

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 interval at which the interceptor will send new feedback reports.

type Recorder

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

Recorder records incoming RTP packets and their delays and creates transport wide congestion control feedback reports as specified in https://datatracker.ietf.org/doc/html/draft-holmer-rmcat-transport-wide-cc-extensions-01

func NewRecorder

func NewRecorder(senderSSRC uint32) *Recorder

NewRecorder creates a new Recorder which uses the given senderSSRC in the created feedback packets.

func (*Recorder) BuildFeedbackPacket

func (r *Recorder) BuildFeedbackPacket() []rtcp.Packet

BuildFeedbackPacket creates a new RTCP packet containing a TWCC feedback report.

func (*Recorder) PacketsHeld added in v0.1.18

func (r *Recorder) PacketsHeld() int

PacketsHeld returns the number of received packets currently held by the recorder

func (*Recorder) Record

func (r *Recorder) Record(mediaSSRC uint32, sequenceNumber uint16, arrivalTime int64)

Record marks a packet with mediaSSRC and a transport wide sequence number sequenceNumber as received at arrivalTime.

type SenderInterceptor

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

SenderInterceptor sends transport wide congestion control reports as specified in: https://datatracker.ietf.org/doc/html/draft-holmer-rmcat-transport-wide-cc-extensions-01

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 added in v0.1.0

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 added in v0.1.0

NewInterceptor constructs a new SenderInterceptor

Jump to

Keyboard shortcuts

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