| 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) { | |
| 63 std::unique_ptr<cricket::PortAllocator> port_allocator( | 62 std::unique_ptr<cricket::PortAllocator> port_allocator( |
| 64 new cricket::FakePortAllocator(network_thread_, nullptr)); | 63 new cricket::FakePortAllocator(network_thread_, nullptr)); |
| 65 | 64 |
| 66 fake_audio_capture_module_ = FakeAudioCaptureModule::Create(); | 65 fake_audio_capture_module_ = FakeAudioCaptureModule::Create(); |
| 67 if (fake_audio_capture_module_ == NULL) { | 66 if (fake_audio_capture_module_ == NULL) { |
| 68 return false; | 67 return false; |
| 69 } | 68 } |
| 70 | 69 |
| 71 peer_connection_factory_ = webrtc::CreatePeerConnectionFactory( | 70 peer_connection_factory_ = webrtc::CreatePeerConnectionFactory( |
| 72 network_thread_, worker_thread_, rtc::Thread::Current(), | 71 network_thread_, worker_thread_, rtc::Thread::Current(), |
| 73 fake_audio_capture_module_, NULL, NULL); | 72 fake_audio_capture_module_, NULL, NULL); |
| 74 if (!peer_connection_factory_) { | 73 if (!peer_connection_factory_) { |
| 75 return false; | 74 return false; |
| 76 } | 75 } |
| 77 | 76 |
| 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); |
| 78 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator( | 82 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator( |
| 79 rtc::SSLStreamAdapter::HaveDtlsSrtp() ? new FakeRTCCertificateGenerator() | 83 rtc::SSLStreamAdapter::HaveDtlsSrtp() ? new FakeRTCCertificateGenerator() |
| 80 : nullptr); | 84 : nullptr); |
| 81 peer_connection_ = peer_connection_factory_->CreatePeerConnection( | 85 peer_connection_ = peer_connection_factory_->CreatePeerConnection( |
| 82 config, constraints, std::move(port_allocator), std::move(cert_generator), | 86 config, constraints, std::move(port_allocator), std::move(cert_generator), |
| 83 this); | 87 this); |
| 84 | 88 |
| 85 return peer_connection_.get() != NULL; | 89 return peer_connection_.get() != NULL; |
| 86 } | 90 } |
| 87 | 91 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 peer_connection_factory_->CreateVideoSource( | 276 peer_connection_factory_->CreateVideoSource( |
| 273 new webrtc::FakePeriodicVideoCapturer(), &constraints); | 277 new webrtc::FakePeriodicVideoCapturer(), &constraints); |
| 274 std::string videotrack_label = label + kVideoTrackLabelBase; | 278 std::string videotrack_label = label + kVideoTrackLabelBase; |
| 275 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( | 279 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( |
| 276 peer_connection_factory_->CreateVideoTrack(videotrack_label, source)); | 280 peer_connection_factory_->CreateVideoTrack(videotrack_label, source)); |
| 277 | 281 |
| 278 stream->AddTrack(video_track); | 282 stream->AddTrack(video_track); |
| 279 } | 283 } |
| 280 return stream; | 284 return stream; |
| 281 } | 285 } |
| OLD | NEW |