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

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

Issue 2854123003: Build WebRTC with data channel only. (Closed)
Patch Set: More modular apporach. Proof of concept. Need more work. 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 Call* CreateCallImpl(const Call::Config& config);
225
223 bool PeerConnectionInterface::RTCConfiguration::operator==( 226 bool PeerConnectionInterface::RTCConfiguration::operator==(
224 const PeerConnectionInterface::RTCConfiguration& o) const { 227 const PeerConnectionInterface::RTCConfiguration& o) const {
225 // This static_assert prevents us from accidentally breaking operator==. 228 // This static_assert prevents us from accidentally breaking operator==.
226 struct stuff_being_tested_for_equality { 229 struct stuff_being_tested_for_equality {
227 IceTransportsType type; 230 IceTransportsType type;
228 IceServers servers; 231 IceServers servers;
229 BundlePolicy bundle_policy; 232 BundlePolicy bundle_policy;
230 RtcpMuxPolicy rtcp_mux_policy; 233 RtcpMuxPolicy rtcp_mux_policy;
231 TcpCandidatePolicy tcp_candidate_policy; 234 TcpCandidatePolicy tcp_candidate_policy;
232 CandidateNetworkPolicy candidate_network_policy; 235 CandidateNetworkPolicy candidate_network_policy;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 if (!constraints) { 391 if (!constraints) {
389 return true; 392 return true;
390 } 393 }
391 return mandatory_constraints_satisfied == constraints->GetMandatory().size(); 394 return mandatory_constraints_satisfied == constraints->GetMandatory().size();
392 } 395 }
393 396
394 PeerConnection::PeerConnection(PeerConnectionFactory* factory) 397 PeerConnection::PeerConnection(PeerConnectionFactory* factory)
395 : factory_(factory), 398 : factory_(factory),
396 observer_(NULL), 399 observer_(NULL),
397 uma_observer_(NULL), 400 uma_observer_(NULL),
398 event_log_(RtcEventLog::Create()), 401 event_log_(CreateRtcEventLog()),
399 signaling_state_(kStable), 402 signaling_state_(kStable),
400 ice_connection_state_(kIceConnectionNew), 403 ice_connection_state_(kIceConnectionNew),
401 ice_gathering_state_(kIceGatheringNew), 404 ice_gathering_state_(kIceGatheringNew),
402 rtcp_cname_(GenerateRtcpCname()), 405 rtcp_cname_(GenerateRtcpCname()),
403 local_streams_(StreamCollection::Create()), 406 local_streams_(StreamCollection::Create()),
404 remote_streams_(StreamCollection::Create()) {} 407 remote_streams_(StreamCollection::Create()) {}
405 408
406 PeerConnection::~PeerConnection() { 409 PeerConnection::~PeerConnection() {
407 TRACE_EVENT0("webrtc", "PeerConnection::~PeerConnection"); 410 TRACE_EVENT0("webrtc", "PeerConnection::~PeerConnection");
408 RTC_DCHECK(signaling_thread()->IsCurrent()); 411 RTC_DCHECK(signaling_thread()->IsCurrent());
(...skipping 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after
2328 } 2331 }
2329 2332
2330 void PeerConnection::CreateCall_w() { 2333 void PeerConnection::CreateCall_w() {
2331 RTC_DCHECK(!call_); 2334 RTC_DCHECK(!call_);
2332 2335
2333 const int kMinBandwidthBps = 30000; 2336 const int kMinBandwidthBps = 30000;
2334 const int kStartBandwidthBps = 300000; 2337 const int kStartBandwidthBps = 300000;
2335 const int kMaxBandwidthBps = 2000000; 2338 const int kMaxBandwidthBps = 2000000;
2336 2339
2337 webrtc::Call::Config call_config(event_log_.get()); 2340 webrtc::Call::Config call_config(event_log_.get());
2338 call_config.audio_state = 2341 if (factory_->channel_manager()->media_engine()) {
2339 factory_->channel_manager() ->media_engine()->GetAudioState(); 2342 call_config.audio_state =
2343 factory_->channel_manager()->media_engine()->GetAudioState();
2344 } else {
2345 LOG(LS_WARNING) << "The Call::Config.audio_state is unset because the "
2346 "media engine is unset.";
Taylor Brandstetter 2017/05/18 17:57:05 When will this warning be hit? If it's only hit wh
Zhi Huang 2017/05/23 03:40:35 Done.
2347 }
2348
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(CreateCallImpl(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