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}
This commit is contained in:
ilnik
2017-07-06 03:06:50 -07:00
committed by Commit Bot
parent 5b7fc8ce42
commit 2edc6845ac
34 changed files with 376 additions and 67 deletions

View File

@ -21,21 +21,22 @@
namespace webrtc {
VCMTiming::VCMTiming(Clock* clock, VCMTiming* master_timing)
: clock_(clock),
master_(false),
ts_extrapolator_(),
codec_timer_(new VCMCodecTimer()),
render_delay_ms_(kDefaultRenderDelayMs),
min_playout_delay_ms_(0),
max_playout_delay_ms_(10000),
jitter_delay_ms_(0),
current_delay_ms_(0),
last_decode_ms_(0),
prev_frame_timestamp_(0),
num_decoded_frames_(0),
num_delayed_decoded_frames_(0),
first_decoded_frame_ms_(-1),
sum_missed_render_deadline_ms_(0) {
: clock_(clock),
master_(false),
ts_extrapolator_(),
codec_timer_(new VCMCodecTimer()),
render_delay_ms_(kDefaultRenderDelayMs),
min_playout_delay_ms_(0),
max_playout_delay_ms_(10000),
jitter_delay_ms_(0),
current_delay_ms_(0),
last_decode_ms_(0),
prev_frame_timestamp_(0),
timing_frame_info_(),
num_decoded_frames_(0),
num_delayed_decoded_frames_(0),
first_decoded_frame_ms_(-1),
sum_missed_render_deadline_ms_(0) {
if (master_timing == NULL) {
master_ = true;
ts_extrapolator_ = new TimestampExtrapolator(clock_->TimeInMilliseconds());
@ -304,4 +305,14 @@ bool VCMTiming::GetTimings(int* decode_ms,
return (num_decoded_frames_ > 0);
}
void VCMTiming::SetTimingFrameInfo(const TimingFrameInfo& info) {
rtc::CritScope cs(&crit_sect_);
timing_frame_info_.emplace(info);
}
rtc::Optional<TimingFrameInfo> VCMTiming::GetTimingFrameInfo() {
rtc::CritScope cs(&crit_sect_);
return timing_frame_info_;
}
} // namespace webrtc