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