Update media transport settings struct
1) Add an explicit copy constructor with default implementation.
2) Pass it by const reference.
Bug: webrtc:9719
Change-Id: I8e4c8c837ad048ee030f86c01c24102015e12949
Reviewed-on: https://webrtc-review.googlesource.com/c/108380
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Peter Slatala <psla@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25432}
diff --git a/api/media_transport_interface.cc b/api/media_transport_interface.cc
index 40dde2a..c583fb4 100644
--- a/api/media_transport_interface.cc
+++ b/api/media_transport_interface.cc
@@ -23,6 +23,10 @@
namespace webrtc {
MediaTransportSettings::MediaTransportSettings() = default;
+MediaTransportSettings::MediaTransportSettings(const MediaTransportSettings&) =
+ default;
+MediaTransportSettings& MediaTransportSettings::operator=(
+ const MediaTransportSettings&) = default;
MediaTransportSettings::~MediaTransportSettings() = default;
MediaTransportEncodedAudioFrame::~MediaTransportEncodedAudioFrame() {}
@@ -84,14 +88,16 @@
rtc::PacketTransportInternal* packet_transport,
rtc::Thread* network_thread,
bool is_caller) {
- return std::unique_ptr<MediaTransportInterface>(nullptr);
+ MediaTransportSettings settings;
+ settings.is_caller = is_caller;
+ return CreateMediaTransport(packet_transport, network_thread, settings);
}
RTCErrorOr<std::unique_ptr<MediaTransportInterface>>
MediaTransportFactory::CreateMediaTransport(
rtc::PacketTransportInternal* packet_transport,
rtc::Thread* network_thread,
- const MediaTransportSettings settings) {
+ const MediaTransportSettings& settings) {
return std::unique_ptr<MediaTransportInterface>(nullptr);
}
diff --git a/api/media_transport_interface.h b/api/media_transport_interface.h
index 0e6a3fc..6580370 100644
--- a/api/media_transport_interface.h
+++ b/api/media_transport_interface.h
@@ -39,6 +39,8 @@
// A collection of settings for creation of media transport.
struct MediaTransportSettings final {
MediaTransportSettings();
+ MediaTransportSettings(const MediaTransportSettings&);
+ MediaTransportSettings& operator=(const MediaTransportSettings&);
~MediaTransportSettings();
// Group calls are not currently supported, in 1:1 call one side must set
@@ -280,7 +282,7 @@
virtual RTCErrorOr<std::unique_ptr<MediaTransportInterface>>
CreateMediaTransport(rtc::PacketTransportInternal* packet_transport,
rtc::Thread* network_thread,
- const MediaTransportSettings settings);
+ const MediaTransportSettings& settings);
};
} // namespace webrtc