| 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/base/logging.h" |
| 19 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" | 19 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
| 20 #include "webrtc/system_wrappers/interface/metrics.h" | 20 #include "webrtc/system_wrappers/include/metrics.h" |
| 21 | 21 |
| 22 namespace webrtc { | 22 namespace webrtc { |
| 23 namespace { | 23 namespace { |
| 24 // Used by histograms. Values of entries should not be changed. | 24 // Used by histograms. Values of entries should not be changed. |
| 25 enum HistogramCodecType { | 25 enum HistogramCodecType { |
| 26 kVideoUnknown = 0, | 26 kVideoUnknown = 0, |
| 27 kVideoVp8 = 1, | 27 kVideoVp8 = 1, |
| 28 kVideoVp9 = 2, | 28 kVideoVp9 = 2, |
| 29 kVideoH264 = 3, | 29 kVideoH264 = 3, |
| 30 kVideoMax = 64, | 30 kVideoMax = 64, |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 } | 367 } |
| 368 | 368 |
| 369 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 369 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
| 370 int min_required_samples, float multiplier) const { | 370 int min_required_samples, float multiplier) const { |
| 371 if (num_samples < min_required_samples || num_samples == 0) | 371 if (num_samples < min_required_samples || num_samples == 0) |
| 372 return -1; | 372 return -1; |
| 373 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 373 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
| 374 } | 374 } |
| 375 | 375 |
| 376 } // namespace webrtc | 376 } // namespace webrtc |
| OLD | NEW |