OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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/modules/congestion_controller/probe_bitrate_estimator.h" | 11 #include "webrtc/modules/congestion_controller/probe_bitrate_estimator.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 | 14 |
15 #include "webrtc/base/logging.h" | 15 #include "webrtc/base/logging.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 // Max number of saved clusters. | 18 // Max number of saved clusters. |
19 constexpr size_t kMaxNumSavedClusters = 5; | 19 constexpr size_t kMaxNumSavedClusters = 5; |
20 | 20 |
21 // The minumum number of probes we need for a valid cluster. | 21 // The minumum number of probes we need for a valid cluster. |
22 constexpr int kMinNumProbesValidCluster = 4; | 22 constexpr int kMinNumProbesValidCluster = 4; |
23 | 23 |
24 // The maximum (receive rate)/(send rate) ratio for a valid estimate. | 24 // The maximum (receive rate)/(send rate) ratio for a valid estimate. |
25 constexpr float kValidRatio = 1.2f; | 25 constexpr float kValidRatio = 2.0f; |
26 } | 26 } |
27 | 27 |
28 namespace webrtc { | 28 namespace webrtc { |
29 | 29 |
30 ProbingResult::ProbingResult() : bps(kNoEstimate), timestamp(0) {} | 30 ProbingResult::ProbingResult() : bps(kNoEstimate), timestamp(0) {} |
31 | 31 |
32 ProbingResult::ProbingResult(int bps, int64_t timestamp) | 32 ProbingResult::ProbingResult(int bps, int64_t timestamp) |
33 : bps(bps), timestamp(timestamp) {} | 33 : bps(bps), timestamp(timestamp) {} |
34 | 34 |
35 bool ProbingResult::valid() const { | 35 bool ProbingResult::valid() const { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 << " [cluster id: " << packet_info.probe_cluster_id | 111 << " [cluster id: " << packet_info.probe_cluster_id |
112 << "] [send: " << cluster->size << " bytes / " | 112 << "] [send: " << cluster->size << " bytes / " |
113 << send_interval_ms << " ms = " << send_bps / 1000 << " kb/s]" | 113 << send_interval_ms << " ms = " << send_bps / 1000 << " kb/s]" |
114 << " [receive: " << cluster->size << " bytes / " | 114 << " [receive: " << cluster->size << " bytes / " |
115 << receive_interval_ms << " ms = " << receive_bps / 1000 | 115 << receive_interval_ms << " ms = " << receive_bps / 1000 |
116 << " kb/s]"; | 116 << " kb/s]"; |
117 | 117 |
118 return ProbingResult(result_bps, packet_info.arrival_time_ms); | 118 return ProbingResult(result_bps, packet_info.arrival_time_ms); |
119 } | 119 } |
120 } // namespace webrtc | 120 } // namespace webrtc |
OLD | NEW |