Remove rtp_ and rtcp_packet_transport() from the RtpTransport interface.
RtpTransportInternal does not need to expose these. They are only used
by tests and for setting options. Instead, it can expose a SetRtpOption
and SetRtcpOption to set options relevant to each of its transports.
Also updates tests to work around no longer having access to internals.
This will simplify the composite needed during negotiation of different
RTP transport types, as we no longer need to have composites of both
RtpTransport and PacketTransport.
Bug: webrtc:9719
Change-Id: I91bfa6e95b7aa384d10497f47e7d2483c2e0bef2
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138282
Commit-Queue: Bjorn Mellem <mellem@webrtc.org>
Reviewed-by: Anton Sukhanov <sukhanov@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28066}
diff --git a/pc/peer_connection_bundle_unittest.cc b/pc/peer_connection_bundle_unittest.cc
index b369db2..57d059c 100644
--- a/pc/peer_connection_bundle_unittest.cc
+++ b/pc/peer_connection_bundle_unittest.cc
@@ -83,14 +83,8 @@
return false;
}
- rtc::PacketTransportInternal* voice_rtp_transport() {
- return (voice_channel() ? voice_channel()->rtp_packet_transport()
- : nullptr);
- }
-
- rtc::PacketTransportInternal* voice_rtcp_transport() {
- return (voice_channel() ? voice_channel()->rtcp_packet_transport()
- : nullptr);
+ RtpTransportInternal* voice_rtp_transport() {
+ return (voice_channel() ? voice_channel()->rtp_transport() : nullptr);
}
cricket::VoiceChannel* voice_channel() {
@@ -104,14 +98,8 @@
return nullptr;
}
- rtc::PacketTransportInternal* video_rtp_transport() {
- return (video_channel() ? video_channel()->rtp_packet_transport()
- : nullptr);
- }
-
- rtc::PacketTransportInternal* video_rtcp_transport() {
- return (video_channel() ? video_channel()->rtcp_packet_transport()
- : nullptr);
+ RtpTransportInternal* video_rtp_transport() {
+ return (video_channel() ? video_channel()->rtp_transport() : nullptr);
}
cricket::VideoChannel* video_channel() {
@@ -552,14 +540,14 @@
ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal()));
- EXPECT_FALSE(caller->voice_rtcp_transport());
- EXPECT_FALSE(caller->video_rtcp_transport());
+ EXPECT_FALSE(caller->voice_rtp_transport()->rtcp_mux_enabled());
+ EXPECT_FALSE(caller->video_rtp_transport()->rtcp_mux_enabled());
ASSERT_TRUE(
caller->SetRemoteDescription(callee->CreateAnswerAndSetAsLocal()));
- EXPECT_FALSE(caller->voice_rtcp_transport());
- EXPECT_FALSE(caller->video_rtcp_transport());
+ EXPECT_TRUE(caller->voice_rtp_transport()->rtcp_mux_enabled());
+ EXPECT_TRUE(caller->video_rtp_transport()->rtcp_mux_enabled());
}
// When negotiating RTCP multiplexing, the PeerConnection makes RTCP transports
@@ -573,14 +561,14 @@
ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal()));
- EXPECT_TRUE(caller->voice_rtcp_transport());
- EXPECT_TRUE(caller->video_rtcp_transport());
+ EXPECT_FALSE(caller->voice_rtp_transport()->rtcp_mux_enabled());
+ EXPECT_FALSE(caller->video_rtp_transport()->rtcp_mux_enabled());
ASSERT_TRUE(
caller->SetRemoteDescription(callee->CreateAnswerAndSetAsLocal()));
- EXPECT_FALSE(caller->voice_rtcp_transport());
- EXPECT_FALSE(caller->video_rtcp_transport());
+ EXPECT_TRUE(caller->voice_rtp_transport()->rtcp_mux_enabled());
+ EXPECT_TRUE(caller->video_rtp_transport()->rtcp_mux_enabled());
}
TEST_P(PeerConnectionBundleTest, FailToSetDescriptionWithBundleAndNoRtcpMux) {