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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 packet.arrival_time_ms = prev_arrival_time_us_ / 1000; | 143 packet.arrival_time_ms = prev_arrival_time_us_ / 1000; |
144 ++i; | 144 ++i; |
145 } | 145 } |
146 it = std::min_element(streams_.begin(), streams_.end(), RtpStream::Compare); | 146 it = std::min_element(streams_.begin(), streams_.end(), RtpStream::Compare); |
147 return std::max((*it)->next_rtp_time(), time_now_us); | 147 return std::max((*it)->next_rtp_time(), time_now_us); |
148 } | 148 } |
149 } // namespace test | 149 } // namespace test |
150 | 150 |
151 DelayBasedBweTest::DelayBasedBweTest() | 151 DelayBasedBweTest::DelayBasedBweTest() |
152 : clock_(100000000), | 152 : clock_(100000000), |
153 bitrate_estimator_(new DelayBasedBwe(&clock_)), | 153 bitrate_estimator_(new DelayBasedBwe(nullptr, &clock_)), |
154 stream_generator_(new test::StreamGenerator(1e6, // Capacity. | 154 stream_generator_(new test::StreamGenerator(1e6, // Capacity. |
155 clock_.TimeInMicroseconds())), | 155 clock_.TimeInMicroseconds())), |
156 arrival_time_offset_ms_(0), | 156 arrival_time_offset_ms_(0), |
157 first_update_(true) {} | 157 first_update_(true) {} |
158 | 158 |
159 DelayBasedBweTest::~DelayBasedBweTest() {} | 159 DelayBasedBweTest::~DelayBasedBweTest() {} |
160 | 160 |
161 void DelayBasedBweTest::AddDefaultStream() { | 161 void DelayBasedBweTest::AddDefaultStream() { |
162 stream_generator_->AddStream(new test::RtpStream(30, 3e5)); | 162 stream_generator_->AddStream(new test::RtpStream(30, 3e5)); |
163 } | 163 } |
(...skipping 329 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 |