nack

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package nack provides interceptors to implement sending and receiving negative acknowledgements

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSize = errors.New("invalid buffer size")

ErrInvalidSize is returned by newReceiveLog/newSendBuffer, when an incorrect buffer size is supplied.

Functions

This section is empty.

Types

type GeneratorInterceptor

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

GeneratorInterceptor interceptor generates nack feedback messages.

func (*GeneratorInterceptor) 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 (*GeneratorInterceptor) 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 (*GeneratorInterceptor) Close

func (n *GeneratorInterceptor) Close() error

Close closes the interceptor

func (*GeneratorInterceptor) UnbindLocalStream

func (n *GeneratorInterceptor) UnbindLocalStream(info *interceptor.StreamInfo)

UnbindLocalStream is called when the Stream is removed. It can be used to clean up any data related to that track.

type GeneratorInterceptorFactory

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

GeneratorInterceptorFactory is a interceptor.Factory for a GeneratorInterceptor

func NewGeneratorInterceptor

func NewGeneratorInterceptor(opts ...GeneratorOption) (*GeneratorInterceptorFactory, error)

NewGeneratorInterceptor returns a new GeneratorInterceptorFactory

func (*GeneratorInterceptorFactory) NewInterceptor

NewInterceptor constructs a new ReceiverInterceptor

type GeneratorOption

type GeneratorOption func(r *GeneratorInterceptor) error

GeneratorOption can be used to configure GeneratorInterceptor

func GeneratorInterval

func GeneratorInterval(interval time.Duration) GeneratorOption

GeneratorInterval sets the nack send interval for the interceptor

func GeneratorLog

func GeneratorLog(log logging.LeveledLogger) GeneratorOption

GeneratorLog sets a logger for the interceptor

func GeneratorSize

func GeneratorSize(size uint16) GeneratorOption

GeneratorSize sets the size of the interceptor. Size must be one of: 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768

func GeneratorSkipLastN

func GeneratorSkipLastN(skipLastN uint16) GeneratorOption

GeneratorSkipLastN sets the number of packets (n-1 packets before the last received packets) to ignore when generating nack requests.

type ResponderInterceptor

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

ResponderInterceptor responds to nack feedback messages

func (*ResponderInterceptor) BindLocalStream

BindLocalStream lets you modify any outgoing RTP packets. It is called once for per LocalStream. The returned method will be called once per rtp packet.

func (*ResponderInterceptor) BindRTCPReader

BindRTCPReader lets you modify any incoming RTCP packets. It is called once per sender/receiver, however this might change in the future. The returned method will be called once per packet batch.

func (*ResponderInterceptor) UnbindLocalStream

func (n *ResponderInterceptor) UnbindLocalStream(info *interceptor.StreamInfo)

UnbindLocalStream is called when the Stream is removed. It can be used to clean up any data related to that track.

type ResponderInterceptorFactory

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

ResponderInterceptorFactory is a interceptor.Factory for a ResponderInterceptor

func NewResponderInterceptor

func NewResponderInterceptor(opts ...ResponderOption) (*ResponderInterceptorFactory, error)

NewResponderInterceptor returns a new ResponderInterceptorFactor

func (*ResponderInterceptorFactory) NewInterceptor

NewInterceptor constructs a new ResponderInterceptor

type ResponderOption

type ResponderOption func(s *ResponderInterceptor) error

ResponderOption can be used to configure ResponderInterceptor

func DisableCopy

func DisableCopy() ResponderOption

DisableCopy bypasses copy of underlying packets. It should be used when you are not re-using underlying buffers of packets that have been written

func ResponderLog

func ResponderLog(log logging.LeveledLogger) ResponderOption

ResponderLog sets a logger for the interceptor

func ResponderSize

func ResponderSize(size uint16) ResponderOption

ResponderSize sets the size of the interceptor. Size must be one of: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768

Jump to

Keyboard shortcuts

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