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 #include "webrtc/modules/congestion_controller/delay_based_bwe_unittest_helper.h
" | 10 #include "webrtc/modules/congestion_controller/delay_based_bwe_unittest_helper.h
" |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 bitrate_sum += bitrate; | 401 bitrate_sum += bitrate; |
402 } | 402 } |
403 ASSERT_EQ(bitrate_sum, kStartBitrate); | 403 ASSERT_EQ(bitrate_sum, kStartBitrate); |
404 } | 404 } |
405 | 405 |
406 // Run in steady state to make the estimator converge. | 406 // Run in steady state to make the estimator converge. |
407 stream_generator_->set_capacity_bps(kInitialCapacityBps); | 407 stream_generator_->set_capacity_bps(kInitialCapacityBps); |
408 uint32_t bitrate_bps = SteadyStateRun( | 408 uint32_t bitrate_bps = SteadyStateRun( |
409 kDefaultSsrc, steady_state_time * kFramerate, kStartBitrate, | 409 kDefaultSsrc, steady_state_time * kFramerate, kStartBitrate, |
410 kMinExpectedBitrate, kMaxExpectedBitrate, kInitialCapacityBps); | 410 kMinExpectedBitrate, kMaxExpectedBitrate, kInitialCapacityBps); |
411 EXPECT_NEAR(kInitialCapacityBps, bitrate_bps, 130000u); | 411 EXPECT_NEAR(kInitialCapacityBps, bitrate_bps, 150000u); |
412 bitrate_observer_.Reset(); | 412 bitrate_observer_.Reset(); |
413 | 413 |
414 // Add an offset to make sure the BWE can handle it. | 414 // Add an offset to make sure the BWE can handle it. |
415 arrival_time_offset_ms_ += receiver_clock_offset_change_ms; | 415 arrival_time_offset_ms_ += receiver_clock_offset_change_ms; |
416 | 416 |
417 // Reduce the capacity and verify the decrease time. | 417 // Reduce the capacity and verify the decrease time. |
418 stream_generator_->set_capacity_bps(kReducedCapacityBps); | 418 stream_generator_->set_capacity_bps(kReducedCapacityBps); |
419 int64_t overuse_start_time = clock_.TimeInMilliseconds(); | 419 int64_t overuse_start_time = clock_.TimeInMilliseconds(); |
420 int64_t bitrate_drop_time = -1; | 420 int64_t bitrate_drop_time = -1; |
421 for (int i = 0; i < 100 * number_of_streams; ++i) { | 421 for (int i = 0; i < 100 * number_of_streams; ++i) { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 IncomingFeedback(clock_.TimeInMilliseconds(), send_time_ms, | 493 IncomingFeedback(clock_.TimeInMilliseconds(), send_time_ms, |
494 sequence_number++, 1000); | 494 sequence_number++, 1000); |
495 clock_.AdvanceTimeMilliseconds(2 * kFrameIntervalMs); | 495 clock_.AdvanceTimeMilliseconds(2 * kFrameIntervalMs); |
496 send_time_ms += kFrameIntervalMs; | 496 send_time_ms += kFrameIntervalMs; |
497 } | 497 } |
498 uint32_t bitrate_after = 0; | 498 uint32_t bitrate_after = 0; |
499 bitrate_estimator_->LatestEstimate(&ssrcs, &bitrate_after); | 499 bitrate_estimator_->LatestEstimate(&ssrcs, &bitrate_after); |
500 EXPECT_LT(bitrate_after, bitrate_before); | 500 EXPECT_LT(bitrate_after, bitrate_before); |
501 } | 501 } |
502 } // namespace webrtc | 502 } // namespace webrtc |
OLD | NEW |