Verify that transport-cc is used when RFC8888 field trial is off.
This is preparatory to ensuring that transport-cc gets turned off when RFC8888 ccfb is negotiated. Bug: webrtc:378698658 Change-Id: Ie76677bd6aa046701562bbd93d8489858488f863 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368543 Reviewed-by: Per Kjellander <perkj@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43426}
This commit is contained in:
parent
2d47c9395b
commit
fb62f90706
@ -280,6 +280,7 @@ class Call final : public webrtc::Call,
|
||||
|
||||
void EnableSendCongestionControlFeedbackAccordingToRfc8888() override;
|
||||
int FeedbackAccordingToRfc8888Count() override;
|
||||
int FeedbackAccordingToTransportCcCount() override;
|
||||
|
||||
const FieldTrialsView& trials() const override;
|
||||
|
||||
@ -1200,6 +1201,10 @@ int Call::FeedbackAccordingToRfc8888Count() {
|
||||
return transport_send_->ReceivedCongestionControlFeedbackCount();
|
||||
}
|
||||
|
||||
int Call::FeedbackAccordingToTransportCcCount() {
|
||||
return transport_send_->ReceivedTransportCcFeedbackCount();
|
||||
}
|
||||
|
||||
const FieldTrialsView& Call::trials() const {
|
||||
return env_.field_trials();
|
||||
}
|
||||
|
||||
@ -155,6 +155,7 @@ class Call {
|
||||
|
||||
virtual void EnableSendCongestionControlFeedbackAccordingToRfc8888() = 0;
|
||||
virtual int FeedbackAccordingToRfc8888Count() = 0;
|
||||
virtual int FeedbackAccordingToTransportCcCount() = 0;
|
||||
|
||||
virtual const FieldTrialsView& trials() const = 0;
|
||||
|
||||
|
||||
@ -639,6 +639,7 @@ void RtpTransportControllerSend::OnTransportFeedback(
|
||||
Timestamp receive_time,
|
||||
const rtcp::TransportFeedback& feedback) {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
++transport_cc_feedback_count_;
|
||||
feedback_demuxer_.OnTransportFeedback(feedback);
|
||||
std::optional<TransportPacketsFeedback> feedback_msg =
|
||||
transport_feedback_adapter_.ProcessTransportFeedback(feedback,
|
||||
|
||||
@ -146,6 +146,10 @@ class RtpTransportControllerSend final
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
return feedback_count_;
|
||||
}
|
||||
int ReceivedTransportCcFeedbackCount() const override {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
return transport_cc_feedback_count_;
|
||||
}
|
||||
|
||||
private:
|
||||
void MaybeCreateControllers() RTC_RUN_ON(sequence_checker_);
|
||||
@ -235,6 +239,7 @@ class RtpTransportControllerSend final
|
||||
bool is_congested_ RTC_GUARDED_BY(sequence_checker_);
|
||||
// Count of feedback messages received.
|
||||
int feedback_count_ RTC_GUARDED_BY(sequence_checker_) = 0;
|
||||
int transport_cc_feedback_count_ RTC_GUARDED_BY(sequence_checker_) = 0;
|
||||
|
||||
// Protected by internal locks.
|
||||
RateLimiter retransmission_rate_limiter_;
|
||||
|
||||
@ -163,6 +163,8 @@ class RtpTransportControllerSendInterface {
|
||||
virtual NetworkControllerInterface* GetNetworkController() = 0;
|
||||
// Count of RFC8888 feedback reports received
|
||||
virtual int ReceivedCongestionControlFeedbackCount() const = 0;
|
||||
// Count of transport-cc feedback reports received
|
||||
virtual int ReceivedTransportCcFeedbackCount() const = 0;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -119,6 +119,7 @@ class MockRtpTransportControllerSend
|
||||
ReceivedCongestionControlFeedbackCount,
|
||||
(),
|
||||
(const, override));
|
||||
MOCK_METHOD(int, ReceivedTransportCcFeedbackCount, (), (const, override));
|
||||
};
|
||||
} // namespace webrtc
|
||||
#endif // CALL_TEST_MOCK_RTP_TRANSPORT_CONTROLLER_SEND_H_
|
||||
|
||||
@ -471,6 +471,7 @@ class FakeCall final : public webrtc::Call, public webrtc::PacketReceiver {
|
||||
}
|
||||
void EnableSendCongestionControlFeedbackAccordingToRfc8888() override {}
|
||||
int FeedbackAccordingToRfc8888Count() { return 0; }
|
||||
int FeedbackAccordingToTransportCcCount() { return 0; }
|
||||
|
||||
private:
|
||||
webrtc::AudioSendStream* CreateAudioSendStream(
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
using testing::Eq;
|
||||
using testing::HasSubstr;
|
||||
|
||||
class PeerConnectionCongestionControlTest
|
||||
@ -83,4 +84,24 @@ TEST_F(PeerConnectionCongestionControlTest, CcfbGetsUsed) {
|
||||
kDefaultTimeout);
|
||||
}
|
||||
|
||||
TEST_F(PeerConnectionCongestionControlTest, TransportCcGetsUsed) {
|
||||
test::ScopedFieldTrials trials(
|
||||
"WebRTC-RFC8888CongestionControlFeedback/Disabled/");
|
||||
ASSERT_TRUE(CreatePeerConnectionWrappers());
|
||||
ConnectFakeSignaling();
|
||||
caller()->AddAudioVideoTracks();
|
||||
caller()->CreateAndSetAndSignalOffer();
|
||||
ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
|
||||
MediaExpectations media_expectations;
|
||||
media_expectations.CalleeExpectsSomeAudio();
|
||||
media_expectations.CalleeExpectsSomeVideo();
|
||||
ASSERT_TRUE(ExpectNewFrames(media_expectations));
|
||||
auto pc_internal = caller()->pc_internal();
|
||||
EXPECT_TRUE_WAIT(
|
||||
pc_internal->FeedbackAccordingToTransportCcCountForTesting() > 0,
|
||||
kDefaultTimeout);
|
||||
// Test that RFC 8888 feedback is NOT generated when field trial disabled.
|
||||
EXPECT_THAT(pc_internal->FeedbackAccordingToRfc8888CountForTesting(), Eq(0));
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -3038,6 +3038,13 @@ int PeerConnection::FeedbackAccordingToRfc8888CountForTesting() const {
|
||||
});
|
||||
}
|
||||
|
||||
int PeerConnection::FeedbackAccordingToTransportCcCountForTesting() const {
|
||||
return worker_thread()->BlockingCall([this]() {
|
||||
RTC_DCHECK_RUN_ON(worker_thread());
|
||||
return call_->FeedbackAccordingToTransportCcCount();
|
||||
});
|
||||
}
|
||||
|
||||
std::function<void(const rtc::CopyOnWriteBuffer& packet,
|
||||
int64_t packet_time_us)>
|
||||
PeerConnection::InitializeRtcpCallback() {
|
||||
|
||||
@ -443,6 +443,7 @@ class PeerConnection : public PeerConnectionInternal,
|
||||
}
|
||||
void RequestUsagePatternReportForTesting();
|
||||
int FeedbackAccordingToRfc8888CountForTesting() const;
|
||||
int FeedbackAccordingToTransportCcCountForTesting() const;
|
||||
|
||||
NetworkControllerInterface* GetNetworkController() override {
|
||||
if (!worker_thread()->IsCurrent()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user