OLD | NEW |
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 Loading... |
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); |
| 86 if (target_delay_ms != -1) { |
| 87 RTC_LOGGED_HISTOGRAM_COUNTS_10000("WebRTC.Video.TargetDelayInMs", |
| 88 target_delay_ms); |
| 89 } |
| 90 int current_delay_ms = current_delay_counter_.Avg(kMinRequiredDecodeSamples); |
| 91 if (current_delay_ms != -1) { |
| 92 RTC_LOGGED_HISTOGRAM_COUNTS_10000("WebRTC.Video.CurrentDelayInMs", |
| 93 current_delay_ms); |
| 94 } |
| 95 |
80 int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples); | 96 int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples); |
81 if (delay_ms != -1) | 97 if (delay_ms != -1) |
82 RTC_LOGGED_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms); | 98 RTC_LOGGED_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms); |
83 | 99 |
84 StreamDataCounters rtp = stats_.rtp_stats; | 100 StreamDataCounters rtp = stats_.rtp_stats; |
85 StreamDataCounters rtx; | 101 StreamDataCounters rtx; |
86 for (auto it : rtx_stats_) | 102 for (auto it : rtx_stats_) |
87 rtx.Add(it.second); | 103 rtx.Add(it.second); |
88 StreamDataCounters rtp_rtx = rtp; | 104 StreamDataCounters rtp_rtx = rtp; |
89 rtp_rtx.Add(rtx); | 105 rtp_rtx.Add(rtx); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 int64_t rtt_ms) { | 179 int64_t rtt_ms) { |
164 rtc::CritScope lock(&crit_); | 180 rtc::CritScope lock(&crit_); |
165 stats_.decode_ms = decode_ms; | 181 stats_.decode_ms = decode_ms; |
166 stats_.max_decode_ms = max_decode_ms; | 182 stats_.max_decode_ms = max_decode_ms; |
167 stats_.current_delay_ms = current_delay_ms; | 183 stats_.current_delay_ms = current_delay_ms; |
168 stats_.target_delay_ms = target_delay_ms; | 184 stats_.target_delay_ms = target_delay_ms; |
169 stats_.jitter_buffer_ms = jitter_buffer_ms; | 185 stats_.jitter_buffer_ms = jitter_buffer_ms; |
170 stats_.min_playout_delay_ms = min_playout_delay_ms; | 186 stats_.min_playout_delay_ms = min_playout_delay_ms; |
171 stats_.render_delay_ms = render_delay_ms; | 187 stats_.render_delay_ms = render_delay_ms; |
172 decode_time_counter_.Add(decode_ms); | 188 decode_time_counter_.Add(decode_ms); |
| 189 jitter_buffer_delay_counter_.Add(jitter_buffer_ms); |
| 190 target_delay_counter_.Add(target_delay_ms); |
| 191 current_delay_counter_.Add(current_delay_ms); |
173 // Network delay (rtt/2) + target_delay_ms (jitter delay + decode time + | 192 // Network delay (rtt/2) + target_delay_ms (jitter delay + decode time + |
174 // render delay). | 193 // render delay). |
175 delay_counter_.Add(target_delay_ms + rtt_ms / 2); | 194 delay_counter_.Add(target_delay_ms + rtt_ms / 2); |
176 } | 195 } |
177 | 196 |
178 void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated( | 197 void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated( |
179 uint32_t ssrc, | 198 uint32_t ssrc, |
180 const RtcpPacketTypeCounter& packet_counter) { | 199 const RtcpPacketTypeCounter& packet_counter) { |
181 rtc::CritScope lock(&crit_); | 200 rtc::CritScope lock(&crit_); |
182 if (stats_.ssrc != ssrc) | 201 if (stats_.ssrc != ssrc) |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 ++num_samples; | 299 ++num_samples; |
281 } | 300 } |
282 | 301 |
283 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { | 302 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { |
284 if (num_samples < min_required_samples || num_samples == 0) | 303 if (num_samples < min_required_samples || num_samples == 0) |
285 return -1; | 304 return -1; |
286 return sum / num_samples; | 305 return sum / num_samples; |
287 } | 306 } |
288 | 307 |
289 } // namespace webrtc | 308 } // namespace webrtc |
OLD | NEW |