flexfec: increase verbosity of logging

- add recovered sequence number and length of the recovered packet
- increase level of periodic logging to LS_INFO
- log for every packet on LS_VERBOSE

This makes it easier to validate and debug flexfec implementations.

BUG=None

Change-Id: I6f9e73e72ec3dcc0531f7adc62ac7019c7899270
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254120
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#36162}
This commit is contained in:
Philipp Hancke
2022-03-09 10:00:15 +01:00
committed by WebRTC LUCI CQ
parent a0a3f9c578
commit 878c0299b3

View File

@ -159,18 +159,28 @@ void FlexfecReceiver::ProcessReceivedPacket(
// Set this flag first, since OnRecoveredPacket may end up here
// again, with the same packet.
recovered_packet->returned = true;
RTC_CHECK_GT(recovered_packet->pkt->data.size(), 0);
RTC_CHECK_GE(recovered_packet->pkt->data.size(), kRtpHeaderSize);
recovered_packet_receiver_->OnRecoveredPacket(
recovered_packet->pkt->data.cdata(),
recovered_packet->pkt->data.size());
// Periodically log the incoming packets.
uint32_t media_ssrc =
ForwardErrorCorrection::ParseSsrc(recovered_packet->pkt->data.data());
uint16_t media_seq_num = ForwardErrorCorrection::ParseSequenceNumber(
recovered_packet->pkt->data.data());
// Periodically log the incoming packets at LS_INFO.
int64_t now_ms = clock_->TimeInMilliseconds();
if (now_ms - last_recovered_packet_ms_ > kPacketLogIntervalMs) {
uint32_t media_ssrc =
ForwardErrorCorrection::ParseSsrc(recovered_packet->pkt->data.data());
RTC_LOG(LS_VERBOSE) << "Recovered media packet with SSRC: " << media_ssrc
<< " from FlexFEC stream with SSRC: " << ssrc_ << ".";
last_recovered_packet_ms_ = now_ms;
bool should_log_periodically =
now_ms - last_recovered_packet_ms_ > kPacketLogIntervalMs;
if (RTC_LOG_CHECK_LEVEL(LS_VERBOSE) || should_log_periodically) {
rtc::LoggingSeverity level =
should_log_periodically ? rtc::LS_INFO : rtc::LS_VERBOSE;
RTC_LOG_V(level) << "Recovered media packet with SSRC: " << media_ssrc
<< " seq " << media_seq_num << " recovered length "
<< recovered_packet->pkt->data.size()
<< " from FlexFEC stream with SSRC: " << ssrc_;
if (should_log_periodically) {
last_recovered_packet_ms_ = now_ms;
}
}
}
}