Report timing frames info in GetStats.
Some frames are already marked as 'timing frames' via video-timing RTP header extension. Timestamps along full WebRTC pipeline are gathered for these frames. This CL implements reporting of these timestamps for a single
timing frame since the last GetStats(). The frame with the longest end-to-end delay between two consecutive GetStats calls is reported.
The purpose of this timing information is not to provide a realtime statistics but to provide debugging information as it will help identify problematic places in video pipeline for outliers (frames which took longest to process).
BUG=webrtc:7594
Review-Url: https://codereview.webrtc.org/2946413002
Cr-Commit-Position: refs/heads/master@{#18909}
diff --git a/webrtc/modules/video_coding/frame_buffer2.cc b/webrtc/modules/video_coding/frame_buffer2.cc
index 1114e7c..2beffc7 100644
--- a/webrtc/modules/video_coding/frame_buffer2.cc
+++ b/webrtc/modules/video_coding/frame_buffer2.cc
@@ -149,6 +149,7 @@
}
UpdateJitterDelay();
+ UpdateTimingFrameInfo();
PropagateDecodability(next_frame_it_->second);
// Sanity check for RTP timestamp monotonicity.
@@ -534,8 +535,15 @@
}
}
+void FrameBuffer::UpdateTimingFrameInfo() {
+ TRACE_EVENT0("webrtc", "FrameBuffer::UpdateTimingFrameInfo");
+ rtc::Optional<TimingFrameInfo> info = timing_->GetTimingFrameInfo();
+ if (info)
+ stats_callback_->OnTimingFrameInfoUpdated(*info);
+}
+
void FrameBuffer::ClearFramesAndHistory() {
- TRACE_EVENT0("webrtc", "FrameBuffer::UpdateJitterDelay");
+ TRACE_EVENT0("webrtc", "FrameBuffer::ClearFramesAndHistory");
frames_.clear();
last_decoded_frame_it_ = frames_.end();
last_continuous_frame_it_ = frames_.end();