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