Documentation ¶
Overview ¶
Package packetdump implements RTP & RTCP packet dumpers.
Index ¶
- 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 RTCPFilter(callback RTCPFilterCallback) PacketDumperOption
- func RTCPFormatter(f RTCPFormatCallback) PacketDumperOption
- func RTCPWriter(w io.Writer) PacketDumperOption
- func RTPFilter(callback RTPFilterCallback) PacketDumperOption
- func RTPFormatter(f RTPFormatCallback) PacketDumperOption
- func RTPWriter(w io.Writer) PacketDumperOption
- type RTCPFilterCallback
- type RTCPFormatCallback
- type RTPFilterCallback
- type RTPFormatCallback
- type ReceiverInterceptor
- type ReceiverInterceptorFactory
- type SenderInterceptor
- type SenderInterceptorFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultRTCPFormatter ¶
DefaultRTCPFormatter returns the default log format for RTCP packets
func DefaultRTPFormatter ¶
DefaultRTPFormatter returns the default log format for RTP packets
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 RTCPFilter ¶
func RTCPFilter(callback RTCPFilterCallback) PacketDumperOption
RTCPFilter sets the RTCP filter.
func RTCPFormatter ¶
func RTCPFormatter(f RTCPFormatCallback) PacketDumperOption
RTCPFormatter sets the RTCP format
func RTCPWriter ¶
func RTCPWriter(w io.Writer) PacketDumperOption
RTCPWriter sets the io.Writer on which RTCP packets will be dumped.
func RTPFilter ¶
func RTPFilter(callback RTPFilterCallback) PacketDumperOption
RTPFilter sets the RTP filter.
func RTPFormatter ¶
func RTPFormatter(f RTPFormatCallback) PacketDumperOption
RTPFormatter sets the RTP format
func RTPWriter ¶
func RTPWriter(w io.Writer) PacketDumperOption
RTPWriter sets the io.Writer on which RTP packets will be dumped.
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.
type RTCPFormatCallback ¶
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.
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 ¶
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.
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(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 (*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(id 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(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 (*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(id string) (interceptor.Interceptor, error)
NewInterceptor returns a new SenderInterceptor interceptor