Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Unified Diff: webrtc/modules/video_coding/frame_buffer2.cc

Issue 2534093003: Calculate JitterBufferDelayInMs in the new jitter buffer. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/frame_buffer2.cc
diff --git a/webrtc/modules/video_coding/frame_buffer2.cc b/webrtc/modules/video_coding/frame_buffer2.cc
index bf1760ec279052482152c602ec3b6e0d21db7653..279c613424a7dde7154aa1ea0bad786c809d5e84 100644
--- a/webrtc/modules/video_coding/frame_buffer2.cc
+++ b/webrtc/modules/video_coding/frame_buffer2.cc
@@ -45,9 +45,7 @@ FrameBuffer::FrameBuffer(Clock* clock,
num_frames_history_(0),
num_frames_buffered_(0),
stopped_(false),
- protection_mode_(kProtectionNack),
- num_total_frames_(0),
- num_key_frames_(0) {}
+ protection_mode_(kProtectionNack) {}
FrameBuffer::~FrameBuffer() {
UpdateHistograms();
@@ -133,6 +131,8 @@ FrameBuffer::ReturnReason FrameBuffer::NextFrame(
timing_->UpdateCurrentDelay(frame->RenderTime(),
clock_->TimeInMilliseconds());
+ UpdateJitterDelay();
+
PropagateDecodability(next_frame_it->second);
AdvanceLastDecodedFrame(next_frame_it);
*frame_out = std::move(frame);
@@ -364,6 +364,16 @@ bool FrameBuffer::UpdateFrameInfoWithIncomingFrame(const FrameObject& frame,
return true;
}
+void FrameBuffer::UpdateJitterDelay() {
+ int unused;
+ int delay;
+ timing_->GetTimings(&unused, &unused, &unused, &unused, &delay, &unused,
+ &unused);
+
+ accumulated_delay_ += delay;
+ ++accumulated_delay_samples_;
+}
+
void FrameBuffer::UpdateHistograms() const {
rtc::CritScope lock(&crit_);
if (num_total_frames_ > 0) {
@@ -373,6 +383,11 @@ void FrameBuffer::UpdateHistograms() const {
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesReceivedInPermille",
key_frames_permille);
}
+
+ if (accumulated_delay_samples_ > 0) {
+ RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.JitterBufferDelayInMs",
+ accumulated_delay_ / accumulated_delay_samples_);
+ }
}
} // namespace video_coding

Powered by Google App Engine
This is Rietveld 408576698