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 |
11 #include "webrtc/video/send_statistics_proxy.h" | 11 #include "webrtc/video/send_statistics_proxy.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <map> | 14 #include <map> |
15 | 15 |
16 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
17 | 17 |
| 18 #include "webrtc/base/logging.h" |
18 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" | 19 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" |
19 #include "webrtc/system_wrappers/interface/logging.h" | |
20 #include "webrtc/system_wrappers/interface/metrics.h" | 20 #include "webrtc/system_wrappers/interface/metrics.h" |
21 | 21 |
22 namespace webrtc { | 22 namespace webrtc { |
23 | 23 |
24 const int SendStatisticsProxy::kStatsTimeoutMs = 5000; | 24 const int SendStatisticsProxy::kStatsTimeoutMs = 5000; |
25 | 25 |
26 SendStatisticsProxy::SendStatisticsProxy(Clock* clock, | 26 SendStatisticsProxy::SendStatisticsProxy(Clock* clock, |
27 const VideoSendStream::Config& config) | 27 const VideoSendStream::Config& config) |
28 : clock_(clock), | 28 : clock_(clock), |
29 config_(config), | 29 config_(config), |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 } | 337 } |
338 | 338 |
339 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 339 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
340 int min_required_samples, float multiplier) const { | 340 int min_required_samples, float multiplier) const { |
341 if (num_samples < min_required_samples || num_samples == 0) | 341 if (num_samples < min_required_samples || num_samples == 0) |
342 return -1; | 342 return -1; |
343 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 343 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
344 } | 344 } |
345 | 345 |
346 } // namespace webrtc | 346 } // namespace webrtc |
OLD | NEW |