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); }