OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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/remote_bitrate_estimator/test/bwe.h" | 11 #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h" |
12 | 12 |
13 #include <limits> | 13 #include <limits> |
14 | 14 |
15 #include "webrtc/base/constructormagic.h" | 15 #include "webrtc/base/constructormagic.h" |
| 16 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/bbr.h" |
16 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/nada.h" | 17 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/nada.h" |
17 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h" | 18 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h" |
18 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h" | 19 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h" |
19 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/tcp.h" | 20 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/tcp.h" |
20 | 21 |
21 namespace webrtc { | 22 namespace webrtc { |
22 namespace testing { | 23 namespace testing { |
23 namespace bwe { | 24 namespace bwe { |
24 | 25 |
25 // With the assumption that packet loss is lower than 97%, the max gap | 26 // With the assumption that packet loss is lower than 97%, the max gap |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 int kbps, | 87 int kbps, |
87 BitrateObserver* observer, | 88 BitrateObserver* observer, |
88 Clock* clock) { | 89 Clock* clock) { |
89 switch (estimator) { | 90 switch (estimator) { |
90 case kRembEstimator: | 91 case kRembEstimator: |
91 return new RembBweSender(kbps, observer, clock); | 92 return new RembBweSender(kbps, observer, clock); |
92 case kSendSideEstimator: | 93 case kSendSideEstimator: |
93 return new SendSideBweSender(kbps, observer, clock); | 94 return new SendSideBweSender(kbps, observer, clock); |
94 case kNadaEstimator: | 95 case kNadaEstimator: |
95 return new NadaBweSender(kbps, observer, clock); | 96 return new NadaBweSender(kbps, observer, clock); |
| 97 case kBbrEstimator: |
| 98 return new BbrBweSender(); |
96 case kTcpEstimator: | 99 case kTcpEstimator: |
97 FALLTHROUGH(); | 100 FALLTHROUGH(); |
98 case kNullEstimator: | 101 case kNullEstimator: |
99 return new NullBweSender(); | 102 return new NullBweSender(); |
100 } | 103 } |
101 assert(false); | 104 assert(false); |
102 return NULL; | 105 return NULL; |
103 } | 106 } |
104 | 107 |
105 BweReceiver* CreateBweReceiver(BandwidthEstimatorType type, | 108 BweReceiver* CreateBweReceiver(BandwidthEstimatorType type, |
106 int flow_id, | 109 int flow_id, |
107 bool plot) { | 110 bool plot) { |
108 switch (type) { | 111 switch (type) { |
109 case kRembEstimator: | 112 case kRembEstimator: |
110 return new RembReceiver(flow_id, plot); | 113 return new RembReceiver(flow_id, plot); |
111 case kSendSideEstimator: | 114 case kSendSideEstimator: |
112 return new SendSideBweReceiver(flow_id); | 115 return new SendSideBweReceiver(flow_id); |
113 case kNadaEstimator: | 116 case kNadaEstimator: |
114 return new NadaBweReceiver(flow_id); | 117 return new NadaBweReceiver(flow_id); |
| 118 case kBbrEstimator: |
| 119 return new BbrBweReceiver(flow_id); |
115 case kTcpEstimator: | 120 case kTcpEstimator: |
116 return new TcpBweReceiver(flow_id); | 121 return new TcpBweReceiver(flow_id); |
117 case kNullEstimator: | 122 case kNullEstimator: |
118 return new BweReceiver(flow_id); | 123 return new BweReceiver(flow_id); |
119 } | 124 } |
120 assert(false); | 125 assert(false); |
121 return NULL; | 126 return NULL; |
122 } | 127 } |
123 | 128 |
124 // Take into account all LinkedSet content. | 129 // Take into account all LinkedSet content. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 276 |
272 float LossAccount::LossRatio() { | 277 float LossAccount::LossRatio() { |
273 if (num_total == 0) | 278 if (num_total == 0) |
274 return 0.0f; | 279 return 0.0f; |
275 return static_cast<float>(num_lost) / num_total; | 280 return static_cast<float>(num_lost) / num_total; |
276 } | 281 } |
277 | 282 |
278 } // namespace bwe | 283 } // namespace bwe |
279 } // namespace testing | 284 } // namespace testing |
280 } // namespace webrtc | 285 } // namespace webrtc |
OLD | NEW |