Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: webrtc/api/test/peerconnectiontestwrapper.cc

Issue 2089553002: Refactoring on QUIC (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Disable quic for review. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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()
84 : nullptr); 80 ? new FakeRTCCertificateGenerator()
81 : nullptr);
85 peer_connection_ = peer_connection_factory_->CreatePeerConnection( 82 peer_connection_ = peer_connection_factory_->CreatePeerConnection(
86 config, constraints, std::move(port_allocator), std::move(cert_generator), 83 config, constraints, std::move(port_allocator), std::move(cert_generator),
87 this); 84 this);
88 85
89 return peer_connection_.get() != NULL; 86 return peer_connection_.get() != NULL;
90 } 87 }
91 88
92 rtc::scoped_refptr<webrtc::DataChannelInterface> 89 rtc::scoped_refptr<webrtc::DataChannelInterface>
93 PeerConnectionTestWrapper::CreateDataChannel( 90 PeerConnectionTestWrapper::CreateDataChannel(
94 const std::string& label, 91 const std::string& label,
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 peer_connection_factory_->CreateVideoSource( 273 peer_connection_factory_->CreateVideoSource(
277 new webrtc::FakePeriodicVideoCapturer(), &constraints); 274 new webrtc::FakePeriodicVideoCapturer(), &constraints);
278 std::string videotrack_label = label + kVideoTrackLabelBase; 275 std::string videotrack_label = label + kVideoTrackLabelBase;
279 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( 276 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track(
280 peer_connection_factory_->CreateVideoTrack(videotrack_label, source)); 277 peer_connection_factory_->CreateVideoTrack(videotrack_label, source));
281 278
282 stream->AddTrack(video_track); 279 stream->AddTrack(video_track);
283 } 280 }
284 return stream; 281 return stream;
285 } 282 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698