Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 391 return mandatory_constraints_satisfied == constraints->GetMandatory().size(); | 391 return mandatory_constraints_satisfied == constraints->GetMandatory().size(); |
| 392 } | 392 } |
| 393 | 393 |
| 394 PeerConnection::PeerConnection(PeerConnectionFactory* factory) | 394 PeerConnection::PeerConnection(PeerConnectionFactory* factory) |
| 395 : factory_(factory), | 395 : factory_(factory), |
| 396 observer_(NULL), | 396 observer_(NULL), |
| 397 uma_observer_(NULL), | 397 uma_observer_(NULL), |
| 398 signaling_state_(kStable), | 398 signaling_state_(kStable), |
| 399 ice_connection_state_(kIceConnectionNew), | 399 ice_connection_state_(kIceConnectionNew), |
| 400 ice_gathering_state_(kIceGatheringNew), | 400 ice_gathering_state_(kIceGatheringNew), |
| 401 #if defined(HAVE_WEBRTC_VOICE) && defined(HAVE_WEBRTC_VIDEO) | |
|
Taylor Brandstetter
2017/05/11 04:43:11
||?
Zhi Huang
2017/05/12 20:05:33
Done.
| |
| 401 event_log_(RtcEventLog::Create()), | 402 event_log_(RtcEventLog::Create()), |
| 403 #else | |
| 404 event_log_(std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl())), | |
| 405 #endif | |
| 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()) { |
| 409 } | |
| 405 | 410 |
| 406 PeerConnection::~PeerConnection() { | 411 PeerConnection::~PeerConnection() { |
| 407 TRACE_EVENT0("webrtc", "PeerConnection::~PeerConnection"); | 412 TRACE_EVENT0("webrtc", "PeerConnection::~PeerConnection"); |
| 408 RTC_DCHECK(signaling_thread()->IsCurrent()); | 413 RTC_DCHECK(signaling_thread()->IsCurrent()); |
| 409 // Need to detach RTP senders/receivers from WebRtcSession, | 414 // Need to detach RTP senders/receivers from WebRtcSession, |
| 410 // since it's about to be destroyed. | 415 // since it's about to be destroyed. |
| 411 for (const auto& sender : senders_) { | 416 for (const auto& sender : senders_) { |
| 412 sender->internal()->Stop(); | 417 sender->internal()->Stop(); |
| 413 } | 418 } |
| 414 for (const auto& receiver : receivers_) { | 419 for (const auto& receiver : receivers_) { |
| (...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2319 return event_log_->StartLogging(file, max_size_bytes); | 2324 return event_log_->StartLogging(file, max_size_bytes); |
| 2320 } | 2325 } |
| 2321 | 2326 |
| 2322 void PeerConnection::StopRtcEventLog_w() { | 2327 void PeerConnection::StopRtcEventLog_w() { |
| 2323 if (event_log_) { | 2328 if (event_log_) { |
| 2324 event_log_->StopLogging(); | 2329 event_log_->StopLogging(); |
| 2325 } | 2330 } |
| 2326 } | 2331 } |
| 2327 | 2332 |
| 2328 void PeerConnection::CreateCall_w() { | 2333 void PeerConnection::CreateCall_w() { |
| 2334 #if defined(HAVE_WEBRTC_VOICE) && defined(HAVE_WEBRTC_VIDEO) | |
|
Taylor Brandstetter
2017/05/11 04:43:11
||?
Zhi Huang
2017/05/12 20:05:33
Done.
| |
| 2329 RTC_DCHECK(!call_); | 2335 RTC_DCHECK(!call_); |
| 2330 | 2336 |
| 2331 const int kMinBandwidthBps = 30000; | 2337 const int kMinBandwidthBps = 30000; |
| 2332 const int kStartBandwidthBps = 300000; | 2338 const int kStartBandwidthBps = 300000; |
| 2333 const int kMaxBandwidthBps = 2000000; | 2339 const int kMaxBandwidthBps = 2000000; |
| 2334 | 2340 |
| 2335 webrtc::Call::Config call_config(event_log_.get()); | 2341 webrtc::Call::Config call_config(event_log_.get()); |
| 2336 call_config.audio_state = | 2342 call_config.audio_state = |
| 2337 factory_->channel_manager() ->media_engine()->GetAudioState(); | 2343 factory_->channel_manager() ->media_engine()->GetAudioState(); |
| 2338 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; | 2344 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; |
| 2339 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; | 2345 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; |
| 2340 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; | 2346 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; |
| 2341 | 2347 |
| 2342 call_.reset(webrtc::Call::Create(call_config)); | 2348 call_.reset(webrtc::Call::Create(call_config)); |
| 2349 #endif | |
| 2343 } | 2350 } |
| 2344 | 2351 |
| 2345 } // namespace webrtc | 2352 } // namespace webrtc |
| OLD | NEW |