From b88b44e7a4d32bc630d805da6427e796dae5f22e Mon Sep 17 00:00:00 2001 From: Johannes Kron Date: Thu, 22 Aug 2019 13:16:44 +0200 Subject: [PATCH] Don't include duplicated and incomplete frames in stats. The received frames statistics currently include also frames that are dropped because they are duplicated, incomplete, or the buffer being full. After this CL only frames that are added to the decode queue are counted. This CL is part of fixing the dropped frames statistics that are currently also counting frames that are in the decode queue. Bug: chromium:990317 Change-Id: I7df31939ecb7b9e222086e1141a15420fa2819dc Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150108 Commit-Queue: Johannes Kron Reviewed-by: Ilya Nikolaevskiy Cr-Commit-Position: refs/heads/master@{#28939} --- modules/video_coding/frame_buffer2.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/video_coding/frame_buffer2.cc b/modules/video_coding/frame_buffer2.cc index d9699467a3..376cff3b65 100644 --- a/modules/video_coding/frame_buffer2.cc +++ b/modules/video_coding/frame_buffer2.cc @@ -453,12 +453,7 @@ int64_t FrameBuffer::InsertFrame(std::unique_ptr frame) { rtc::CritScope lock(&crit_); - if (stats_callback_ && IsCompleteSuperFrame(*frame)) { - stats_callback_->OnCompleteFrame(frame->is_keyframe(), frame->size(), - frame->contentType()); - } const VideoLayerFrameId& id = frame->id; - int64_t last_continuous_picture_id = !last_continuous_frame_ ? -1 : last_continuous_frame_->picture_id; @@ -542,6 +537,11 @@ int64_t FrameBuffer::InsertFrame(std::unique_ptr frame) { if (!frame->delayed_by_retransmission()) timing_->IncomingTimestamp(frame->Timestamp(), frame->ReceivedTime()); + if (stats_callback_ && IsCompleteSuperFrame(*frame)) { + stats_callback_->OnCompleteFrame(frame->is_keyframe(), frame->size(), + frame->contentType()); + } + info->second.frame = std::move(frame); if (info->second.num_missing_continuous == 0) {