package interceptor

Import Path
	github.com/pion/interceptor (on go.dev)

Dependency Relation
	imports 5 packages, and imported by 6 packages

Involved Source Files attributes.go chain.go errors.go Package interceptor contains the Interceptor interface, with some useful interceptors that should be safe to use in most cases. noop.go registry.go streaminfo.go
Package-Level Type Names (total 17)
/* sort by: | */
Attributes are a generic key/value store used by interceptors. Get returns the attribute associated with key. GetRTCPPackets gets the RTCP packets if present. If the packet slice is not present, it will be unmarshalled from the raw byte slice and stored in the attributes. GetRTPHeader gets the RTP header if present. If it is not present, it will be unmarshalled from the raw byte slice and stored in the attributes. Set sets the attribute associated with key to the given value. func RTCPReader.Read([]byte, Attributes) (int, Attributes, error) func RTCPReaderFunc.Read(b []byte, a Attributes) (int, Attributes, error) func RTPReader.Read([]byte, Attributes) (int, Attributes, error) func RTPReaderFunc.Read(b []byte, a Attributes) (int, Attributes, error) func github.com/pion/webrtc/v4.(*RTPReceiver).Read(b []byte) (n int, a Attributes, err error) func github.com/pion/webrtc/v4.(*RTPReceiver).ReadRTCP() ([]rtcp.Packet, Attributes, error) func github.com/pion/webrtc/v4.(*RTPReceiver).ReadSimulcast(b []byte, rid string) (n int, a Attributes, err error) func github.com/pion/webrtc/v4.(*RTPReceiver).ReadSimulcastRTCP(rid string) ([]rtcp.Packet, Attributes, error) func github.com/pion/webrtc/v4.(*RTPSender).Read(b []byte) (n int, a Attributes, err error) func github.com/pion/webrtc/v4.(*RTPSender).ReadRTCP() ([]rtcp.Packet, Attributes, error) func github.com/pion/webrtc/v4.(*RTPSender).ReadSimulcast(b []byte, rid string) (n int, a Attributes, err error) func github.com/pion/webrtc/v4.(*RTPSender).ReadSimulcastRTCP(rid string) ([]rtcp.Packet, Attributes, error) func github.com/pion/webrtc/v4.(*TrackRemote).Read(b []byte) (n int, attributes Attributes, err error) func github.com/pion/webrtc/v4.(*TrackRemote).ReadRTP() (*rtp.Packet, Attributes, error) func RTCPReader.Read([]byte, Attributes) (int, Attributes, error) func RTCPReaderFunc.Read(b []byte, a Attributes) (int, Attributes, error) func RTCPWriter.Write(pkts []rtcp.Packet, attributes Attributes) (int, error) func RTCPWriterFunc.Write(pkts []rtcp.Packet, attributes Attributes) (int, error) func RTPReader.Read([]byte, Attributes) (int, Attributes, error) func RTPReaderFunc.Read(b []byte, a Attributes) (int, Attributes, error) func RTPWriter.Write(header *rtp.Header, payload []byte, attributes Attributes) (int, error) func RTPWriterFunc.Write(header *rtp.Header, payload []byte, attributes Attributes) (int, error)
Chain is an interceptor that runs all child interceptors in order. 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. 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. BindRTCPWriter lets you modify any outgoing RTCP packets. It is called once per PeerConnection. The returned method will be called once per packet batch. 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. Close closes the Interceptor, cleaning up any data if necessary. UnbindLocalStream is called when the Stream is removed. It can be used to clean up any data related to that track. UnbindRemoteStream is called when the Stream is removed. It can be used to clean up any data related to that track. *Chain : Interceptor *Chain : github.com/prometheus/common/expfmt.Closer *Chain : io.Closer func NewChain(interceptors []Interceptor) *Chain
Factory provides an interface for constructing interceptors. ( Factory) NewInterceptor(id string) (Interceptor, error) *github.com/pion/interceptor/pkg/flexfec.FecInterceptorFactory *github.com/pion/interceptor/pkg/nack.GeneratorInterceptorFactory *github.com/pion/interceptor/pkg/nack.ResponderInterceptorFactory *github.com/pion/interceptor/pkg/report.ReceiverInterceptorFactory *github.com/pion/interceptor/pkg/report.SenderInterceptorFactory *github.com/pion/interceptor/pkg/rfc8888.SenderInterceptorFactory *github.com/pion/interceptor/pkg/twcc.HeaderExtensionInterceptorFactory *github.com/pion/interceptor/pkg/twcc.SenderInterceptorFactory func (*Registry).Add(f Factory)
Interceptor can be used to add functionality to you PeerConnections by modifying any incoming/outgoing rtp/rtcp packets, or sending your own packets as needed. 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. 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. BindRTCPWriter lets you modify any outgoing RTCP packets. It is called once per PeerConnection. The returned method will be called once per packet batch. 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. ( Interceptor) Close() error UnbindLocalStream is called when the Stream is removed. It can be used to clean up any data related to that track. UnbindRemoteStream is called when the Stream is removed. It can be used to clean up any data related to that track. *Chain *NoOp *github.com/pion/interceptor/pkg/flexfec.FecInterceptor *github.com/pion/interceptor/pkg/nack.GeneratorInterceptor *github.com/pion/interceptor/pkg/nack.ResponderInterceptor *github.com/pion/interceptor/pkg/report.ReceiverInterceptor *github.com/pion/interceptor/pkg/report.SenderInterceptor *github.com/pion/interceptor/pkg/rfc8888.SenderInterceptor *github.com/pion/interceptor/pkg/twcc.HeaderExtensionInterceptor *github.com/pion/interceptor/pkg/twcc.SenderInterceptor Interceptor : github.com/prometheus/common/expfmt.Closer Interceptor : io.Closer func Factory.NewInterceptor(id string) (Interceptor, error) func (*Registry).Build(id string) (Interceptor, error) func github.com/pion/interceptor/pkg/flexfec.(*FecInterceptorFactory).NewInterceptor(_ string) (Interceptor, error) func github.com/pion/interceptor/pkg/nack.(*GeneratorInterceptorFactory).NewInterceptor(_ string) (Interceptor, error) func github.com/pion/interceptor/pkg/nack.(*ResponderInterceptorFactory).NewInterceptor(_ string) (Interceptor, error) func github.com/pion/interceptor/pkg/report.(*ReceiverInterceptorFactory).NewInterceptor(_ string) (Interceptor, error) func github.com/pion/interceptor/pkg/report.(*SenderInterceptorFactory).NewInterceptor(_ string) (Interceptor, error) func github.com/pion/interceptor/pkg/rfc8888.(*SenderInterceptorFactory).NewInterceptor(_ string) (Interceptor, error) func github.com/pion/interceptor/pkg/twcc.(*HeaderExtensionInterceptorFactory).NewInterceptor(_ string) (Interceptor, error) func github.com/pion/interceptor/pkg/twcc.(*SenderInterceptorFactory).NewInterceptor(_ string) (Interceptor, error) func NewChain(interceptors []Interceptor) *Chain
NoOp is an Interceptor that does not modify any packets. It can embedded in other interceptors, so it's possible to implement only a subset of the methods. 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. 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. BindRTCPWriter lets you modify any outgoing RTCP packets. It is called once per PeerConnection. The returned method will be called once per packet batch. 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. Close closes the Interceptor, cleaning up any data if necessary. UnbindLocalStream is called when the Stream is removed. It can be used to clean up any data related to that track. UnbindRemoteStream is called when the Stream is removed. It can be used to clean up any data related to that track. *NoOp : Interceptor *NoOp : github.com/prometheus/common/expfmt.Closer *NoOp : io.Closer
Registry is a collector for interceptors. Add adds a new Interceptor to the registry. Build constructs a single Interceptor from a InterceptorRegistry. func github.com/pion/webrtc/v4.ConfigureCongestionControlFeedback(mediaEngine *webrtc.MediaEngine, interceptorRegistry *Registry) error func github.com/pion/webrtc/v4.ConfigureFlexFEC03(payloadType webrtc.PayloadType, mediaEngine *webrtc.MediaEngine, interceptorRegistry *Registry, options ...flexfec.FecOption) error func github.com/pion/webrtc/v4.ConfigureNack(mediaEngine *webrtc.MediaEngine, interceptorRegistry *Registry) error func github.com/pion/webrtc/v4.ConfigureRTCPReports(interceptorRegistry *Registry) error func github.com/pion/webrtc/v4.ConfigureTWCCHeaderExtensionSender(mediaEngine *webrtc.MediaEngine, interceptorRegistry *Registry) error func github.com/pion/webrtc/v4.ConfigureTWCCSender(mediaEngine *webrtc.MediaEngine, interceptorRegistry *Registry) error func github.com/pion/webrtc/v4.RegisterDefaultInterceptors(mediaEngine *webrtc.MediaEngine, interceptorRegistry *Registry) error func github.com/pion/webrtc/v4.WithInterceptorRegistry(ir *Registry) func(a *webrtc.API)
RTCPFeedback signals the connection to use additional RTCP packet types. https://draft.ortc.org/#dom-rtcrtcpfeedback The parameter value depends on the type. For example, type="nack" parameter="pli" will send Picture Loss Indicator packets. Type is the type of feedback. see: https://draft.ortc.org/#dom-rtcrtcpfeedback valid: ack, ccm, nack, goog-remb, transport-cc
RTCPReader is used by Interceptor.BindRTCPReader. Read a rtp packet RTCPReaderFunc RTPReader (interface) RTPReaderFunc RTCPReader : RTPReader func (*Chain).BindRTCPReader(reader RTCPReader) RTCPReader func Interceptor.BindRTCPReader(reader RTCPReader) RTCPReader func (*NoOp).BindRTCPReader(reader RTCPReader) RTCPReader func github.com/pion/interceptor/pkg/nack.(*ResponderInterceptor).BindRTCPReader(reader RTCPReader) RTCPReader func github.com/pion/interceptor/pkg/report.(*ReceiverInterceptor).BindRTCPReader(reader RTCPReader) RTCPReader func github.com/pion/webrtc/v4.TrackLocalContext.RTCPReader() RTCPReader func (*Chain).BindRTCPReader(reader RTCPReader) RTCPReader func Interceptor.BindRTCPReader(reader RTCPReader) RTCPReader func (*NoOp).BindRTCPReader(reader RTCPReader) RTCPReader func github.com/pion/interceptor/pkg/nack.(*ResponderInterceptor).BindRTCPReader(reader RTCPReader) RTCPReader func github.com/pion/interceptor/pkg/report.(*ReceiverInterceptor).BindRTCPReader(reader RTCPReader) RTCPReader
RTCPReaderFunc is an adapter for RTCPReader interface. Read a batch of rtcp packets. RTCPReaderFunc : RTCPReader RTCPReaderFunc : RTPReader
RTCPWriter is used by Interceptor.BindRTCPWriter. Write a batch of rtcp packets RTCPWriterFunc func (*Chain).BindRTCPWriter(writer RTCPWriter) RTCPWriter func Interceptor.BindRTCPWriter(writer RTCPWriter) RTCPWriter func (*NoOp).BindRTCPWriter(writer RTCPWriter) RTCPWriter func github.com/pion/interceptor/pkg/nack.(*GeneratorInterceptor).BindRTCPWriter(writer RTCPWriter) RTCPWriter func github.com/pion/interceptor/pkg/report.(*ReceiverInterceptor).BindRTCPWriter(writer RTCPWriter) RTCPWriter func github.com/pion/interceptor/pkg/report.(*SenderInterceptor).BindRTCPWriter(writer RTCPWriter) RTCPWriter func github.com/pion/interceptor/pkg/rfc8888.(*SenderInterceptor).BindRTCPWriter(writer RTCPWriter) RTCPWriter func github.com/pion/interceptor/pkg/twcc.(*SenderInterceptor).BindRTCPWriter(writer RTCPWriter) RTCPWriter func (*Chain).BindRTCPWriter(writer RTCPWriter) RTCPWriter func Interceptor.BindRTCPWriter(writer RTCPWriter) RTCPWriter func (*NoOp).BindRTCPWriter(writer RTCPWriter) RTCPWriter func github.com/pion/interceptor/pkg/nack.(*GeneratorInterceptor).BindRTCPWriter(writer RTCPWriter) RTCPWriter func github.com/pion/interceptor/pkg/report.(*ReceiverInterceptor).BindRTCPWriter(writer RTCPWriter) RTCPWriter func github.com/pion/interceptor/pkg/report.(*SenderInterceptor).BindRTCPWriter(writer RTCPWriter) RTCPWriter func github.com/pion/interceptor/pkg/rfc8888.(*SenderInterceptor).BindRTCPWriter(writer RTCPWriter) RTCPWriter func github.com/pion/interceptor/pkg/twcc.(*SenderInterceptor).BindRTCPWriter(writer RTCPWriter) RTCPWriter
RTCPWriterFunc is an adapter for RTCPWriter interface. Write a batch of rtcp packets. RTCPWriterFunc : RTCPWriter
RTPHeaderExtension represents a negotiated RFC5285 RTP header extension. ID int URI string
RTPReader is used by Interceptor.BindRemoteStream. Read a rtp packet RTCPReader (interface) RTCPReaderFunc RTPReaderFunc RTPReader : RTCPReader func (*Chain).BindRemoteStream(ctx *StreamInfo, reader RTPReader) RTPReader func Interceptor.BindRemoteStream(info *StreamInfo, reader RTPReader) RTPReader func (*NoOp).BindRemoteStream(_ *StreamInfo, reader RTPReader) RTPReader func github.com/pion/interceptor/pkg/nack.(*GeneratorInterceptor).BindRemoteStream(info *StreamInfo, reader RTPReader) RTPReader func github.com/pion/interceptor/pkg/report.(*ReceiverInterceptor).BindRemoteStream(info *StreamInfo, reader RTPReader) RTPReader func github.com/pion/interceptor/pkg/rfc8888.(*SenderInterceptor).BindRemoteStream(_ *StreamInfo, reader RTPReader) RTPReader func github.com/pion/interceptor/pkg/twcc.(*SenderInterceptor).BindRemoteStream(info *StreamInfo, reader RTPReader) RTPReader func (*Chain).BindRemoteStream(ctx *StreamInfo, reader RTPReader) RTPReader func Interceptor.BindRemoteStream(info *StreamInfo, reader RTPReader) RTPReader func (*NoOp).BindRemoteStream(_ *StreamInfo, reader RTPReader) RTPReader func github.com/pion/interceptor/pkg/nack.(*GeneratorInterceptor).BindRemoteStream(info *StreamInfo, reader RTPReader) RTPReader func github.com/pion/interceptor/pkg/report.(*ReceiverInterceptor).BindRemoteStream(info *StreamInfo, reader RTPReader) RTPReader func github.com/pion/interceptor/pkg/rfc8888.(*SenderInterceptor).BindRemoteStream(_ *StreamInfo, reader RTPReader) RTPReader func github.com/pion/interceptor/pkg/twcc.(*SenderInterceptor).BindRemoteStream(info *StreamInfo, reader RTPReader) RTPReader
RTPReaderFunc is an adapter for RTPReader interface. Read a rtp packet. RTPReaderFunc : RTCPReader RTPReaderFunc : RTPReader
RTPWriter is used by Interceptor.BindLocalStream. Write a rtp packet RTPWriterFunc func (*Chain).BindLocalStream(ctx *StreamInfo, writer RTPWriter) RTPWriter func Interceptor.BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func (*NoOp).BindLocalStream(_ *StreamInfo, writer RTPWriter) RTPWriter func github.com/pion/interceptor/pkg/flexfec.(*FecInterceptor).BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func github.com/pion/interceptor/pkg/nack.(*ResponderInterceptor).BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func github.com/pion/interceptor/pkg/report.(*SenderInterceptor).BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func github.com/pion/interceptor/pkg/twcc.(*HeaderExtensionInterceptor).BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func (*Chain).BindLocalStream(ctx *StreamInfo, writer RTPWriter) RTPWriter func Interceptor.BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func (*NoOp).BindLocalStream(_ *StreamInfo, writer RTPWriter) RTPWriter func github.com/pion/interceptor/pkg/flexfec.(*FecInterceptor).BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func github.com/pion/interceptor/pkg/nack.(*ResponderInterceptor).BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func github.com/pion/interceptor/pkg/report.(*SenderInterceptor).BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func github.com/pion/interceptor/pkg/twcc.(*HeaderExtensionInterceptor).BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter
RTPWriterFunc is an adapter for RTPWrite interface. Write a rtp packet. RTPWriterFunc : RTPWriter
StreamInfo is the Context passed when a StreamLocal or StreamRemote has been Binded or Unbinded. Attributes Attributes Channels uint16 ClockRate uint32 ID string MimeType string PayloadType uint8 PayloadTypeForwardErrorCorrection uint8 PayloadTypeRetransmission uint8 RTCPFeedback []RTCPFeedback RTPHeaderExtensions []RTPHeaderExtension SDPFmtpLine string SSRC uint32 SSRCForwardErrorCorrection uint32 SSRCRetransmission uint32 func (*Chain).BindLocalStream(ctx *StreamInfo, writer RTPWriter) RTPWriter func (*Chain).BindRemoteStream(ctx *StreamInfo, reader RTPReader) RTPReader func (*Chain).UnbindLocalStream(ctx *StreamInfo) func (*Chain).UnbindRemoteStream(ctx *StreamInfo) func Interceptor.BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func Interceptor.BindRemoteStream(info *StreamInfo, reader RTPReader) RTPReader func Interceptor.UnbindLocalStream(info *StreamInfo) func Interceptor.UnbindRemoteStream(info *StreamInfo) func (*NoOp).BindLocalStream(_ *StreamInfo, writer RTPWriter) RTPWriter func (*NoOp).BindRemoteStream(_ *StreamInfo, reader RTPReader) RTPReader func (*NoOp).UnbindLocalStream(_ *StreamInfo) func (*NoOp).UnbindRemoteStream(_ *StreamInfo) func github.com/pion/interceptor/pkg/flexfec.(*FecInterceptor).BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func github.com/pion/interceptor/pkg/flexfec.(*FecInterceptor).UnbindLocalStream(info *StreamInfo) func github.com/pion/interceptor/pkg/nack.(*GeneratorInterceptor).BindRemoteStream(info *StreamInfo, reader RTPReader) RTPReader func github.com/pion/interceptor/pkg/nack.(*GeneratorInterceptor).UnbindRemoteStream(info *StreamInfo) func github.com/pion/interceptor/pkg/nack.(*ResponderInterceptor).BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func github.com/pion/interceptor/pkg/nack.(*ResponderInterceptor).UnbindLocalStream(info *StreamInfo) func github.com/pion/interceptor/pkg/report.(*ReceiverInterceptor).BindRemoteStream(info *StreamInfo, reader RTPReader) RTPReader func github.com/pion/interceptor/pkg/report.(*ReceiverInterceptor).UnbindRemoteStream(info *StreamInfo) func github.com/pion/interceptor/pkg/report.(*SenderInterceptor).BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func github.com/pion/interceptor/pkg/report.(*SenderInterceptor).UnbindLocalStream(info *StreamInfo) func github.com/pion/interceptor/pkg/rfc8888.(*SenderInterceptor).BindRemoteStream(_ *StreamInfo, reader RTPReader) RTPReader func github.com/pion/interceptor/pkg/twcc.(*HeaderExtensionInterceptor).BindLocalStream(info *StreamInfo, writer RTPWriter) RTPWriter func github.com/pion/interceptor/pkg/twcc.(*SenderInterceptor).BindRemoteStream(info *StreamInfo, reader RTPReader) RTPReader
Package-Level Functions (only one)
NewChain returns a new Chain interceptor.