Reduce chatty logs (#592)
This commit is contained in:
@@ -461,7 +461,6 @@ func (b *Buffer) getExtPacket(rawPacket []byte, rtpPacket *rtp.Packet, arrivalTi
|
|||||||
ep.KeyFrame = IsAV1Keyframe(rtpPacket.Payload)
|
ep.KeyFrame = IsAV1Keyframe(rtpPacket.Payload)
|
||||||
}
|
}
|
||||||
if ep.KeyFrame {
|
if ep.KeyFrame {
|
||||||
b.logger.Debugw("key frame received")
|
|
||||||
if b.rtpStats != nil {
|
if b.rtpStats != nil {
|
||||||
b.rtpStats.UpdateKeyFrame(1)
|
b.rtpStats.UpdateKeyFrame(1)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,7 +176,6 @@ func (r *RTPStats) Update(rtph *rtp.Header, payloadSize int, paddingSize int, pa
|
|||||||
r.highestTime = packetTime
|
r.highestTime = packetTime
|
||||||
|
|
||||||
r.extStartSN = uint32(rtph.SequenceNumber)
|
r.extStartSN = uint32(rtph.SequenceNumber)
|
||||||
r.logger.Debugw("RTPSTATS_DEBUG, setting extStartSN init", "extStartSN", r.extStartSN) // LK-DEBUG-REMOVE
|
|
||||||
r.cycles = 0
|
r.cycles = 0
|
||||||
|
|
||||||
first = true
|
first = true
|
||||||
@@ -211,24 +210,6 @@ func (r *RTPStats) Update(rtph *rtp.Header, payloadSize int, paddingSize int, pa
|
|||||||
flowState.LossStartInclusive = r.highestSN + 1
|
flowState.LossStartInclusive = r.highestSN + 1
|
||||||
flowState.LossEndExclusive = rtph.SequenceNumber
|
flowState.LossEndExclusive = rtph.SequenceNumber
|
||||||
}
|
}
|
||||||
// LK-DEBUG-REMOVE START
|
|
||||||
if diff > 100 {
|
|
||||||
r.logger.Debugw(
|
|
||||||
"RTPSTATS_DEBUG huge difference in sequence number",
|
|
||||||
"diff", diff,
|
|
||||||
"highestSN", r.highestSN,
|
|
||||||
"sn", rtph.SequenceNumber,
|
|
||||||
"startSN", r.extStartSN,
|
|
||||||
"lost", r.packetsLost,
|
|
||||||
"highestTS", r.highestTS,
|
|
||||||
"ts", rtph.Timestamp,
|
|
||||||
"tsDiff", rtph.Timestamp-r.highestTS,
|
|
||||||
"highestTime", r.highestTime,
|
|
||||||
"now", packetTime,
|
|
||||||
"timeDiff(ms)", float64(packetTime-r.highestTime)/1e6,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
// LK-DEBUG-REMOVE END
|
|
||||||
|
|
||||||
// update gap histogram
|
// update gap histogram
|
||||||
r.updateGapHistogram(int(diff))
|
r.updateGapHistogram(int(diff))
|
||||||
@@ -277,27 +258,9 @@ func (r *RTPStats) maybeAdjustStartSN(rtph *rtp.Header, packetTime int64) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// LK-DEBUG-REMOVE START
|
|
||||||
r.logger.Debugw(
|
|
||||||
"RTPSTATS_DEBUG moving starting SN back",
|
|
||||||
"diff", rtph.SequenceNumber-uint16(r.extStartSN),
|
|
||||||
"loss added", uint16(r.extStartSN)-rtph.SequenceNumber,
|
|
||||||
"highestSN", r.highestSN,
|
|
||||||
"sn", rtph.SequenceNumber,
|
|
||||||
"startSN", r.extStartSN,
|
|
||||||
"lost", r.packetsLost,
|
|
||||||
"highestTS", r.highestTS,
|
|
||||||
"ts", rtph.Timestamp,
|
|
||||||
"tsDiff", rtph.Timestamp-r.highestTS,
|
|
||||||
"highestTime", r.highestTime,
|
|
||||||
"now", packetTime,
|
|
||||||
"timeDiff(ms)", float64(packetTime-r.highestTime)/1e6,
|
|
||||||
)
|
|
||||||
// LK-DEBUG-REMOVE END
|
|
||||||
// NOTE: current sequence number is counted as loss as it will be deducted in the duplicate check
|
// NOTE: current sequence number is counted as loss as it will be deducted in the duplicate check
|
||||||
r.packetsLost += uint32(uint16(r.extStartSN) - rtph.SequenceNumber)
|
r.packetsLost += uint32(uint16(r.extStartSN) - rtph.SequenceNumber)
|
||||||
r.extStartSN = uint32(rtph.SequenceNumber)
|
r.extStartSN = uint32(rtph.SequenceNumber)
|
||||||
r.logger.Debugw("RTPSTATS_DEBUG, setting extStartSN moving back", "extStartSN", r.extStartSN) // LK-DEBUG-REMOVE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RTPStats) GetTotalPacketsPrimary() uint32 {
|
func (r *RTPStats) GetTotalPacketsPrimary() uint32 {
|
||||||
|
|||||||
@@ -411,6 +411,8 @@ func (d *DownTrack) WriteRTP(extPkt *buffer.ExtPacket, layer int32) error {
|
|||||||
if locked {
|
if locked {
|
||||||
d.stopKeyFrameRequester()
|
d.stopKeyFrameRequester()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
d.logger.Debugw("forwarding key frame", "layer", layer)
|
||||||
}
|
}
|
||||||
|
|
||||||
d.rtpStats.Update(hdr, len(payload), 0, time.Now().UnixNano())
|
d.rtpStats.Update(hdr, len(payload), 0, time.Now().UnixNano())
|
||||||
@@ -935,6 +937,7 @@ func (d *DownTrack) handleRTCP(bytes []byte) {
|
|||||||
if pliOnce {
|
if pliOnce {
|
||||||
targetLayers := d.forwarder.TargetLayers()
|
targetLayers := d.forwarder.TargetLayers()
|
||||||
if targetLayers != InvalidLayers {
|
if targetLayers != InvalidLayers {
|
||||||
|
d.logger.Debugw("sending PLI RTCP", "layer", targetLayers.spatial)
|
||||||
d.receiver.SendPLI(targetLayers.spatial)
|
d.receiver.SendPLI(targetLayers.spatial)
|
||||||
d.isNACKThrottled.Store(true)
|
d.isNACKThrottled.Store(true)
|
||||||
d.rtpStats.UpdatePliTime()
|
d.rtpStats.UpdatePliTime()
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import (
|
|||||||
|
|
||||||
type TestExtPacketParams struct {
|
type TestExtPacketParams struct {
|
||||||
SetMarker bool
|
SetMarker bool
|
||||||
SetPadding bool
|
|
||||||
IsHead bool
|
IsHead bool
|
||||||
IsKeyFrame bool
|
IsKeyFrame bool
|
||||||
PayloadType uint8
|
PayloadType uint8
|
||||||
@@ -19,7 +18,7 @@ type TestExtPacketParams struct {
|
|||||||
Timestamp uint32
|
Timestamp uint32
|
||||||
SSRC uint32
|
SSRC uint32
|
||||||
PayloadSize int
|
PayloadSize int
|
||||||
PaddingSize int
|
PaddingSize byte
|
||||||
ArrivalTime int64
|
ArrivalTime int64
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,15 +28,15 @@ func GetTestExtPacket(params *TestExtPacketParams) (*buffer.ExtPacket, error) {
|
|||||||
packet := rtp.Packet{
|
packet := rtp.Packet{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
Version: 2,
|
Version: 2,
|
||||||
Padding: params.SetPadding,
|
Padding: params.PaddingSize != 0,
|
||||||
Marker: params.SetMarker,
|
Marker: params.SetMarker,
|
||||||
PayloadType: params.PayloadType,
|
PayloadType: params.PayloadType,
|
||||||
SequenceNumber: params.SequenceNumber,
|
SequenceNumber: params.SequenceNumber,
|
||||||
Timestamp: params.Timestamp,
|
Timestamp: params.Timestamp,
|
||||||
SSRC: params.SSRC,
|
SSRC: params.SSRC,
|
||||||
},
|
},
|
||||||
Payload: make([]byte, params.PayloadSize),
|
Payload: make([]byte, params.PayloadSize),
|
||||||
// LK-TODO need a newer version of pion/rtp PaddingSize: params.PaddingSize,
|
PaddingSize: params.PaddingSize,
|
||||||
}
|
}
|
||||||
|
|
||||||
raw, err := packet.Marshal()
|
raw, err := packet.Marshal()
|
||||||
|
|||||||
Reference in New Issue
Block a user