diff --git a/api/ortc/ortcfactoryinterface.h b/api/ortc/ortcfactoryinterface.h index 9937352831..ea25c8a3cb 100644 --- a/api/ortc/ortcfactoryinterface.h +++ b/api/ortc/ortcfactoryinterface.h @@ -15,6 +15,7 @@ #include #include // For std::move. +#include "api/mediaconstraintsinterface.h" #include "api/mediastreaminterface.h" #include "api/mediatypes.h" #include "api/ortc/ortcrtpreceiverinterface.h" @@ -24,7 +25,6 @@ #include "api/ortc/rtptransportinterface.h" #include "api/ortc/srtptransportinterface.h" #include "api/ortc/udptransportinterface.h" -#include "api/peerconnectioninterface.h" #include "api/rtcerror.h" #include "api/rtpparameters.h" #include "rtc_base/network.h" diff --git a/api/peerconnectioninterface.cc b/api/peerconnectioninterface.cc index b4148d7480..05aa53f15b 100644 --- a/api/peerconnectioninterface.cc +++ b/api/peerconnectioninterface.cc @@ -192,6 +192,16 @@ PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies( PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() = default; +rtc::scoped_refptr +PeerConnectionFactoryInterface::CreatePeerConnection( + const PeerConnectionInterface::RTCConfiguration& configuration, + const MediaConstraintsInterface* constraints, + std::unique_ptr allocator, + std::unique_ptr cert_generator, + PeerConnectionObserver* observer) { + return nullptr; +} + rtc::scoped_refptr PeerConnectionFactoryInterface::CreatePeerConnection( const PeerConnectionInterface::RTCConfiguration& configuration, diff --git a/api/peerconnectioninterface.h b/api/peerconnectioninterface.h index 1c32b69692..2b94ee8ad5 100644 --- a/api/peerconnectioninterface.h +++ b/api/peerconnectioninterface.h @@ -1233,6 +1233,15 @@ class PeerConnectionFactoryInterface : public rtc::RefCountInterface { std::unique_ptr cert_generator, PeerConnectionObserver* observer); + // Deprecated; should use RTCConfiguration for everything that previously + // used constraints. + virtual rtc::scoped_refptr CreatePeerConnection( + const PeerConnectionInterface::RTCConfiguration& configuration, + const MediaConstraintsInterface* constraints, + std::unique_ptr allocator, + std::unique_ptr cert_generator, + PeerConnectionObserver* observer); + // Returns the capabilities of an RTP sender of type |kind|. // If for some reason you pass in MEDIA_TYPE_DATA, returns an empty structure. // TODO(orphis): Make pure virtual when all subclasses implement it. diff --git a/api/test/mock_peerconnectioninterface.h b/api/test/mock_peerconnectioninterface.h index 2e040decd8..58ca741033 100644 --- a/api/test/mock_peerconnectioninterface.h +++ b/api/test/mock_peerconnectioninterface.h @@ -88,12 +88,18 @@ class MockPeerConnectionInterface const SessionDescriptionInterface*()); MOCK_CONST_METHOD0(pending_remote_description, const SessionDescriptionInterface*()); + MOCK_METHOD2(CreateOffer, + void(CreateSessionDescriptionObserver*, + const MediaConstraintsInterface*)); MOCK_METHOD2(CreateOffer, void(CreateSessionDescriptionObserver*, const RTCOfferAnswerOptions&)); MOCK_METHOD2(CreateAnswer, void(CreateSessionDescriptionObserver*, const RTCOfferAnswerOptions&)); + MOCK_METHOD2(CreateAnswer, + void(CreateSessionDescriptionObserver*, + const MediaConstraintsInterface*)); MOCK_METHOD2(SetLocalDescription, void(SetSessionDescriptionObserver*, SessionDescriptionInterface*)); diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc index 6c543f90ef..7bc25706f0 100644 --- a/pc/peerconnection.cc +++ b/pc/peerconnection.cc @@ -20,6 +20,7 @@ #include "absl/memory/memory.h" #include "api/jsepicecandidate.h" #include "api/jsepsessiondescription.h" +#include "api/mediaconstraintsinterface.h" #include "api/mediastreamproxy.h" #include "api/mediastreamtrackproxy.h" #include "call/call.h" diff --git a/pc/peerconnection_integrationtest.cc b/pc/peerconnection_integrationtest.cc index d9fa1d5abd..cc97e4ef7d 100644 --- a/pc/peerconnection_integrationtest.cc +++ b/pc/peerconnection_integrationtest.cc @@ -85,6 +85,7 @@ using webrtc::DtmfSender; using webrtc::DtmfSenderInterface; using webrtc::DtmfSenderObserverInterface; using webrtc::FakeVideoTrackRenderer; +using webrtc::MediaConstraintsInterface; using webrtc::MediaStreamInterface; using webrtc::MediaStreamTrackInterface; using webrtc::MockCreateSessionDescriptionObserver; diff --git a/pc/peerconnectionendtoend_unittest.cc b/pc/peerconnectionendtoend_unittest.cc index 60da2d242c..427529c2c9 100644 --- a/pc/peerconnectionendtoend_unittest.cc +++ b/pc/peerconnectionendtoend_unittest.cc @@ -40,6 +40,7 @@ using testing::_; using webrtc::DataChannelInterface; using webrtc::FakeConstraints; +using webrtc::MediaConstraintsInterface; using webrtc::MediaStreamInterface; using webrtc::PeerConnectionInterface; using webrtc::SdpSemantics; diff --git a/pc/peerconnectioninterface_unittest.cc b/pc/peerconnectioninterface_unittest.cc index 719fdbdd7f..2f6c0efbe0 100644 --- a/pc/peerconnectioninterface_unittest.cc +++ b/pc/peerconnectioninterface_unittest.cc @@ -417,6 +417,7 @@ using webrtc::AudioTrackInterface; using webrtc::DataBuffer; using webrtc::DataChannelInterface; using webrtc::IceCandidateInterface; +using webrtc::MediaConstraintsInterface; using webrtc::MediaStream; using webrtc::MediaStreamInterface; using webrtc::MediaStreamTrackInterface; diff --git a/pc/test/mock_peerconnection.h b/pc/test/mock_peerconnection.h index 0a75b14772..d8cb5e381b 100644 --- a/pc/test/mock_peerconnection.h +++ b/pc/test/mock_peerconnection.h @@ -118,12 +118,18 @@ class MockPeerConnection const SessionDescriptionInterface*()); MOCK_CONST_METHOD0(pending_remote_description, const SessionDescriptionInterface*()); + MOCK_METHOD2(CreateOffer, + void(CreateSessionDescriptionObserver*, + const MediaConstraintsInterface*)); MOCK_METHOD2(CreateOffer, void(CreateSessionDescriptionObserver*, const RTCOfferAnswerOptions&)); MOCK_METHOD2(CreateAnswer, void(CreateSessionDescriptionObserver*, const RTCOfferAnswerOptions&)); + MOCK_METHOD2(CreateAnswer, + void(CreateSessionDescriptionObserver*, + const MediaConstraintsInterface*)); MOCK_METHOD2(SetLocalDescription, void(SetSessionDescriptionObserver*, SessionDescriptionInterface*)); diff --git a/pc/test/peerconnectiontestwrapper.cc b/pc/test/peerconnectiontestwrapper.cc index 03dabb554e..fc699d3143 100644 --- a/pc/test/peerconnectiontestwrapper.cc +++ b/pc/test/peerconnectiontestwrapper.cc @@ -26,6 +26,7 @@ using webrtc::FakeConstraints; using webrtc::FakeVideoTrackRenderer; using webrtc::IceCandidateInterface; +using webrtc::MediaConstraintsInterface; using webrtc::MediaStreamInterface; using webrtc::MediaStreamTrackInterface; using webrtc::MockSetSessionDescriptionObserver; diff --git a/pc/webrtcsessiondescriptionfactory.cc b/pc/webrtcsessiondescriptionfactory.cc index 808e411a39..22551437e3 100644 --- a/pc/webrtcsessiondescriptionfactory.cc +++ b/pc/webrtcsessiondescriptionfactory.cc @@ -18,6 +18,7 @@ #include "absl/memory/memory.h" #include "api/jsep.h" #include "api/jsepsessiondescription.h" +#include "api/mediaconstraintsinterface.h" #include "rtc_base/checks.h" #include "rtc_base/sslidentity.h"