| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_API_PEERCONNECTIONFACTORYPROXY_H_ | 11 #ifndef WEBRTC_API_PEERCONNECTIONFACTORYPROXY_H_ |
| 12 #define WEBRTC_API_PEERCONNECTIONFACTORYPROXY_H_ | 12 #define WEBRTC_API_PEERCONNECTIONFACTORYPROXY_H_ |
| 13 | 13 |
| 14 #include <memory> |
| 14 #include <string> | 15 #include <string> |
| 15 #include <utility> | 16 #include <utility> |
| 16 | 17 |
| 17 #include "webrtc/api/peerconnectioninterface.h" | 18 #include "webrtc/api/peerconnectioninterface.h" |
| 18 #include "webrtc/api/proxy.h" | 19 #include "webrtc/api/proxy.h" |
| 19 #include "webrtc/base/bind.h" | 20 #include "webrtc/base/bind.h" |
| 20 | 21 |
| 21 namespace webrtc { | 22 namespace webrtc { |
| 22 | 23 |
| 23 BEGIN_SIGNALING_PROXY_MAP(PeerConnectionFactory) | 24 BEGIN_SIGNALING_PROXY_MAP(PeerConnectionFactory) |
| 24 PROXY_METHOD1(void, SetOptions, const Options&) | 25 PROXY_METHOD1(void, SetOptions, const Options&) |
| 25 // Can't use PROXY_METHOD5 because scoped_ptr must be moved. | 26 // Can't use PROXY_METHOD5 because unique_ptr must be moved. |
| 26 // TODO(tommi,hbos): Use of templates to support scoped_ptr? | 27 // TODO(tommi,hbos): Use of templates to support unique_ptr? |
| 27 rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( | 28 rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( |
| 28 const PeerConnectionInterface::RTCConfiguration& a1, | 29 const PeerConnectionInterface::RTCConfiguration& a1, |
| 29 const MediaConstraintsInterface* a2, | 30 const MediaConstraintsInterface* a2, |
| 30 rtc::scoped_ptr<cricket::PortAllocator> a3, | 31 std::unique_ptr<cricket::PortAllocator> a3, |
| 31 rtc::scoped_ptr<DtlsIdentityStoreInterface> a4, | 32 std::unique_ptr<DtlsIdentityStoreInterface> a4, |
| 32 PeerConnectionObserver* a5) override { | 33 PeerConnectionObserver* a5) override { |
| 33 return signaling_thread_ | 34 return signaling_thread_ |
| 34 ->Invoke<rtc::scoped_refptr<PeerConnectionInterface>>( | 35 ->Invoke<rtc::scoped_refptr<PeerConnectionInterface>>( |
| 35 rtc::Bind(&PeerConnectionFactoryProxy::CreatePeerConnection_ot, | 36 rtc::Bind(&PeerConnectionFactoryProxy::CreatePeerConnection_ot, |
| 36 this, a1, a2, a3.release(), a4.release(), a5)); | 37 this, a1, a2, a3.release(), a4.release(), a5)); |
| 37 } | 38 } |
| 38 rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( | 39 rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( |
| 39 const PeerConnectionInterface::RTCConfiguration& a1, | 40 const PeerConnectionInterface::RTCConfiguration& a1, |
| 40 rtc::scoped_ptr<cricket::PortAllocator> a3, | 41 std::unique_ptr<cricket::PortAllocator> a3, |
| 41 rtc::scoped_ptr<DtlsIdentityStoreInterface> a4, | 42 std::unique_ptr<DtlsIdentityStoreInterface> a4, |
| 42 PeerConnectionObserver* a5) override { | 43 PeerConnectionObserver* a5) override { |
| 43 return signaling_thread_ | 44 return signaling_thread_ |
| 44 ->Invoke<rtc::scoped_refptr<PeerConnectionInterface>>( | 45 ->Invoke<rtc::scoped_refptr<PeerConnectionInterface>>( |
| 45 rtc::Bind(&PeerConnectionFactoryProxy::CreatePeerConnection_ot, | 46 rtc::Bind(&PeerConnectionFactoryProxy::CreatePeerConnection_ot, |
| 46 this, a1, a3.release(), a4.release(), a5)); | 47 this, a1, a3.release(), a4.release(), a5)); |
| 47 } | 48 } |
| 48 PROXY_METHOD1(rtc::scoped_refptr<MediaStreamInterface>, | 49 PROXY_METHOD1(rtc::scoped_refptr<MediaStreamInterface>, |
| 49 CreateLocalMediaStream, const std::string&) | 50 CreateLocalMediaStream, const std::string&) |
| 50 PROXY_METHOD1(rtc::scoped_refptr<AudioSourceInterface>, | 51 PROXY_METHOD1(rtc::scoped_refptr<AudioSourceInterface>, |
| 51 CreateAudioSource, const MediaConstraintsInterface*) | 52 CreateAudioSource, const MediaConstraintsInterface*) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 70 PROXY_METHOD1(bool, StartRtcEventLog, rtc::PlatformFile) | 71 PROXY_METHOD1(bool, StartRtcEventLog, rtc::PlatformFile) |
| 71 PROXY_METHOD0(void, StopRtcEventLog) | 72 PROXY_METHOD0(void, StopRtcEventLog) |
| 72 | 73 |
| 73 private: | 74 private: |
| 74 rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection_ot( | 75 rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection_ot( |
| 75 const PeerConnectionInterface::RTCConfiguration& a1, | 76 const PeerConnectionInterface::RTCConfiguration& a1, |
| 76 const MediaConstraintsInterface* a2, | 77 const MediaConstraintsInterface* a2, |
| 77 cricket::PortAllocator* a3, | 78 cricket::PortAllocator* a3, |
| 78 DtlsIdentityStoreInterface* a4, | 79 DtlsIdentityStoreInterface* a4, |
| 79 PeerConnectionObserver* a5) { | 80 PeerConnectionObserver* a5) { |
| 80 rtc::scoped_ptr<cricket::PortAllocator> ptr_a3(a3); | 81 std::unique_ptr<cricket::PortAllocator> ptr_a3(a3); |
| 81 rtc::scoped_ptr<DtlsIdentityStoreInterface> ptr_a4(a4); | 82 std::unique_ptr<DtlsIdentityStoreInterface> ptr_a4(a4); |
| 82 return c_->CreatePeerConnection(a1, a2, std::move(ptr_a3), | 83 return c_->CreatePeerConnection(a1, a2, std::move(ptr_a3), |
| 83 std::move(ptr_a4), a5); | 84 std::move(ptr_a4), a5); |
| 84 } | 85 } |
| 85 | 86 |
| 86 rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection_ot( | 87 rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection_ot( |
| 87 const PeerConnectionInterface::RTCConfiguration& a1, | 88 const PeerConnectionInterface::RTCConfiguration& a1, |
| 88 cricket::PortAllocator* a3, | 89 cricket::PortAllocator* a3, |
| 89 DtlsIdentityStoreInterface* a4, | 90 DtlsIdentityStoreInterface* a4, |
| 90 PeerConnectionObserver* a5) { | 91 PeerConnectionObserver* a5) { |
| 91 rtc::scoped_ptr<cricket::PortAllocator> ptr_a3(a3); | 92 std::unique_ptr<cricket::PortAllocator> ptr_a3(a3); |
| 92 rtc::scoped_ptr<DtlsIdentityStoreInterface> ptr_a4(a4); | 93 std::unique_ptr<DtlsIdentityStoreInterface> ptr_a4(a4); |
| 93 return c_->CreatePeerConnection(a1, std::move(ptr_a3), std::move(ptr_a4), | 94 return c_->CreatePeerConnection(a1, std::move(ptr_a3), std::move(ptr_a4), |
| 94 a5); | 95 a5); |
| 95 } | 96 } |
| 96 END_SIGNALING_PROXY() | 97 END_SIGNALING_PROXY() |
| 97 | 98 |
| 98 } // namespace webrtc | 99 } // namespace webrtc |
| 99 | 100 |
| 100 #endif // WEBRTC_API_PEERCONNECTIONFACTORYPROXY_H_ | 101 #endif // WEBRTC_API_PEERCONNECTIONFACTORYPROXY_H_ |
| OLD | NEW |