OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 RateCounterFilter counter(&uplink_, kFlowIds[0], "receiver_input_0"); | 79 RateCounterFilter counter(&uplink_, kFlowIds[0], "receiver_input_0"); |
80 PacketReceiver receiver(&uplink_, kFlowIds[0], GetParam(), true, false); | 80 PacketReceiver receiver(&uplink_, kFlowIds[0], GetParam(), true, false); |
81 | 81 |
82 AdaptiveVideoSource source2(kFlowIds[1], 30, 300, 0, 0); | 82 AdaptiveVideoSource source2(kFlowIds[1], 30, 300, 0, 0); |
83 VideoSender sender2(&downlink_, &source2, GetParam()); | 83 VideoSender sender2(&downlink_, &source2, GetParam()); |
84 ChokeFilter choke2(&downlink_, kFlowIds[1]); | 84 ChokeFilter choke2(&downlink_, kFlowIds[1]); |
85 DelayFilter delay(&downlink_, CreateFlowIds(kFlowIds, kNumFlows)); | 85 DelayFilter delay(&downlink_, CreateFlowIds(kFlowIds, kNumFlows)); |
86 RateCounterFilter counter2(&downlink_, kFlowIds[1], "receiver_input_1"); | 86 RateCounterFilter counter2(&downlink_, kFlowIds[1], "receiver_input_1"); |
87 PacketReceiver receiver2(&downlink_, kFlowIds[1], GetParam(), true, false); | 87 PacketReceiver receiver2(&downlink_, kFlowIds[1], GetParam(), true, false); |
88 | 88 |
89 choke2.SetCapacity(500); | 89 choke2.set_capacity_kbps(500); |
90 delay.SetDelayMs(0); | 90 delay.SetOneWayDelayMs(0); |
91 | 91 |
92 choke.SetCapacity(1000); | 92 choke.set_capacity_kbps(1000); |
93 choke.SetMaxDelay(500); | 93 choke.set_max_delay_ms(500); |
94 RunFor(60 * 1000); | 94 RunFor(60 * 1000); |
95 choke.SetCapacity(500); | 95 choke.set_capacity_kbps(500); |
96 RunFor(60 * 1000); | 96 RunFor(60 * 1000); |
97 choke.SetCapacity(1000); | 97 choke.set_capacity_kbps(1000); |
98 RunFor(60 * 1000); | 98 RunFor(60 * 1000); |
99 } | 99 } |
100 | 100 |
101 TEST_P(BweSimulation, Choke1000kbps500kbps1000kbps) { | 101 TEST_P(BweSimulation, Choke1000kbps500kbps1000kbps) { |
102 | 102 |
103 AdaptiveVideoSource source(0, 30, 300, 0, 0); | 103 AdaptiveVideoSource source(0, 30, 300, 0, 0); |
104 VideoSender sender(&uplink_, &source, GetParam()); | 104 VideoSender sender(&uplink_, &source, GetParam()); |
105 ChokeFilter choke(&uplink_, 0); | 105 ChokeFilter choke(&uplink_, 0); |
106 RateCounterFilter counter(&uplink_, 0, "receiver_input"); | 106 RateCounterFilter counter(&uplink_, 0, "receiver_input"); |
107 PacketReceiver receiver(&uplink_, 0, GetParam(), true, false); | 107 PacketReceiver receiver(&uplink_, 0, GetParam(), true, false); |
108 | 108 |
109 choke.SetCapacity(1000); | 109 choke.set_capacity_kbps(1000); |
110 choke.SetMaxDelay(500); | 110 choke.set_max_delay_ms(500); |
111 RunFor(60 * 1000); | 111 RunFor(60 * 1000); |
112 choke.SetCapacity(500); | 112 choke.set_capacity_kbps(500); |
113 RunFor(60 * 1000); | 113 RunFor(60 * 1000); |
114 choke.SetCapacity(1000); | 114 choke.set_capacity_kbps(1000); |
115 RunFor(60 * 1000); | 115 RunFor(60 * 1000); |
116 } | 116 } |
117 | 117 |
118 TEST_P(BweSimulation, PacerChoke1000kbps500kbps1000kbps) { | 118 TEST_P(BweSimulation, PacerChoke1000kbps500kbps1000kbps) { |
119 AdaptiveVideoSource source(0, 30, 300, 0, 0); | 119 AdaptiveVideoSource source(0, 30, 300, 0, 0); |
120 PacedVideoSender sender(&uplink_, &source, GetParam()); | 120 PacedVideoSender sender(&uplink_, &source, GetParam()); |
121 ChokeFilter filter(&uplink_, 0); | 121 ChokeFilter filter(&uplink_, 0); |
122 RateCounterFilter counter(&uplink_, 0, "receiver_input"); | 122 RateCounterFilter counter(&uplink_, 0, "receiver_input"); |
123 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); | 123 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); |
124 filter.SetCapacity(1000); | 124 filter.set_capacity_kbps(1000); |
125 filter.SetMaxDelay(500); | 125 filter.set_max_delay_ms(500); |
126 RunFor(60 * 1000); | 126 RunFor(60 * 1000); |
127 filter.SetCapacity(500); | 127 filter.set_capacity_kbps(500); |
128 RunFor(60 * 1000); | 128 RunFor(60 * 1000); |
129 filter.SetCapacity(1000); | 129 filter.set_capacity_kbps(1000); |
130 RunFor(60 * 1000); | 130 RunFor(60 * 1000); |
131 } | 131 } |
132 | 132 |
133 TEST_P(BweSimulation, PacerChoke10000kbps) { | 133 TEST_P(BweSimulation, PacerChoke10000kbps) { |
134 PeriodicKeyFrameSource source(0, 30, 300, 0, 0, 1000); | 134 PeriodicKeyFrameSource source(0, 30, 300, 0, 0, 1000); |
135 PacedVideoSender sender(&uplink_, &source, GetParam()); | 135 PacedVideoSender sender(&uplink_, &source, GetParam()); |
136 ChokeFilter filter(&uplink_, 0); | 136 ChokeFilter filter(&uplink_, 0); |
137 RateCounterFilter counter(&uplink_, 0, "receiver_input"); | 137 RateCounterFilter counter(&uplink_, 0, "receiver_input"); |
138 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); | 138 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); |
139 filter.SetCapacity(10000); | 139 filter.set_capacity_kbps(10000); |
140 filter.SetMaxDelay(500); | 140 filter.set_max_delay_ms(500); |
141 RunFor(60 * 1000); | 141 RunFor(60 * 1000); |
142 } | 142 } |
143 | 143 |
144 TEST_P(BweSimulation, PacerChoke200kbps30kbps200kbps) { | 144 TEST_P(BweSimulation, PacerChoke200kbps30kbps200kbps) { |
145 AdaptiveVideoSource source(0, 30, 300, 0, 0); | 145 AdaptiveVideoSource source(0, 30, 300, 0, 0); |
146 PacedVideoSender sender(&uplink_, &source, GetParam()); | 146 PacedVideoSender sender(&uplink_, &source, GetParam()); |
147 ChokeFilter filter(&uplink_, 0); | 147 ChokeFilter filter(&uplink_, 0); |
148 RateCounterFilter counter(&uplink_, 0, "receiver_input"); | 148 RateCounterFilter counter(&uplink_, 0, "receiver_input"); |
149 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); | 149 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); |
150 filter.SetCapacity(200); | 150 filter.set_capacity_kbps(200); |
151 filter.SetMaxDelay(500); | 151 filter.set_max_delay_ms(500); |
152 RunFor(60 * 1000); | 152 RunFor(60 * 1000); |
153 filter.SetCapacity(30); | 153 filter.set_capacity_kbps(30); |
154 RunFor(60 * 1000); | 154 RunFor(60 * 1000); |
155 filter.SetCapacity(200); | 155 filter.set_capacity_kbps(200); |
156 RunFor(60 * 1000); | 156 RunFor(60 * 1000); |
157 } | 157 } |
158 | 158 |
159 TEST_P(BweSimulation, Choke200kbps30kbps200kbps) { | 159 TEST_P(BweSimulation, Choke200kbps30kbps200kbps) { |
160 AdaptiveVideoSource source(0, 30, 300, 0, 0); | 160 AdaptiveVideoSource source(0, 30, 300, 0, 0); |
161 VideoSender sender(&uplink_, &source, GetParam()); | 161 VideoSender sender(&uplink_, &source, GetParam()); |
162 ChokeFilter filter(&uplink_, 0); | 162 ChokeFilter filter(&uplink_, 0); |
163 RateCounterFilter counter(&uplink_, 0, "receiver_input"); | 163 RateCounterFilter counter(&uplink_, 0, "receiver_input"); |
164 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); | 164 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); |
165 filter.SetCapacity(200); | 165 filter.set_capacity_kbps(200); |
166 filter.SetMaxDelay(500); | 166 filter.set_max_delay_ms(500); |
167 RunFor(60 * 1000); | 167 RunFor(60 * 1000); |
168 filter.SetCapacity(30); | 168 filter.set_capacity_kbps(30); |
169 RunFor(60 * 1000); | 169 RunFor(60 * 1000); |
170 filter.SetCapacity(200); | 170 filter.set_capacity_kbps(200); |
171 RunFor(60 * 1000); | 171 RunFor(60 * 1000); |
172 } | 172 } |
173 | 173 |
174 TEST_P(BweSimulation, GoogleWifiTrace3Mbps) { | 174 TEST_P(BweSimulation, GoogleWifiTrace3Mbps) { |
175 AdaptiveVideoSource source(0, 30, 300, 0, 0); | 175 AdaptiveVideoSource source(0, 30, 300, 0, 0); |
176 VideoSender sender(&uplink_, &source, GetParam()); | 176 VideoSender sender(&uplink_, &source, GetParam()); |
177 RateCounterFilter counter1(&uplink_, 0, "sender_output"); | 177 RateCounterFilter counter1(&uplink_, 0, "sender_output"); |
178 TraceBasedDeliveryFilter filter(&uplink_, 0, "link_capacity"); | 178 TraceBasedDeliveryFilter filter(&uplink_, 0, "link_capacity"); |
179 filter.SetMaxDelay(500); | 179 filter.set_max_delay_ms(500); |
180 RateCounterFilter counter2(&uplink_, 0, "receiver_input"); | 180 RateCounterFilter counter2(&uplink_, 0, "receiver_input"); |
181 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); | 181 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); |
182 ASSERT_TRUE(filter.Init(test::ResourcePath("google-wifi-3mbps", "rx"))); | 182 ASSERT_TRUE(filter.Init(test::ResourcePath("google-wifi-3mbps", "rx"))); |
183 RunFor(300 * 1000); | 183 RunFor(300 * 1000); |
184 } | 184 } |
185 | 185 |
186 TEST_P(BweSimulation, LinearIncreasingCapacity) { | 186 TEST_P(BweSimulation, LinearIncreasingCapacity) { |
187 PeriodicKeyFrameSource source(0, 30, 300, 0, 0, 1000000); | 187 PeriodicKeyFrameSource source(0, 30, 300, 0, 0, 1000000); |
188 PacedVideoSender sender(&uplink_, &source, GetParam()); | 188 PacedVideoSender sender(&uplink_, &source, GetParam()); |
189 ChokeFilter filter(&uplink_, 0); | 189 ChokeFilter filter(&uplink_, 0); |
190 RateCounterFilter counter(&uplink_, 0, "receiver_input"); | 190 RateCounterFilter counter(&uplink_, 0, "receiver_input"); |
191 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); | 191 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); |
192 filter.SetMaxDelay(500); | 192 filter.set_max_delay_ms(500); |
193 const int kStartingCapacityKbps = 150; | 193 const int kStartingCapacityKbps = 150; |
194 const int kEndingCapacityKbps = 1500; | 194 const int kEndingCapacityKbps = 1500; |
195 const int kStepKbps = 5; | 195 const int kStepKbps = 5; |
196 const int kStepTimeMs = 1000; | 196 const int kStepTimeMs = 1000; |
197 | 197 |
198 for (int i = kStartingCapacityKbps; i <= kEndingCapacityKbps; | 198 for (int i = kStartingCapacityKbps; i <= kEndingCapacityKbps; |
199 i += kStepKbps) { | 199 i += kStepKbps) { |
200 filter.SetCapacity(i); | 200 filter.set_capacity_kbps(i); |
201 RunFor(kStepTimeMs); | 201 RunFor(kStepTimeMs); |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 TEST_P(BweSimulation, LinearDecreasingCapacity) { | 205 TEST_P(BweSimulation, LinearDecreasingCapacity) { |
206 PeriodicKeyFrameSource source(0, 30, 300, 0, 0, 1000000); | 206 PeriodicKeyFrameSource source(0, 30, 300, 0, 0, 1000000); |
207 PacedVideoSender sender(&uplink_, &source, GetParam()); | 207 PacedVideoSender sender(&uplink_, &source, GetParam()); |
208 ChokeFilter filter(&uplink_, 0); | 208 ChokeFilter filter(&uplink_, 0); |
209 RateCounterFilter counter(&uplink_, 0, "receiver_input"); | 209 RateCounterFilter counter(&uplink_, 0, "receiver_input"); |
210 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); | 210 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); |
211 filter.SetMaxDelay(500); | 211 filter.set_max_delay_ms(500); |
212 const int kStartingCapacityKbps = 1500; | 212 const int kStartingCapacityKbps = 1500; |
213 const int kEndingCapacityKbps = 150; | 213 const int kEndingCapacityKbps = 150; |
214 const int kStepKbps = -5; | 214 const int kStepKbps = -5; |
215 const int kStepTimeMs = 1000; | 215 const int kStepTimeMs = 1000; |
216 | 216 |
217 for (int i = kStartingCapacityKbps; i >= kEndingCapacityKbps; | 217 for (int i = kStartingCapacityKbps; i >= kEndingCapacityKbps; |
218 i += kStepKbps) { | 218 i += kStepKbps) { |
219 filter.SetCapacity(i); | 219 filter.set_capacity_kbps(i); |
220 RunFor(kStepTimeMs); | 220 RunFor(kStepTimeMs); |
221 } | 221 } |
222 } | 222 } |
223 | 223 |
224 TEST_P(BweSimulation, PacerGoogleWifiTrace3Mbps) { | 224 TEST_P(BweSimulation, PacerGoogleWifiTrace3Mbps) { |
225 PeriodicKeyFrameSource source(0, 30, 300, 0, 0, 1000); | 225 PeriodicKeyFrameSource source(0, 30, 300, 0, 0, 1000); |
226 PacedVideoSender sender(&uplink_, &source, GetParam()); | 226 PacedVideoSender sender(&uplink_, &source, GetParam()); |
227 RateCounterFilter counter1(&uplink_, 0, "sender_output"); | 227 RateCounterFilter counter1(&uplink_, 0, "sender_output"); |
228 TraceBasedDeliveryFilter filter(&uplink_, 0, "link_capacity"); | 228 TraceBasedDeliveryFilter filter(&uplink_, 0, "link_capacity"); |
229 filter.SetMaxDelay(500); | 229 filter.set_max_delay_ms(500); |
230 RateCounterFilter counter2(&uplink_, 0, "receiver_input"); | 230 RateCounterFilter counter2(&uplink_, 0, "receiver_input"); |
231 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); | 231 PacketReceiver receiver(&uplink_, 0, GetParam(), true, true); |
232 ASSERT_TRUE(filter.Init(test::ResourcePath("google-wifi-3mbps", "rx"))); | 232 ASSERT_TRUE(filter.Init(test::ResourcePath("google-wifi-3mbps", "rx"))); |
233 RunFor(300 * 1000); | 233 RunFor(300 * 1000); |
234 } | 234 } |
235 | 235 |
236 TEST_P(BweSimulation, SelfFairnessTest) { | 236 TEST_P(BweSimulation, SelfFairnessTest) { |
237 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); | 237 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); |
238 const int kAllFlowIds[] = {0, 1, 2, 3}; | 238 const int kAllFlowIds[] = {0, 1, 2, 3}; |
239 const size_t kNumFlows = sizeof(kAllFlowIds) / sizeof(kAllFlowIds[0]); | 239 const size_t kNumFlows = sizeof(kAllFlowIds) / sizeof(kAllFlowIds[0]); |
240 rtc::scoped_ptr<VideoSource> sources[kNumFlows]; | 240 rtc::scoped_ptr<VideoSource> sources[kNumFlows]; |
241 rtc::scoped_ptr<VideoSender> senders[kNumFlows]; | 241 rtc::scoped_ptr<VideoSender> senders[kNumFlows]; |
242 for (size_t i = 0; i < kNumFlows; ++i) { | 242 for (size_t i = 0; i < kNumFlows; ++i) { |
243 // Streams started 20 seconds apart to give them different advantage when | 243 // Streams started 20 seconds apart to give them different advantage when |
244 // competing for the bandwidth. | 244 // competing for the bandwidth. |
245 sources[i].reset(new AdaptiveVideoSource(kAllFlowIds[i], 30, 300, 0, | 245 sources[i].reset(new AdaptiveVideoSource(kAllFlowIds[i], 30, 300, 0, |
246 i * (rand() % 40000))); | 246 i * (rand() % 40000))); |
247 senders[i].reset(new VideoSender(&uplink_, sources[i].get(), GetParam())); | 247 senders[i].reset(new VideoSender(&uplink_, sources[i].get(), GetParam())); |
248 } | 248 } |
249 | 249 |
250 ChokeFilter choke(&uplink_, CreateFlowIds(kAllFlowIds, kNumFlows)); | 250 ChokeFilter choke(&uplink_, CreateFlowIds(kAllFlowIds, kNumFlows)); |
251 choke.SetCapacity(1000); | 251 choke.set_capacity_kbps(1000); |
252 | 252 |
253 rtc::scoped_ptr<RateCounterFilter> rate_counters[kNumFlows]; | 253 rtc::scoped_ptr<RateCounterFilter> rate_counters[kNumFlows]; |
254 for (size_t i = 0; i < kNumFlows; ++i) { | 254 for (size_t i = 0; i < kNumFlows; ++i) { |
255 rate_counters[i].reset(new RateCounterFilter( | 255 rate_counters[i].reset(new RateCounterFilter( |
256 &uplink_, CreateFlowIds(&kAllFlowIds[i], 1), "receiver_input")); | 256 &uplink_, CreateFlowIds(&kAllFlowIds[i], 1), "receiver_input")); |
257 } | 257 } |
258 | 258 |
259 RateCounterFilter total_utilization( | 259 RateCounterFilter total_utilization( |
260 &uplink_, CreateFlowIds(kAllFlowIds, kNumFlows), "total_utilization"); | 260 &uplink_, CreateFlowIds(kAllFlowIds, kNumFlows), "total_utilization"); |
261 | 261 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 295 |
296 TEST_P(BweSimulation, TcpFairness1000msTest) { | 296 TEST_P(BweSimulation, TcpFairness1000msTest) { |
297 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); | 297 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); |
298 RunFairnessTest(GetParam(), 1, 1, 1000, 2000, 1000); | 298 RunFairnessTest(GetParam(), 1, 1, 1000, 2000, 1000); |
299 } | 299 } |
300 | 300 |
301 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE | 301 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE |
302 } // namespace bwe | 302 } // namespace bwe |
303 } // namespace testing | 303 } // namespace testing |
304 } // namespace webrtc | 304 } // namespace webrtc |
OLD | NEW |