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 |
(...skipping 29 matching lines...) Expand all Loading... |
40 callee, &PeerConnectionTestWrapper::AddIceCandidate); | 40 callee, &PeerConnectionTestWrapper::AddIceCandidate); |
41 callee->SignalOnIceCandidateReady.connect( | 41 callee->SignalOnIceCandidateReady.connect( |
42 caller, &PeerConnectionTestWrapper::AddIceCandidate); | 42 caller, &PeerConnectionTestWrapper::AddIceCandidate); |
43 | 43 |
44 caller->SignalOnSdpReady.connect( | 44 caller->SignalOnSdpReady.connect( |
45 callee, &PeerConnectionTestWrapper::ReceiveOfferSdp); | 45 callee, &PeerConnectionTestWrapper::ReceiveOfferSdp); |
46 callee->SignalOnSdpReady.connect( | 46 callee->SignalOnSdpReady.connect( |
47 caller, &PeerConnectionTestWrapper::ReceiveAnswerSdp); | 47 caller, &PeerConnectionTestWrapper::ReceiveAnswerSdp); |
48 } | 48 } |
49 | 49 |
50 PeerConnectionTestWrapper::PeerConnectionTestWrapper(const std::string& name) | 50 PeerConnectionTestWrapper::PeerConnectionTestWrapper(const std::string& name, |
51 : name_(name) {} | 51 rtc::Thread* worker_thread) |
| 52 : name_(name), worker_thread_(worker_thread) {} |
52 | 53 |
53 PeerConnectionTestWrapper::~PeerConnectionTestWrapper() {} | 54 PeerConnectionTestWrapper::~PeerConnectionTestWrapper() {} |
54 | 55 |
55 bool PeerConnectionTestWrapper::CreatePc( | 56 bool PeerConnectionTestWrapper::CreatePc( |
56 const MediaConstraintsInterface* constraints) { | 57 const MediaConstraintsInterface* constraints) { |
57 rtc::scoped_ptr<cricket::PortAllocator> port_allocator( | 58 rtc::scoped_ptr<cricket::PortAllocator> port_allocator( |
58 new cricket::FakePortAllocator(rtc::Thread::Current(), nullptr)); | 59 new cricket::FakePortAllocator(worker_thread_, nullptr)); |
59 | 60 |
60 fake_audio_capture_module_ = FakeAudioCaptureModule::Create(); | 61 fake_audio_capture_module_ = FakeAudioCaptureModule::Create(); |
61 if (fake_audio_capture_module_ == NULL) { | 62 if (fake_audio_capture_module_ == NULL) { |
62 return false; | 63 return false; |
63 } | 64 } |
64 | 65 |
65 peer_connection_factory_ = webrtc::CreatePeerConnectionFactory( | 66 peer_connection_factory_ = webrtc::CreatePeerConnectionFactory( |
66 rtc::Thread::Current(), rtc::Thread::Current(), | 67 worker_thread_, rtc::Thread::Current(), fake_audio_capture_module_, NULL, |
67 fake_audio_capture_module_, NULL, NULL); | 68 NULL); |
68 if (!peer_connection_factory_) { | 69 if (!peer_connection_factory_) { |
69 return false; | 70 return false; |
70 } | 71 } |
71 | 72 |
72 // CreatePeerConnection with RTCConfiguration. | 73 // CreatePeerConnection with RTCConfiguration. |
73 webrtc::PeerConnectionInterface::RTCConfiguration config; | 74 webrtc::PeerConnectionInterface::RTCConfiguration config; |
74 webrtc::PeerConnectionInterface::IceServer ice_server; | 75 webrtc::PeerConnectionInterface::IceServer ice_server; |
75 ice_server.uri = "stun:stun.l.google.com:19302"; | 76 ice_server.uri = "stun:stun.l.google.com:19302"; |
76 config.servers.push_back(ice_server); | 77 config.servers.push_back(ice_server); |
77 rtc::scoped_ptr<webrtc::DtlsIdentityStoreInterface> dtls_identity_store( | 78 rtc::scoped_ptr<webrtc::DtlsIdentityStoreInterface> dtls_identity_store( |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 peer_connection_factory_->CreateVideoSource( | 271 peer_connection_factory_->CreateVideoSource( |
271 new webrtc::FakePeriodicVideoCapturer(), &constraints); | 272 new webrtc::FakePeriodicVideoCapturer(), &constraints); |
272 std::string videotrack_label = label + kVideoTrackLabelBase; | 273 std::string videotrack_label = label + kVideoTrackLabelBase; |
273 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( | 274 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( |
274 peer_connection_factory_->CreateVideoTrack(videotrack_label, source)); | 275 peer_connection_factory_->CreateVideoTrack(videotrack_label, source)); |
275 | 276 |
276 stream->AddTrack(video_track); | 277 stream->AddTrack(video_track); |
277 } | 278 } |
278 return stream; | 279 return stream; |
279 } | 280 } |
OLD | NEW |