Introduce MediaTransportConfig

Currently we pass media_transport from PeerConnection to media layers. The goal of this change is to replace media_transport with struct MediaTransportCondif, which will enable adding different transports (i.e. we plan to add DatagramTransport) as well as other media-transport related settings without changing 100s of files.

TODO: In the future we should consider also adding rtp_transport in the same config, but it will require a bit more work, so I did not include it in the same change.


Bug: webrtc:9719
Change-Id: Ie31e1faa3ed9e6beefe30a3da208130509ce00cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137181
Commit-Queue: Anton Sukhanov <sukhanov@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28016}
diff --git a/media/base/media_channel.h b/media/base/media_channel.h
index 4930d41..04edd9c 100644
--- a/media/base/media_channel.h
+++ b/media/base/media_channel.h
@@ -22,7 +22,7 @@
 #include "api/audio_options.h"
 #include "api/crypto/frame_decryptor_interface.h"
 #include "api/crypto/frame_encryptor_interface.h"
-#include "api/media_transport_interface.h"
+#include "api/media_transport_config.h"
 #include "api/rtc_error.h"
 #include "api/rtp_parameters.h"
 #include "api/rtp_receiver_interface.h"
@@ -193,8 +193,9 @@
   // TODO(sukhanov): Currently media transport can co-exist with RTP/RTCP, but
   // in the future we will refactor code to send all frames with media
   // transport.
-  virtual void SetInterface(NetworkInterface* iface,
-                            webrtc::MediaTransportInterface* media_transport);
+  virtual void SetInterface(
+      NetworkInterface* iface,
+      const webrtc::MediaTransportConfig& media_transport_config);
   // Called when a RTP packet is received.
   virtual void OnPacketReceived(rtc::CopyOnWriteBuffer packet,
                                 int64_t packet_time_us) = 0;
@@ -261,8 +262,12 @@
     return network_interface_->SetOption(type, opt, option);
   }
 
+  const webrtc::MediaTransportConfig& media_transport_config() const {
+    return media_transport_config_;
+  }
+
   webrtc::MediaTransportInterface* media_transport() {
-    return media_transport_;
+    return media_transport_config_.media_transport;
   }
 
   // Corresponds to the SDP attribute extmap-allow-mixed, see RFC8285.
@@ -331,7 +336,7 @@
       nullptr;
   rtc::DiffServCodePoint preferred_dscp_
       RTC_GUARDED_BY(network_interface_crit_) = rtc::DSCP_DEFAULT;
-  webrtc::MediaTransportInterface* media_transport_ = nullptr;
+  webrtc::MediaTransportConfig media_transport_config_;
   bool extmap_allow_mixed_ = false;
 };