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 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 return static_cast<int64_t>(timestamp) * kTimestampToMs; | 83 return static_cast<int64_t>(timestamp) * kTimestampToMs; |
84 } | 84 } |
85 | 85 |
86 BweSender* CreateBweSender(BandwidthEstimatorType estimator, | 86 BweSender* CreateBweSender(BandwidthEstimatorType estimator, |
87 int kbps, | 87 int kbps, |
88 BitrateObserver* observer, | 88 BitrateObserver* observer, |
89 Clock* clock) { | 89 Clock* clock) { |
90 switch (estimator) { | 90 switch (estimator) { |
91 case kRembEstimator: | 91 case kRembEstimator: |
92 return new RembBweSender(kbps, observer, clock); | 92 return new RembBweSender(kbps, observer, clock); |
93 case kFullSendSideEstimator: | 93 case kSendSideEstimator: |
94 return new FullBweSender(kbps, observer, clock); | 94 return new SendSideBweSender(kbps, observer, clock); |
95 case kNadaEstimator: | 95 case kNadaEstimator: |
96 return new NadaBweSender(kbps, observer, clock); | 96 return new NadaBweSender(kbps, observer, clock); |
97 case kTcpEstimator: | 97 case kTcpEstimator: |
98 FALLTHROUGH(); | 98 FALLTHROUGH(); |
99 case kNullEstimator: | 99 case kNullEstimator: |
100 return new NullBweSender(); | 100 return new NullBweSender(); |
101 } | 101 } |
102 assert(false); | 102 assert(false); |
103 return NULL; | 103 return NULL; |
104 } | 104 } |
105 | 105 |
106 BweReceiver* CreateBweReceiver(BandwidthEstimatorType type, | 106 BweReceiver* CreateBweReceiver(BandwidthEstimatorType type, |
107 int flow_id, | 107 int flow_id, |
108 bool plot) { | 108 bool plot) { |
109 switch (type) { | 109 switch (type) { |
110 case kRembEstimator: | 110 case kRembEstimator: |
111 return new RembReceiver(flow_id, plot); | 111 return new RembReceiver(flow_id, plot); |
112 case kFullSendSideEstimator: | 112 case kSendSideEstimator: |
113 return new SendSideBweReceiver(flow_id); | 113 return new SendSideBweReceiver(flow_id); |
114 case kNadaEstimator: | 114 case kNadaEstimator: |
115 return new NadaBweReceiver(flow_id); | 115 return new NadaBweReceiver(flow_id); |
116 case kTcpEstimator: | 116 case kTcpEstimator: |
117 return new TcpBweReceiver(flow_id); | 117 return new TcpBweReceiver(flow_id); |
118 case kNullEstimator: | 118 case kNullEstimator: |
119 return new BweReceiver(flow_id); | 119 return new BweReceiver(flow_id); |
120 } | 120 } |
121 assert(false); | 121 assert(false); |
122 return NULL; | 122 return NULL; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 float LossAccount::LossRatio() { | 273 float LossAccount::LossRatio() { |
274 if (num_total == 0) | 274 if (num_total == 0) |
275 return 0.0f; | 275 return 0.0f; |
276 return static_cast<float>(num_lost) / num_total; | 276 return static_cast<float>(num_lost) / num_total; |
277 } | 277 } |
278 | 278 |
279 } // namespace bwe | 279 } // namespace bwe |
280 } // namespace testing | 280 } // namespace testing |
281 } // namespace webrtc | 281 } // namespace webrtc |
OLD | NEW |