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

Side by Side Diff: webrtc/pc/peerconnection.cc

Issue 2854123003: Build WebRTC with data channel only. (Closed)
Patch Set: Fix the issues. Make it ready for another round of review. Add a test. Created 3 years, 7 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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 if (error) { 213 if (error) {
214 error->set_type(type); 214 error->set_type(type);
215 } 215 }
216 return type == webrtc::RTCErrorType::NONE; 216 return type == webrtc::RTCErrorType::NONE;
217 } 217 }
218 218
219 } // namespace 219 } // namespace
220 220
221 namespace webrtc { 221 namespace webrtc {
222 222
223 std::unique_ptr<RtcEventLog> CreateRtcEventLog();
224
225 Call* CreateCall(const Call::Config& config);
226
223 bool PeerConnectionInterface::RTCConfiguration::operator==( 227 bool PeerConnectionInterface::RTCConfiguration::operator==(
224 const PeerConnectionInterface::RTCConfiguration& o) const { 228 const PeerConnectionInterface::RTCConfiguration& o) const {
225 // This static_assert prevents us from accidentally breaking operator==. 229 // This static_assert prevents us from accidentally breaking operator==.
226 struct stuff_being_tested_for_equality { 230 struct stuff_being_tested_for_equality {
227 IceTransportsType type; 231 IceTransportsType type;
228 IceServers servers; 232 IceServers servers;
229 BundlePolicy bundle_policy; 233 BundlePolicy bundle_policy;
230 RtcpMuxPolicy rtcp_mux_policy; 234 RtcpMuxPolicy rtcp_mux_policy;
231 TcpCandidatePolicy tcp_candidate_policy; 235 TcpCandidatePolicy tcp_candidate_policy;
232 CandidateNetworkPolicy candidate_network_policy; 236 CandidateNetworkPolicy candidate_network_policy;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 if (!constraints) { 392 if (!constraints) {
389 return true; 393 return true;
390 } 394 }
391 return mandatory_constraints_satisfied == constraints->GetMandatory().size(); 395 return mandatory_constraints_satisfied == constraints->GetMandatory().size();
392 } 396 }
393 397
394 PeerConnection::PeerConnection(PeerConnectionFactory* factory) 398 PeerConnection::PeerConnection(PeerConnectionFactory* factory)
395 : factory_(factory), 399 : factory_(factory),
396 observer_(NULL), 400 observer_(NULL),
397 uma_observer_(NULL), 401 uma_observer_(NULL),
398 event_log_(RtcEventLog::Create()), 402 event_log_(CreateRtcEventLog()),
399 signaling_state_(kStable), 403 signaling_state_(kStable),
400 ice_connection_state_(kIceConnectionNew), 404 ice_connection_state_(kIceConnectionNew),
401 ice_gathering_state_(kIceGatheringNew), 405 ice_gathering_state_(kIceGatheringNew),
402 rtcp_cname_(GenerateRtcpCname()), 406 rtcp_cname_(GenerateRtcpCname()),
403 local_streams_(StreamCollection::Create()), 407 local_streams_(StreamCollection::Create()),
404 remote_streams_(StreamCollection::Create()) {} 408 remote_streams_(StreamCollection::Create()) {}
405 409
406 PeerConnection::~PeerConnection() { 410 PeerConnection::~PeerConnection() {
407 TRACE_EVENT0("webrtc", "PeerConnection::~PeerConnection"); 411 TRACE_EVENT0("webrtc", "PeerConnection::~PeerConnection");
408 RTC_DCHECK(signaling_thread()->IsCurrent()); 412 RTC_DCHECK(signaling_thread()->IsCurrent());
(...skipping 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after
2328 } 2332 }
2329 2333
2330 void PeerConnection::CreateCall_w() { 2334 void PeerConnection::CreateCall_w() {
2331 RTC_DCHECK(!call_); 2335 RTC_DCHECK(!call_);
2332 2336
2333 const int kMinBandwidthBps = 30000; 2337 const int kMinBandwidthBps = 30000;
2334 const int kStartBandwidthBps = 300000; 2338 const int kStartBandwidthBps = 300000;
2335 const int kMaxBandwidthBps = 2000000; 2339 const int kMaxBandwidthBps = 2000000;
2336 2340
2337 webrtc::Call::Config call_config(event_log_.get()); 2341 webrtc::Call::Config call_config(event_log_.get());
2342 if (!factory_->channel_manager()->media_engine()) {
2343 LOG(LS_WARNING)
2344 << "Failed to create the Call because the media engine is unset.";
2345 return;
2346 }
2338 call_config.audio_state = 2347 call_config.audio_state =
2339 factory_->channel_manager() ->media_engine()->GetAudioState(); 2348 factory_->channel_manager()->media_engine()->GetAudioState();
2340 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; 2349 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps;
2341 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; 2350 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps;
2342 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; 2351 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps;
2343 2352 call_.reset(CreateCall(call_config));
2344 call_.reset(webrtc::Call::Create(call_config));
2345 } 2353 }
2346 2354
2347 } // namespace webrtc 2355 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698