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 <cmath> | 14 #include <cmath> |
15 #include <map> | 15 #include <map> |
16 | 16 |
17 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
18 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
19 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | |
20 #include "webrtc/system_wrappers/include/metrics.h" | 19 #include "webrtc/system_wrappers/include/metrics.h" |
21 | 20 |
22 namespace webrtc { | 21 namespace webrtc { |
23 namespace { | 22 namespace { |
24 const float kEncodeTimeWeigthFactor = 0.5f; | 23 const float kEncodeTimeWeigthFactor = 0.5f; |
25 | 24 |
26 // Used by histograms. Values of entries should not be changed. | 25 // Used by histograms. Values of entries should not be changed. |
27 enum HistogramCodecType { | 26 enum HistogramCodecType { |
28 kVideoUnknown = 0, | 27 kVideoUnknown = 0, |
29 kVideoVp8 = 1, | 28 kVideoVp8 = 1, |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 return Fraction(min_required_samples, 1000.0f); | 425 return Fraction(min_required_samples, 1000.0f); |
427 } | 426 } |
428 | 427 |
429 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 428 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
430 int min_required_samples, float multiplier) const { | 429 int min_required_samples, float multiplier) const { |
431 if (num_samples < min_required_samples || num_samples == 0) | 430 if (num_samples < min_required_samples || num_samples == 0) |
432 return -1; | 431 return -1; |
433 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 432 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
434 } | 433 } |
435 } // namespace webrtc | 434 } // namespace webrtc |
OLD | NEW |