@@ -21,7 +21,18 @@ func Log(log logging.LeveledLogger) PacketDumperOption {
2121 }
2222}
2323
24- // RTPWriter sets the io.Writer on which RTP packets will be dumped.
24+ // PacketLog sets the packet logger of a packet dumper. Use this to replace the
25+ // default logger with yout own logger implementation.
26+ func PacketLog (logger PacketLogger ) PacketDumperOption {
27+ return func (d * PacketDumper ) error {
28+ d .packetLogger = logger
29+
30+ return nil
31+ }
32+ }
33+
34+ // RTPWriter sets the io.Writer on which RTP packets will be dumped by the
35+ // default packet logger.
2536func RTPWriter (w io.Writer ) PacketDumperOption {
2637 return func (d * PacketDumper ) error {
2738 d .rtpStream = w
@@ -30,7 +41,8 @@ func RTPWriter(w io.Writer) PacketDumperOption {
3041 }
3142}
3243
33- // RTCPWriter sets the io.Writer on which RTCP packets will be dumped.
44+ // RTCPWriter sets the io.Writer on which RTCP packets will be dumped by the
45+ // default packet logger.
3446func RTCPWriter (w io.Writer ) PacketDumperOption {
3547 return func (d * PacketDumper ) error {
3648 d .rtcpStream = w
@@ -39,7 +51,7 @@ func RTCPWriter(w io.Writer) PacketDumperOption {
3951 }
4052}
4153
42- // RTPFormatter sets the RTP format
54+ // RTPFormatter sets the RTP format used by the default packet logger.
4355// Deprecated: prefer RTPBinaryFormatter.
4456func RTPFormatter (f RTPFormatCallback ) PacketDumperOption {
4557 return func (d * PacketDumper ) error {
@@ -49,7 +61,7 @@ func RTPFormatter(f RTPFormatCallback) PacketDumperOption {
4961 }
5062}
5163
52- // RTCPFormatter sets the RTCP format
64+ // RTCPFormatter sets the RTCP format used by the default packet logger.
5365// Deprecated: prefer RTCPBinaryFormatter.
5466func RTCPFormatter (f RTCPFormatCallback ) PacketDumperOption {
5567 return func (d * PacketDumper ) error {
@@ -59,7 +71,8 @@ func RTCPFormatter(f RTCPFormatCallback) PacketDumperOption {
5971 }
6072}
6173
62- // RTPBinaryFormatter sets the RTP binary formatter.
74+ // RTPBinaryFormatter sets the RTP binary formatter used by the default packet
75+ // logger.
6376func RTPBinaryFormatter (f RTPBinaryFormatCallback ) PacketDumperOption {
6477 return func (d * PacketDumper ) error {
6578 d .rtpFormatBinary = f
@@ -68,7 +81,8 @@ func RTPBinaryFormatter(f RTPBinaryFormatCallback) PacketDumperOption {
6881 }
6982}
7083
71- // RTCPBinaryFormatter sets the RTCP binary formatter.
84+ // RTCPBinaryFormatter sets the RTCP binary formatter used by the default packet
85+ // logger.
7286func RTCPBinaryFormatter (f RTCPBinaryFormatCallback ) PacketDumperOption {
7387 return func (d * PacketDumper ) error {
7488 d .rtcpFormatBinary = f
@@ -77,7 +91,7 @@ func RTCPBinaryFormatter(f RTCPBinaryFormatCallback) PacketDumperOption {
7791 }
7892}
7993
80- // RTPFilter sets the RTP filter.
94+ // RTPFilter sets the RTP filter used by the default packet logger .
8195func RTPFilter (callback RTPFilterCallback ) PacketDumperOption {
8296 return func (d * PacketDumper ) error {
8397 d .rtpFilter = callback
@@ -86,7 +100,7 @@ func RTPFilter(callback RTPFilterCallback) PacketDumperOption {
86100 }
87101}
88102
89- // RTCPFilter sets the RTCP filter.
103+ // RTCPFilter sets the RTCP filter used by the default packet logger .
90104// Deprecated: prefer RTCPPerPacketFilter.
91105func RTCPFilter (callback RTCPFilterCallback ) PacketDumperOption {
92106 return func (d * PacketDumper ) error {
@@ -96,7 +110,8 @@ func RTCPFilter(callback RTCPFilterCallback) PacketDumperOption {
96110 }
97111}
98112
99- // RTCPPerPacketFilter sets the RTCP per-packet filter.
113+ // RTCPPerPacketFilter sets the RTCP per-packet filter used by the default
114+ // packet logger.
100115func RTCPPerPacketFilter (callback RTCPPerPacketFilterCallback ) PacketDumperOption {
101116 return func (d * PacketDumper ) error {
102117 d .rtcpPerPacketFilter = callback
0 commit comments