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}
This commit is contained in:
Piotr (Peter) Slatala 2018-10-29 10:43:16 -07:00 committed by Commit Bot
parent 3e67676fa6
commit ed7b8b1e55
2 changed files with 11 additions and 3 deletions

View File

@ -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 @@ MediaTransportFactory::CreateMediaTransport(
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);
}

View File

@ -39,6 +39,8 @@ namespace webrtc {
// 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 @@ class MediaTransportFactory {
virtual RTCErrorOr<std::unique_ptr<MediaTransportInterface>>
CreateMediaTransport(rtc::PacketTransportInternal* packet_transport,
rtc::Thread* network_thread,
const MediaTransportSettings settings);
const MediaTransportSettings& settings);
};
} // namespace webrtc