nack

package
v0.1.29 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 10 Imported by: 39

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) UnbindRemoteStream added in v0.1.13

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

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

type GeneratorInterceptorFactory added in v0.1.0

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

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

func GeneratorMaxNacksPerPacket(maxNacks uint16) GeneratorOption

GeneratorMaxNacksPerPacket sets the maximum number of NACKs sent per missing packet, e.g. if set to 2, a missing packet will only be NACKed at most twice. If set to 0 (default), max number of NACKs is unlimited

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

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

NewInterceptor constructs a new ResponderInterceptor

type ResponderOption

type ResponderOption func(s *ResponderInterceptor) error

ResponderOption can be used to configure ResponderInterceptor

func DisableCopy added in v0.1.8

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