Documentation ¶
Overview ¶
Package nack provides interceptors to implement sending and receiving negative acknowledgements
Index ¶
- Variables
- type GeneratorInterceptor
- func (n *GeneratorInterceptor) BindRTCPWriter(writer interceptor.RTCPWriter) interceptor.RTCPWriter
- func (n *GeneratorInterceptor) BindRemoteStream(info *interceptor.StreamInfo, reader interceptor.RTPReader) interceptor.RTPReader
- func (n *GeneratorInterceptor) Close() error
- func (n *GeneratorInterceptor) UnbindRemoteStream(info *interceptor.StreamInfo)
- type GeneratorInterceptorFactory
- type GeneratorOption
- type ResponderInterceptor
- func (n *ResponderInterceptor) BindLocalStream(info *interceptor.StreamInfo, writer interceptor.RTPWriter) interceptor.RTPWriter
- func (n *ResponderInterceptor) BindRTCPReader(reader interceptor.RTCPReader) interceptor.RTCPReader
- func (n *ResponderInterceptor) UnbindLocalStream(info *interceptor.StreamInfo)
- type ResponderInterceptorFactory
- type ResponderOption
Constants ¶
This section is empty.
Variables ¶
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 ¶
func (n *GeneratorInterceptor) BindRTCPWriter(writer interceptor.RTCPWriter) interceptor.RTCPWriter
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 ¶
func (n *GeneratorInterceptor) BindRemoteStream(info *interceptor.StreamInfo, reader interceptor.RTPReader) interceptor.RTPReader
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
func (g *GeneratorInterceptorFactory) NewInterceptor(string) (interceptor.Interceptor, error)
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 ¶
func (n *ResponderInterceptor) BindLocalStream(info *interceptor.StreamInfo, writer interceptor.RTPWriter) interceptor.RTPWriter
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 ¶
func (n *ResponderInterceptor) BindRTCPReader(reader interceptor.RTCPReader) interceptor.RTCPReader
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
func (r *ResponderInterceptorFactory) NewInterceptor(string) (interceptor.Interceptor, error)
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