Log large packets receive/send. (#4521)

* Log large packets receive/send.

Seeing cases of servers reporting need for segmentation/re-assembly of
packets. So, logging packet receive/send for RTP/RTCP to check if
anything is seeing more than 1400 byte packets.

* log downtrack RTCP too
This commit is contained in:
Raja Subramanian
2026-05-13 16:04:53 +05:30
committed by GitHub
parent d123675008
commit ef2e5efe14
5 changed files with 30 additions and 3 deletions
+4 -2
View File
@@ -138,9 +138,11 @@ func (b *Buffer) Bind(params webrtc.RTPParameters, codec webrtc.RTPCodecCapabili
}
// Write adds an RTP Packet, ordering is not guaranteed, newer packets may arrive later
//
//go:noinline
func (b *Buffer) Write(pkt []byte) (n int, err error) {
if len(pkt) > 1400 {
b.logger.Infow("large RTP packet received", "size", len(pkt))
}
var rtpPacket rtp.Packet
err = rtpPacket.Unmarshal(pkt)
if err != nil {