diff options
Diffstat (limited to 'api/peer_connection_interface.cc')
-rw-r--r-- | api/peer_connection_interface.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/api/peer_connection_interface.cc b/api/peer_connection_interface.cc index e1d94dd8c7..230731c42d 100644 --- a/api/peer_connection_interface.cc +++ b/api/peer_connection_interface.cc @@ -10,8 +10,7 @@ #include "api/peer_connection_interface.h" -#include "api/dtls_transport_interface.h" -#include "api/sctp_transport_interface.h" +#include <utility> namespace webrtc { @@ -77,14 +76,27 @@ PeerConnectionFactoryInterface::CreatePeerConnection( std::unique_ptr<cricket::PortAllocator> allocator, std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, PeerConnectionObserver* observer) { - return nullptr; + PeerConnectionDependencies dependencies(observer); + dependencies.allocator = std::move(allocator); + dependencies.cert_generator = std::move(cert_generator); + auto result = + CreatePeerConnectionOrError(configuration, std::move(dependencies)); + if (!result.ok()) { + return nullptr; + } + return result.MoveValue(); } rtc::scoped_refptr<PeerConnectionInterface> PeerConnectionFactoryInterface::CreatePeerConnection( const PeerConnectionInterface::RTCConfiguration& configuration, PeerConnectionDependencies dependencies) { - return nullptr; + auto result = + CreatePeerConnectionOrError(configuration, std::move(dependencies)); + if (!result.ok()) { + return nullptr; + } + return result.MoveValue(); } RTCErrorOr<rtc::scoped_refptr<PeerConnectionInterface>> |