From 5f4a7e004ebad7f7ffdc7bd537a734df467ac46b Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Mon, 3 Jul 2023 11:18:37 +0200 Subject: [PATCH] Log last received RTP timestamp when requesting a PLI due to timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit which helps finding the associated packets in Wireshark dumps BUG=None Change-Id: I216b3e87606b914781c3a2ed61a0118dcd7c1ec2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308822 Reviewed-by: Ilya Nikolaevskiy Reviewed-by: Henrik Boström Commit-Queue: Philipp Hancke Cr-Commit-Position: refs/heads/main@{#40397} --- video/rtp_video_stream_receiver2.cc | 6 ++++++ video/rtp_video_stream_receiver2.h | 1 + video/video_receive_stream2.cc | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc index a01e60f8bb..7634764336 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -1039,6 +1039,12 @@ absl::optional RtpVideoStreamReceiver2::LastReceivedPacketMs() const { return absl::nullopt; } +absl::optional +RtpVideoStreamReceiver2::LastReceivedFrameRtpTimestamp() const { + RTC_DCHECK_RUN_ON(&packet_sequence_checker_); + return last_received_rtp_timestamp_; +} + absl::optional RtpVideoStreamReceiver2::LastReceivedKeyframePacketMs() const { RTC_DCHECK_RUN_ON(&packet_sequence_checker_); diff --git a/video/rtp_video_stream_receiver2.h b/video/rtp_video_stream_receiver2.h index f9ed339c0a..0178355262 100644 --- a/video/rtp_video_stream_receiver2.h +++ b/video/rtp_video_stream_receiver2.h @@ -204,6 +204,7 @@ class RtpVideoStreamReceiver2 : public LossNotificationSender, void SetProtectionPayloadTypes(int red_payload_type, int ulpfec_payload_type); absl::optional LastReceivedPacketMs() const; + absl::optional LastReceivedFrameRtpTimestamp() const; absl::optional LastReceivedKeyframePacketMs() const; private: diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc index 4a7e7ac577..31a52aa1b7 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -822,8 +822,13 @@ void VideoReceiveStream2::OnDecodableFrameTimeout(TimeDelta wait) { if (stream_is_active && !IsReceivingKeyFrame(now) && (!config_.crypto_options.sframe.require_frame_encryption || rtp_video_stream_receiver_.IsDecryptable())) { + absl::optional last_timestamp = + rtp_video_stream_receiver_.LastReceivedFrameRtpTimestamp(); RTC_LOG(LS_WARNING) << "No decodable frame in " << wait - << ", requesting keyframe."; + << " requesting keyframe. Last RTP timestamp " + << (last_timestamp ? rtc::ToString(*last_timestamp) + : "") + << "."; RequestKeyFrame(now); }