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

Side by Side Diff: webrtc/video/receive_statistics_proxy.cc

Issue 1885393002: Add histogram stats for jitter buffer delay and target delay for received video streams: (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 8 months 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 unified diff | Download patch
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (qp != -1) 70 if (qp != -1)
71 RTC_LOGGED_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp); 71 RTC_LOGGED_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp);
72 72
73 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and 73 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and
74 // not per frame. Change decode time to include every frame. 74 // not per frame. Change decode time to include every frame.
75 const int kMinRequiredDecodeSamples = 5; 75 const int kMinRequiredDecodeSamples = 5;
76 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); 76 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples);
77 if (decode_ms != -1) 77 if (decode_ms != -1)
78 RTC_LOGGED_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); 78 RTC_LOGGED_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms);
79 79
80 int jb_delay_ms = jitter_buffer_delay_counter_.Avg(kMinRequiredDecodeSamples);
81 if (jb_delay_ms != -1) {
82 RTC_LOGGED_HISTOGRAM_COUNTS_10000("WebRTC.Video.JitterBufferDelayInMs",
83 jb_delay_ms);
84 }
85 int target_delay_ms = target_delay_counter_.Avg(kMinRequiredDecodeSamples);
stefan-webrtc 2016/04/26 08:19:26 We also have "current delay ms" which refers to th
åsapersson 2016/04/26 10:23:58 Ok, added current delay.
86 if (target_delay_ms != -1) {
87 RTC_LOGGED_HISTOGRAM_COUNTS_10000("WebRTC.Video.TargetDelayInMs",
88 target_delay_ms);
89 }
90
80 int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples); 91 int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples);
81 if (delay_ms != -1) 92 if (delay_ms != -1)
82 RTC_LOGGED_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms); 93 RTC_LOGGED_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms);
83 94
84 StreamDataCounters rtp = stats_.rtp_stats; 95 StreamDataCounters rtp = stats_.rtp_stats;
85 StreamDataCounters rtx; 96 StreamDataCounters rtx;
86 for (auto it : rtx_stats_) 97 for (auto it : rtx_stats_)
87 rtx.Add(it.second); 98 rtx.Add(it.second);
88 StreamDataCounters rtp_rtx = rtp; 99 StreamDataCounters rtp_rtx = rtp;
89 rtp_rtx.Add(rtx); 100 rtp_rtx.Add(rtx);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 int64_t rtt_ms) { 174 int64_t rtt_ms) {
164 rtc::CritScope lock(&crit_); 175 rtc::CritScope lock(&crit_);
165 stats_.decode_ms = decode_ms; 176 stats_.decode_ms = decode_ms;
166 stats_.max_decode_ms = max_decode_ms; 177 stats_.max_decode_ms = max_decode_ms;
167 stats_.current_delay_ms = current_delay_ms; 178 stats_.current_delay_ms = current_delay_ms;
168 stats_.target_delay_ms = target_delay_ms; 179 stats_.target_delay_ms = target_delay_ms;
169 stats_.jitter_buffer_ms = jitter_buffer_ms; 180 stats_.jitter_buffer_ms = jitter_buffer_ms;
170 stats_.min_playout_delay_ms = min_playout_delay_ms; 181 stats_.min_playout_delay_ms = min_playout_delay_ms;
171 stats_.render_delay_ms = render_delay_ms; 182 stats_.render_delay_ms = render_delay_ms;
172 decode_time_counter_.Add(decode_ms); 183 decode_time_counter_.Add(decode_ms);
184 jitter_buffer_delay_counter_.Add(jitter_buffer_ms);
185 target_delay_counter_.Add(target_delay_ms);
åsapersson 2016/04/20 10:48:47 Let target delay stats replace metric below and th
åsapersson 2016/04/26 10:23:58 Reland CL above?
stefan-webrtc 2016/04/26 10:39:42 Sgtm if Magnus agrees.
173 // Network delay (rtt/2) + target_delay_ms (jitter delay + decode time + 186 // Network delay (rtt/2) + target_delay_ms (jitter delay + decode time +
174 // render delay). 187 // render delay).
175 delay_counter_.Add(target_delay_ms + rtt_ms / 2); 188 delay_counter_.Add(target_delay_ms + rtt_ms / 2);
176 } 189 }
177 190
178 void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated( 191 void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated(
179 uint32_t ssrc, 192 uint32_t ssrc,
180 const RtcpPacketTypeCounter& packet_counter) { 193 const RtcpPacketTypeCounter& packet_counter) {
181 rtc::CritScope lock(&crit_); 194 rtc::CritScope lock(&crit_);
182 if (stats_.ssrc != ssrc) 195 if (stats_.ssrc != ssrc)
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 ++num_samples; 293 ++num_samples;
281 } 294 }
282 295
283 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { 296 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const {
284 if (num_samples < min_required_samples || num_samples == 0) 297 if (num_samples < min_required_samples || num_samples == 0)
285 return -1; 298 return -1;
286 return sum / num_samples; 299 return sum / num_samples;
287 } 300 }
288 301
289 } // namespace webrtc 302 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698