Log last decoded frame rtp timestamp

in addition to last received frame rtp timestamp. This helps in cases
where frames continue to be received but the decoder fails to decode.

BUG=None

Change-Id: I56ad5f9ef85cc598d3c1a1971c4c697eb6b70165
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356080
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Markus Handell <handellm@google.com>
Cr-Commit-Position: refs/heads/main@{#42596}
This commit is contained in:
Philipp Hancke 2024-07-02 07:59:58 -07:00 committed by WebRTC LUCI CQ
parent 121eeedc14
commit c02488f0f9
2 changed files with 9 additions and 1 deletions

View File

@ -783,13 +783,14 @@ void VideoReceiveStream2::OnEncodedFrame(std::unique_ptr<EncodedFrame> frame) {
RTC_DCHECK_RUN_ON(&decode_sequence_checker_);
if (decoder_stopped_)
return;
uint32_t rtp_timestamp = frame->RtpTimestamp();
DecodeFrameResult result = HandleEncodedFrameOnDecodeQueue(
std::move(frame), keyframe_request_is_due, keyframe_required);
// TODO(bugs.webrtc.org/11993): Make this PostTask to the network thread.
call_->worker_thread()->PostTask(
SafeTask(task_safety_.flag(),
[this, now, result = std::move(result),
[this, now, rtp_timestamp, result = std::move(result),
received_frame_is_keyframe, keyframe_request_is_due]() {
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
keyframe_required_ = result.keyframe_required;
@ -798,6 +799,7 @@ void VideoReceiveStream2::OnEncodedFrame(std::unique_ptr<EncodedFrame> frame) {
rtp_video_stream_receiver_.FrameDecoded(
*result.decoded_frame_picture_id);
}
last_decoded_rtp_timestamp_ = rtp_timestamp;
HandleKeyFrameGeneration(received_frame_is_keyframe, now,
result.force_request_key_frame,
@ -832,6 +834,10 @@ void VideoReceiveStream2::OnDecodableFrameTimeout(TimeDelta wait) {
<< " requesting keyframe. Last RTP timestamp "
<< (last_timestamp ? rtc::ToString(*last_timestamp)
: "<not set>")
<< ", last decoded frame RTP timestamp "
<< (last_decoded_rtp_timestamp_
? rtc::ToString(*last_decoded_rtp_timestamp_)
: "<not set>")
<< ".";
RequestKeyFrame(now);
}

View File

@ -350,6 +350,8 @@ class VideoReceiveStream2
// destructed to avoid races when running tasks on the `decode_queue_` during
// VideoReceiveStream2 destruction.
std::unique_ptr<TaskQueueBase, TaskQueueDeleter> decode_queue_;
absl::optional<uint32_t> last_decoded_rtp_timestamp_;
};
} // namespace internal