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/rtp_transport.cc b/pc/rtp_transport.cc
index b7d3a9d..6cfbed9 100644
--- a/pc/rtp_transport.cc
+++ b/pc/rtp_transport.cc
@@ -31,6 +31,21 @@
MaybeSignalReadyToSend();
}
+const std::string& RtpTransport::transport_name() const {
+ return rtp_packet_transport_->transport_name();
+}
+
+int RtpTransport::SetRtpOption(rtc::Socket::Option opt, int value) {
+ return rtp_packet_transport_->SetOption(opt, value);
+}
+
+int RtpTransport::SetRtcpOption(rtc::Socket::Option opt, int value) {
+ if (rtcp_packet_transport_) {
+ return rtcp_packet_transport_->SetOption(opt, value);
+ }
+ return -1;
+}
+
void RtpTransport::SetRtpPacketTransport(
rtc::PacketTransportInternal* new_packet_transport) {
if (new_packet_transport == rtp_packet_transport_) {