Documentation
¶
Overview ¶
Package packetdump implements RTP & RTCP packet dumpers.
Index ¶
- Variables
- func DefaultRTCPFormatter(pkts []rtcp.Packet, _ interceptor.Attributes) string
- func DefaultRTPFormatter(pkt *rtp.Packet, _ interceptor.Attributes) string
- type PacketDumper
- type PacketDumperOption
- func Log(log logging.LeveledLogger) PacketDumperOption
- func RTCPBinaryFormatter(f RTCPBinaryFormatCallback) PacketDumperOption
- func RTCPFilter(callback RTCPFilterCallback) PacketDumperOption
- func RTCPFormatter(f RTCPFormatCallback) PacketDumperOption
- func RTCPPerPacketFilter(callback RTCPPerPacketFilterCallback) PacketDumperOption
- func RTCPWriter(w io.Writer) PacketDumperOption
- func RTPBinaryFormatter(f RTPBinaryFormatCallback) PacketDumperOption
- func RTPFilter(callback RTPFilterCallback) PacketDumperOption
- func RTPFormatter(f RTPFormatCallback) PacketDumperOption
- func RTPWriter(w io.Writer) PacketDumperOption
- type RTCPBinaryFormatCallback
- type RTCPFilterCallback
- type RTCPFormatCallback
- type RTCPPerPacketFilterCallback
- type RTPBinaryFormatCallback
- type RTPFilterCallback
- type RTPFormatCallback
- type ReceiverInterceptor
- type ReceiverInterceptorFactory
- type SenderInterceptor
- type SenderInterceptorFactory
Constants ¶
This section is empty.
Variables ¶
var ErrBothBinaryAndDeprecatedFormat = fmt.Errorf("both binary and deprecated format callbacks are set")
ErrBothBinaryAndDeprecatedFormat is returned when both binary and deprecated format callbacks are set.
Functions ¶
func DefaultRTCPFormatter ¶
func DefaultRTCPFormatter(pkts []rtcp.Packet, _ interceptor.Attributes) string
DefaultRTCPFormatter returns the default log format for RTCP packets Deprecated: useless export since set by default.
func DefaultRTPFormatter ¶
func DefaultRTPFormatter(pkt *rtp.Packet, _ interceptor.Attributes) string
DefaultRTPFormatter returns the default log format for RTP packets Deprecated: useless export since set by default.
Types ¶
type PacketDumper ¶
type PacketDumper struct {
// contains filtered or unexported fields
}
PacketDumper dumps packet to a io.Writer.
func NewPacketDumper ¶
func NewPacketDumper(opts ...PacketDumperOption) (*PacketDumper, error)
NewPacketDumper creates a new PacketDumper.
type PacketDumperOption ¶
type PacketDumperOption func(d *PacketDumper) error
PacketDumperOption can be used to configure SenderInterceptor.
func Log ¶
func Log(log logging.LeveledLogger) PacketDumperOption
Log sets a logger for the interceptor.
func RTCPBinaryFormatter ¶ added in v0.1.38
func RTCPBinaryFormatter(f RTCPBinaryFormatCallback) PacketDumperOption
RTCPBinaryFormatter sets the RTCP binary formatter.
func RTCPFilter ¶
func RTCPFilter(callback RTCPFilterCallback) PacketDumperOption
RTCPFilter sets the RTCP filter. Deprecated: prefer RTCPPerPacketFilter.
func RTCPFormatter ¶
func RTCPFormatter(f RTCPFormatCallback) PacketDumperOption
RTCPFormatter sets the RTCP format Deprecated: prefer RTCPBinaryFormatter.
func RTCPPerPacketFilter ¶ added in v0.1.38
func RTCPPerPacketFilter(callback RTCPPerPacketFilterCallback) PacketDumperOption
RTCPPerPacketFilter sets the RTCP per-packet filter.
func RTCPWriter ¶
func RTCPWriter(w io.Writer) PacketDumperOption
RTCPWriter sets the io.Writer on which RTCP packets will be dumped.
func RTPBinaryFormatter ¶ added in v0.1.38
func RTPBinaryFormatter(f RTPBinaryFormatCallback) PacketDumperOption
RTPBinaryFormatter sets the RTP binary formatter.
func RTPFilter ¶
func RTPFilter(callback RTPFilterCallback) PacketDumperOption
RTPFilter sets the RTP filter.
func RTPFormatter ¶
func RTPFormatter(f RTPFormatCallback) PacketDumperOption
RTPFormatter sets the RTP format Deprecated: prefer RTPBinaryFormatter.
func RTPWriter ¶
func RTPWriter(w io.Writer) PacketDumperOption
RTPWriter sets the io.Writer on which RTP packets will be dumped.
type RTCPBinaryFormatCallback ¶ added in v0.1.38
type RTCPBinaryFormatCallback func(rtcp.Packet, interceptor.Attributes) ([]byte, error)
RTCPBinaryFormatCallback can be used to apply custom formatting or marshaling to each dumped RTCP packet.
type RTCPFilterCallback ¶
RTCPFilterCallback can be used to filter RTCP packets to dump. The callback returns whether or not to print dump the packet's content. Deprecated: prefer RTCPPerPacketFilterCallback.
type RTCPFormatCallback ¶
type RTCPFormatCallback func([]rtcp.Packet, interceptor.Attributes) string
RTCPFormatCallback can be used to apply custom formatting to each dumped RTCP packet. If new lines should be added after each packet, they must be included in the returned format. Deprecated: prefer RTCPBinaryFormatCallback.
type RTCPPerPacketFilterCallback ¶ added in v0.1.38
RTCPPerPacketFilterCallback can be used to filter RTCP packets to dump. It's called once per every packet opposing to RTCPFilterCallback which is called once per packet batch.
type RTPBinaryFormatCallback ¶ added in v0.1.38
type RTPBinaryFormatCallback func(*rtp.Packet, interceptor.Attributes) ([]byte, error)
RTPBinaryFormatCallback can be used to apply custom formatting or marshaling to each dumped RTP packet.
type RTPFilterCallback ¶
RTPFilterCallback can be used to filter RTP packets to dump. The callback returns whether or not to print dump the packet's content.
type RTPFormatCallback ¶
type RTPFormatCallback func(*rtp.Packet, interceptor.Attributes) string
RTPFormatCallback can be used to apply custom formatting to each dumped RTP packet. If new lines should be added after each packet, they must be included in the returned format. Deprecated: prefer RTPBinaryFormatCallback.
type ReceiverInterceptor ¶
type ReceiverInterceptor struct { interceptor.NoOp *PacketDumper }
ReceiverInterceptor interceptor dumps outgoing RTP packets.
func (*ReceiverInterceptor) BindRTCPReader ¶
func (r *ReceiverInterceptor) 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 (*ReceiverInterceptor) BindRemoteStream ¶
func (r *ReceiverInterceptor) BindRemoteStream( _ *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 (*ReceiverInterceptor) Close ¶
func (r *ReceiverInterceptor) Close() error
Close closes the interceptor.
type ReceiverInterceptorFactory ¶
type ReceiverInterceptorFactory struct {
// contains filtered or unexported fields
}
ReceiverInterceptorFactory is a interceptor.Factory for a ReceiverInterceptor.
func NewReceiverInterceptor ¶
func NewReceiverInterceptor(opts ...PacketDumperOption) (*ReceiverInterceptorFactory, error)
NewReceiverInterceptor returns a new ReceiverInterceptor.
func (*ReceiverInterceptorFactory) NewInterceptor ¶
func (r *ReceiverInterceptorFactory) NewInterceptor(_ string) (interceptor.Interceptor, error)
NewInterceptor returns a new ReceiverInterceptor interceptor.
type SenderInterceptor ¶
type SenderInterceptor struct { interceptor.NoOp *PacketDumper }
SenderInterceptor responds to nack feedback messages.
func (*SenderInterceptor) BindLocalStream ¶
func (s *SenderInterceptor) BindLocalStream( _ *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 (*SenderInterceptor) BindRTCPWriter ¶
func (s *SenderInterceptor) 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 (*SenderInterceptor) Close ¶
func (s *SenderInterceptor) Close() error
Close closes the interceptor.
type SenderInterceptorFactory ¶
type SenderInterceptorFactory struct {
// contains filtered or unexported fields
}
SenderInterceptorFactory is a interceptor.Factory for a SenderInterceptor.
func NewSenderInterceptor ¶
func NewSenderInterceptor(opts ...PacketDumperOption) (*SenderInterceptorFactory, error)
NewSenderInterceptor returns a new SenderInterceptorFactory.
func (*SenderInterceptorFactory) NewInterceptor ¶
func (s *SenderInterceptorFactory) NewInterceptor(_ string) (interceptor.Interceptor, error)
NewInterceptor returns a new SenderInterceptor interceptor.