nack

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: MIT Imports: 9 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 NewGeneratorInterceptor

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

NewGeneratorInterceptor returns a new GeneratorInterceptor interceptor

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

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

NewResponderInterceptor returns a new GeneratorInterceptor interceptor

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 ResponderOption

type ResponderOption func(s *ResponderInterceptor) error

ResponderOption can be used to configure ResponderInterceptor

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