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