Add CreateDatagram to MediaTransportFactory

Bug: webrtc:9719
Change-Id: I6e756d925917f032aa94a221706cd4241085b2a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137340
Commit-Queue: Anton Sukhanov <sukhanov@webrtc.org>
Reviewed-by: Bjorn Mellem <mellem@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27980}
This commit is contained in:
Anton Sukhanov
2019-05-17 14:48:23 -07:00
committed by Commit Bot
parent 9fe1834d5d
commit 6b319e68e9
2 changed files with 22 additions and 2 deletions

View File

@ -15,11 +15,12 @@
// enable different media transport implementations, including QUIC-based
// media transport.
#include "api/media_transport_interface.h"
#include <cstdint>
#include <utility>
#include "api/datagram_transport_interface.h"
#include "api/media_transport_interface.h"
namespace webrtc {
MediaTransportSettings::MediaTransportSettings() = default;
@ -48,6 +49,13 @@ MediaTransportFactory::CreateMediaTransport(
return std::unique_ptr<MediaTransportInterface>(nullptr);
}
RTCErrorOr<std::unique_ptr<DatagramTransportInterface>>
MediaTransportFactory::CreateDatagramTransport(
rtc::Thread* network_thread,
const MediaTransportSettings& settings) {
return std::unique_ptr<DatagramTransportInterface>(nullptr);
}
std::string MediaTransportFactory::GetTransportName() const {
return "";
}

View File

@ -39,6 +39,7 @@ class Thread;
namespace webrtc {
class DatagramTransportInterface;
class RtcEventLog;
class AudioPacketReceivedObserver {
@ -382,6 +383,17 @@ class MediaTransportFactory {
CreateMediaTransport(rtc::Thread* network_thread,
const MediaTransportSettings& settings);
// Creates a new Datagram Transport in a disconnected state. If the datagram
// transport for the caller is created, one can then call
// DatagramTransportInterface::GetTransportParametersOffer on that new
// instance.
//
// TODO(sukhanov): Consider separating media and datagram transport factories.
// TODO(sukhanov): Move factory to a separate .h file.
virtual RTCErrorOr<std::unique_ptr<DatagramTransportInterface>>
CreateDatagramTransport(rtc::Thread* network_thread,
const MediaTransportSettings& settings);
// Gets a transport name which is supported by the implementation.
// Different factories should return different transport names, and at runtime
// it will be checked that different names were used.