| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 void StatisticsCalculator::LogDelayedPacketOutageEvent(int outage_duration_ms) { | 188 void StatisticsCalculator::LogDelayedPacketOutageEvent(int outage_duration_ms) { |
| 189 RTC_HISTOGRAM_COUNTS("WebRTC.Audio.DelayedPacketOutageEventMs", | 189 RTC_HISTOGRAM_COUNTS("WebRTC.Audio.DelayedPacketOutageEventMs", |
| 190 outage_duration_ms, 1 /* min */, 2000 /* max */, | 190 outage_duration_ms, 1 /* min */, 2000 /* max */, |
| 191 100 /* bucket count */); | 191 100 /* bucket count */); |
| 192 delayed_packet_outage_counter_.RegisterSample(); | 192 delayed_packet_outage_counter_.RegisterSample(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void StatisticsCalculator::StoreWaitingTime(int waiting_time_ms) { | 195 void StatisticsCalculator::StoreWaitingTime(int waiting_time_ms) { |
| 196 excess_buffer_delay_.RegisterSample(waiting_time_ms); | 196 excess_buffer_delay_.RegisterSample(waiting_time_ms); |
| 197 DCHECK_LE(waiting_times_.size(), kLenWaitingTimes); | 197 DCHECK_LE(waiting_times_.size(), kLenWaitingTimes); |
| 198 while (waiting_times_.size() >= kLenWaitingTimes) { | 198 if (waiting_times_.size() == kLenWaitingTimes) { |
| 199 // Erase first value. | 199 // Erase first value. |
| 200 waiting_times_.pop_front(); | 200 waiting_times_.pop_front(); |
| 201 } | 201 } |
| 202 waiting_times_.push_back(waiting_time_ms); | 202 waiting_times_.push_back(waiting_time_ms); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void StatisticsCalculator::GetNetworkStatistics( | 205 void StatisticsCalculator::GetNetworkStatistics( |
| 206 int fs_hz, | 206 int fs_hz, |
| 207 size_t num_samples_in_buffers, | 207 size_t num_samples_in_buffers, |
| 208 size_t samples_per_packet, | 208 size_t samples_per_packet, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // Ratio must be smaller than 1 in Q14. | 286 // Ratio must be smaller than 1 in Q14. |
| 287 assert((numerator << 14) / denominator < (1 << 14)); | 287 assert((numerator << 14) / denominator < (1 << 14)); |
| 288 return static_cast<uint16_t>((numerator << 14) / denominator); | 288 return static_cast<uint16_t>((numerator << 14) / denominator); |
| 289 } else { | 289 } else { |
| 290 // Will not produce a ratio larger than 1, since this is probably an error. | 290 // Will not produce a ratio larger than 1, since this is probably an error. |
| 291 return 1 << 14; | 291 return 1 << 14; |
| 292 } | 292 } |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace webrtc | 295 } // namespace webrtc |
| OLD | NEW |