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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 void DelayBasedBweTest::IncomingFeedback(int64_t arrival_time_ms, | 177 void DelayBasedBweTest::IncomingFeedback(int64_t arrival_time_ms, |
178 int64_t send_time_ms, | 178 int64_t send_time_ms, |
179 uint16_t sequence_number, | 179 uint16_t sequence_number, |
180 size_t payload_size, | 180 size_t payload_size, |
181 const PacedPacketInfo& pacing_info) { | 181 const PacedPacketInfo& pacing_info) { |
182 RTC_CHECK_GE(arrival_time_ms + arrival_time_offset_ms_, 0); | 182 RTC_CHECK_GE(arrival_time_ms + arrival_time_offset_ms_, 0); |
183 PacketFeedback packet(arrival_time_ms + arrival_time_offset_ms_, send_time_ms, | 183 PacketFeedback packet(arrival_time_ms + arrival_time_offset_ms_, send_time_ms, |
184 sequence_number, payload_size, pacing_info); | 184 sequence_number, payload_size, pacing_info); |
185 std::vector<PacketFeedback> packets; | 185 std::vector<PacketFeedback> packets; |
186 packets.push_back(packet); | 186 packets.push_back(packet); |
187 acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector(packets); | 187 acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector(packets, false); |
188 DelayBasedBwe::Result result = | 188 DelayBasedBwe::Result result = |
189 bitrate_estimator_->IncomingPacketFeedbackVector( | 189 bitrate_estimator_->IncomingPacketFeedbackVector( |
190 packets, acknowledged_bitrate_estimator_->bitrate_bps()); | 190 packets, acknowledged_bitrate_estimator_->bitrate_bps()); |
191 const uint32_t kDummySsrc = 0; | 191 const uint32_t kDummySsrc = 0; |
192 if (result.updated) { | 192 if (result.updated) { |
193 bitrate_observer_.OnReceiveBitrateChanged({kDummySsrc}, | 193 bitrate_observer_.OnReceiveBitrateChanged({kDummySsrc}, |
194 result.target_bitrate_bps); | 194 result.target_bitrate_bps); |
195 } | 195 } |
196 } | 196 } |
197 | 197 |
(...skipping 14 matching lines...) Expand all Loading... |
212 | 212 |
213 bool overuse = false; | 213 bool overuse = false; |
214 bitrate_observer_.Reset(); | 214 bitrate_observer_.Reset(); |
215 clock_.AdvanceTimeMicroseconds(1000 * packets.back().arrival_time_ms - | 215 clock_.AdvanceTimeMicroseconds(1000 * packets.back().arrival_time_ms - |
216 clock_.TimeInMicroseconds()); | 216 clock_.TimeInMicroseconds()); |
217 for (auto& packet : packets) { | 217 for (auto& packet : packets) { |
218 RTC_CHECK_GE(packet.arrival_time_ms + arrival_time_offset_ms_, 0); | 218 RTC_CHECK_GE(packet.arrival_time_ms + arrival_time_offset_ms_, 0); |
219 packet.arrival_time_ms += arrival_time_offset_ms_; | 219 packet.arrival_time_ms += arrival_time_offset_ms_; |
220 } | 220 } |
221 | 221 |
222 acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector(packets); | 222 acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector(packets, false); |
223 DelayBasedBwe::Result result = | 223 DelayBasedBwe::Result result = |
224 bitrate_estimator_->IncomingPacketFeedbackVector( | 224 bitrate_estimator_->IncomingPacketFeedbackVector( |
225 packets, acknowledged_bitrate_estimator_->bitrate_bps()); | 225 packets, acknowledged_bitrate_estimator_->bitrate_bps()); |
226 const uint32_t kDummySsrc = 0; | 226 const uint32_t kDummySsrc = 0; |
227 if (result.updated) { | 227 if (result.updated) { |
228 bitrate_observer_.OnReceiveBitrateChanged({kDummySsrc}, | 228 bitrate_observer_.OnReceiveBitrateChanged({kDummySsrc}, |
229 result.target_bitrate_bps); | 229 result.target_bitrate_bps); |
230 if (!first_update_ && result.target_bitrate_bps < bitrate_bps) | 230 if (!first_update_ && result.target_bitrate_bps < bitrate_bps) |
231 overuse = true; | 231 overuse = true; |
232 first_update_ = false; | 232 first_update_ = false; |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 IncomingFeedback(clock_.TimeInMilliseconds(), send_time_ms, | 504 IncomingFeedback(clock_.TimeInMilliseconds(), send_time_ms, |
505 sequence_number++, 1000); | 505 sequence_number++, 1000); |
506 clock_.AdvanceTimeMilliseconds(2 * kFrameIntervalMs); | 506 clock_.AdvanceTimeMilliseconds(2 * kFrameIntervalMs); |
507 send_time_ms += kFrameIntervalMs; | 507 send_time_ms += kFrameIntervalMs; |
508 } | 508 } |
509 uint32_t bitrate_after = 0; | 509 uint32_t bitrate_after = 0; |
510 bitrate_estimator_->LatestEstimate(&ssrcs, &bitrate_after); | 510 bitrate_estimator_->LatestEstimate(&ssrcs, &bitrate_after); |
511 EXPECT_LT(bitrate_after, bitrate_before); | 511 EXPECT_LT(bitrate_after, bitrate_before); |
512 } | 512 } |
513 } // namespace webrtc | 513 } // namespace webrtc |
OLD | NEW |