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 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // prescribing on which iterations it must change (like a mock would). | 72 // prescribing on which iterations it must change (like a mock would). |
73 void TargetBitrateTrackingSetup() { | 73 void TargetBitrateTrackingSetup() { |
74 std::unique_ptr<PacedSender> pacer(new NiceMock<MockPacedSender>()); | 74 std::unique_ptr<PacedSender> pacer(new NiceMock<MockPacedSender>()); |
75 controller_.reset(new CongestionController( | 75 controller_.reset(new CongestionController( |
76 &clock_, &target_bitrate_observer_, &remote_bitrate_observer_, | 76 &clock_, &target_bitrate_observer_, &remote_bitrate_observer_, |
77 &event_log_, &packet_router_, std::move(pacer))); | 77 &event_log_, &packet_router_, std::move(pacer))); |
78 controller_->SetBweBitrates(0, kInitialBitrateBps, 5 * kInitialBitrateBps); | 78 controller_->SetBweBitrates(0, kInitialBitrateBps, 5 * kInitialBitrateBps); |
79 } | 79 } |
80 | 80 |
81 void OnSentPacket(const PacketFeedback& packet_feedback) { | 81 void OnSentPacket(const PacketFeedback& packet_feedback) { |
82 controller_->AddPacket(packet_feedback.sequence_number, | 82 constexpr uint32_t ssrc = 0; |
| 83 controller_->AddPacket(ssrc, packet_feedback.sequence_number, |
83 packet_feedback.payload_size, | 84 packet_feedback.payload_size, |
84 packet_feedback.pacing_info); | 85 packet_feedback.pacing_info); |
85 controller_->OnSentPacket(rtc::SentPacket(packet_feedback.sequence_number, | 86 controller_->OnSentPacket(rtc::SentPacket(packet_feedback.sequence_number, |
86 packet_feedback.send_time_ms)); | 87 packet_feedback.send_time_ms)); |
87 } | 88 } |
88 | 89 |
89 // Allows us to track the target bitrate, without prescribing the exact | 90 // Allows us to track the target bitrate, without prescribing the exact |
90 // iterations when this would hapen, like a mock would. | 91 // iterations when this would hapen, like a mock would. |
91 class TargetBitrateObserver : public CongestionController::Observer { | 92 class TargetBitrateObserver : public CongestionController::Observer { |
92 public: | 93 public: |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 ASSERT_TRUE(target_bitrate_bps_); | 480 ASSERT_TRUE(target_bitrate_bps_); |
480 | 481 |
481 // Repeat, but this time with a building delay, and make sure that the | 482 // Repeat, but this time with a building delay, and make sure that the |
482 // estimation is adjusted downwards. | 483 // estimation is adjusted downwards. |
483 uint32_t bitrate_before_delay = *target_bitrate_bps_; | 484 uint32_t bitrate_before_delay = *target_bitrate_bps_; |
484 PacketTransmissionAndFeedbackBlock(&seq_num, kRunTimeMs, 50); | 485 PacketTransmissionAndFeedbackBlock(&seq_num, kRunTimeMs, 50); |
485 EXPECT_LT(*target_bitrate_bps_, bitrate_before_delay); | 486 EXPECT_LT(*target_bitrate_bps_, bitrate_before_delay); |
486 } | 487 } |
487 } // namespace test | 488 } // namespace test |
488 } // namespace webrtc | 489 } // namespace webrtc |
OLD | NEW |