| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 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_TEST_PEERCONNECTIONTESTWRAPPER_H_ | 11 #ifndef WEBRTC_API_TEST_PEERCONNECTIONTESTWRAPPER_H_ |
| 12 #define WEBRTC_API_TEST_PEERCONNECTIONTESTWRAPPER_H_ | 12 #define WEBRTC_API_TEST_PEERCONNECTIONTESTWRAPPER_H_ |
| 13 | 13 |
| 14 #include <memory> | 14 #include <memory> |
| 15 | 15 |
| 16 #include "webrtc/api/peerconnectioninterface.h" | 16 #include "webrtc/api/peerconnectioninterface.h" |
| 17 #include "webrtc/api/test/fakeaudiocapturemodule.h" | 17 #include "webrtc/api/test/fakeaudiocapturemodule.h" |
| 18 #include "webrtc/api/test/fakeconstraints.h" | 18 #include "webrtc/api/test/fakeconstraints.h" |
| 19 #include "webrtc/api/test/fakevideotrackrenderer.h" | 19 #include "webrtc/api/test/fakevideotrackrenderer.h" |
| 20 #include "webrtc/base/sigslot.h" | 20 #include "webrtc/base/sigslot.h" |
| 21 | 21 |
| 22 class PeerConnectionTestWrapper | 22 class PeerConnectionTestWrapper |
| 23 : public webrtc::PeerConnectionObserver, | 23 : public webrtc::PeerConnectionObserver, |
| 24 public webrtc::CreateSessionDescriptionObserver, | 24 public webrtc::CreateSessionDescriptionObserver, |
| 25 public sigslot::has_slots<> { | 25 public sigslot::has_slots<> { |
| 26 public: | 26 public: |
| 27 static void Connect(PeerConnectionTestWrapper* caller, | 27 static void Connect(PeerConnectionTestWrapper* caller, |
| 28 PeerConnectionTestWrapper* callee); | 28 PeerConnectionTestWrapper* callee); |
| 29 | 29 |
| 30 explicit PeerConnectionTestWrapper(const std::string& name, | 30 PeerConnectionTestWrapper(const std::string& name, |
| 31 rtc::Thread* worker_thread); | 31 rtc::Thread* network_thread, |
| 32 rtc::Thread* worker_thread); |
| 32 virtual ~PeerConnectionTestWrapper(); | 33 virtual ~PeerConnectionTestWrapper(); |
| 33 | 34 |
| 34 bool CreatePc(const webrtc::MediaConstraintsInterface* constraints); | 35 bool CreatePc(const webrtc::MediaConstraintsInterface* constraints); |
| 35 | 36 |
| 36 rtc::scoped_refptr<webrtc::DataChannelInterface> CreateDataChannel( | 37 rtc::scoped_refptr<webrtc::DataChannelInterface> CreateDataChannel( |
| 37 const std::string& label, | 38 const std::string& label, |
| 38 const webrtc::DataChannelInit& init); | 39 const webrtc::DataChannelInit& init); |
| 39 | 40 |
| 40 // Implements PeerConnectionObserver. | 41 // Implements PeerConnectionObserver. |
| 41 virtual void OnSignalingChange( | 42 virtual void OnSignalingChange( |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 void SetLocalDescription(const std::string& type, const std::string& sdp); | 85 void SetLocalDescription(const std::string& type, const std::string& sdp); |
| 85 void SetRemoteDescription(const std::string& type, const std::string& sdp); | 86 void SetRemoteDescription(const std::string& type, const std::string& sdp); |
| 86 bool CheckForConnection(); | 87 bool CheckForConnection(); |
| 87 bool CheckForAudio(); | 88 bool CheckForAudio(); |
| 88 bool CheckForVideo(); | 89 bool CheckForVideo(); |
| 89 rtc::scoped_refptr<webrtc::MediaStreamInterface> GetUserMedia( | 90 rtc::scoped_refptr<webrtc::MediaStreamInterface> GetUserMedia( |
| 90 bool audio, const webrtc::FakeConstraints& audio_constraints, | 91 bool audio, const webrtc::FakeConstraints& audio_constraints, |
| 91 bool video, const webrtc::FakeConstraints& video_constraints); | 92 bool video, const webrtc::FakeConstraints& video_constraints); |
| 92 | 93 |
| 93 std::string name_; | 94 std::string name_; |
| 94 rtc::Thread* worker_thread_; | 95 rtc::Thread* const network_thread_; |
| 96 rtc::Thread* const worker_thread_; |
| 95 rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_; | 97 rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_; |
| 96 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> | 98 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> |
| 97 peer_connection_factory_; | 99 peer_connection_factory_; |
| 98 rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_; | 100 rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_; |
| 99 std::unique_ptr<webrtc::FakeVideoTrackRenderer> renderer_; | 101 std::unique_ptr<webrtc::FakeVideoTrackRenderer> renderer_; |
| 100 }; | 102 }; |
| 101 | 103 |
| 102 #endif // WEBRTC_API_TEST_PEERCONNECTIONTESTWRAPPER_H_ | 104 #endif // WEBRTC_API_TEST_PEERCONNECTIONTESTWRAPPER_H_ |
| OLD | NEW |