diff --git a/api/media_transport_interface.cc b/api/media_transport_interface.cc index e4fbede278..40dde2aed3 100644 --- a/api/media_transport_interface.cc +++ b/api/media_transport_interface.cc @@ -22,6 +22,9 @@ namespace webrtc { +MediaTransportSettings::MediaTransportSettings() = default; +MediaTransportSettings::~MediaTransportSettings() = default; + MediaTransportEncodedAudioFrame::~MediaTransportEncodedAudioFrame() {} MediaTransportEncodedAudioFrame::MediaTransportEncodedAudioFrame( @@ -76,4 +79,20 @@ MediaTransportEncodedVideoFrame::MediaTransportEncodedVideoFrame( MediaTransportEncodedVideoFrame::MediaTransportEncodedVideoFrame( MediaTransportEncodedVideoFrame&&) = default; +RTCErrorOr> +MediaTransportFactory::CreateMediaTransport( + rtc::PacketTransportInternal* packet_transport, + rtc::Thread* network_thread, + bool is_caller) { + return std::unique_ptr(nullptr); +} + +RTCErrorOr> +MediaTransportFactory::CreateMediaTransport( + rtc::PacketTransportInternal* packet_transport, + rtc::Thread* network_thread, + const MediaTransportSettings settings) { + return std::unique_ptr(nullptr); +} + } // namespace webrtc diff --git a/api/media_transport_interface.h b/api/media_transport_interface.h index fc0922cdc1..b388ac9218 100644 --- a/api/media_transport_interface.h +++ b/api/media_transport_interface.h @@ -18,9 +18,11 @@ #define API_MEDIA_TRANSPORT_INTERFACE_H_ #include +#include #include #include +#include "absl/types/optional.h" #include "api/array_view.h" #include "api/rtcerror.h" #include "api/video/encoded_image.h" @@ -33,6 +35,19 @@ class Thread; namespace webrtc { +// A collection of settings for creation of media transport. +struct MediaTransportSettings final { + MediaTransportSettings(); + ~MediaTransportSettings(); + + // Group calls are not currently supported, in 1:1 call one side must set + // is_caller = true and another is_caller = false. + bool is_caller; + + // Must be set if a pre-shared key is used for the call. + absl::optional pre_shared_key; +}; + // Represents encoded audio frame in any encoding (type of encoding is opaque). // To avoid copying of encoded data use move semantics when passing by value. class MediaTransportEncodedAudioFrame final { @@ -244,10 +259,21 @@ class MediaTransportFactory { // - Does not take ownership of packet_transport or network_thread. // - Does not support group calls, in 1:1 call one side must set // is_caller = true and another is_caller = false. + // TODO(bugs.webrtc.org/9938) This constructor will be removed and replaced + // with the one below. virtual RTCErrorOr> CreateMediaTransport(rtc::PacketTransportInternal* packet_transport, rtc::Thread* network_thread, - bool is_caller) = 0; + bool is_caller); + + // Creates media transport. + // - Does not take ownership of packet_transport or network_thread. + // TODO(bugs.webrtc.org/9938): remove default implementation once all children + // override it. + virtual RTCErrorOr> + CreateMediaTransport(rtc::PacketTransportInternal* packet_transport, + rtc::Thread* network_thread, + const MediaTransportSettings settings); }; } // namespace webrtc