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 |
11 #include "webrtc/pc/peerconnection.h" | 11 #include "webrtc/pc/peerconnection.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <utility> | 14 #include <utility> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/api/jsepicecandidate.h" | 17 #include "webrtc/api/jsepicecandidate.h" |
18 #include "webrtc/api/jsepsessiondescription.h" | 18 #include "webrtc/api/jsepsessiondescription.h" |
19 #include "webrtc/api/mediaconstraintsinterface.h" | 19 #include "webrtc/api/mediaconstraintsinterface.h" |
20 #include "webrtc/api/mediastreamproxy.h" | 20 #include "webrtc/api/mediastreamproxy.h" |
21 #include "webrtc/api/mediastreamtrackproxy.h" | 21 #include "webrtc/api/mediastreamtrackproxy.h" |
22 #include "webrtc/base/bind.h" | 22 #include "webrtc/base/bind.h" |
23 #include "webrtc/base/checks.h" | 23 #include "webrtc/base/checks.h" |
24 #include "webrtc/base/logging.h" | 24 #include "webrtc/base/logging.h" |
| 25 #include "webrtc/base/ptr_util.h" |
25 #include "webrtc/base/stringencode.h" | 26 #include "webrtc/base/stringencode.h" |
26 #include "webrtc/base/stringutils.h" | 27 #include "webrtc/base/stringutils.h" |
27 #include "webrtc/base/trace_event.h" | 28 #include "webrtc/base/trace_event.h" |
28 #include "webrtc/call/call.h" | 29 #include "webrtc/call/call.h" |
| 30 #include "webrtc/call/rtp_transport_controller_send.h" |
29 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 31 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
30 #include "webrtc/media/sctp/sctptransport.h" | 32 #include "webrtc/media/sctp/sctptransport.h" |
31 #include "webrtc/pc/audiotrack.h" | 33 #include "webrtc/pc/audiotrack.h" |
32 #include "webrtc/pc/channelmanager.h" | 34 #include "webrtc/pc/channelmanager.h" |
33 #include "webrtc/pc/dtmfsender.h" | 35 #include "webrtc/pc/dtmfsender.h" |
34 #include "webrtc/pc/mediastream.h" | 36 #include "webrtc/pc/mediastream.h" |
35 #include "webrtc/pc/mediastreamobserver.h" | 37 #include "webrtc/pc/mediastreamobserver.h" |
36 #include "webrtc/pc/remoteaudiosource.h" | 38 #include "webrtc/pc/remoteaudiosource.h" |
37 #include "webrtc/pc/rtpreceiver.h" | 39 #include "webrtc/pc/rtpreceiver.h" |
38 #include "webrtc/pc/rtpsender.h" | 40 #include "webrtc/pc/rtpsender.h" |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 port_allocator_ = std::move(allocator); | 455 port_allocator_ = std::move(allocator); |
454 | 456 |
455 // The port allocator lives on the network thread and should be initialized | 457 // The port allocator lives on the network thread and should be initialized |
456 // there. | 458 // there. |
457 if (!network_thread()->Invoke<bool>( | 459 if (!network_thread()->Invoke<bool>( |
458 RTC_FROM_HERE, rtc::Bind(&PeerConnection::InitializePortAllocator_n, | 460 RTC_FROM_HERE, rtc::Bind(&PeerConnection::InitializePortAllocator_n, |
459 this, configuration))) { | 461 this, configuration))) { |
460 return false; | 462 return false; |
461 } | 463 } |
462 | 464 |
| 465 rtp_transport_controller_send_ = rtc::MakeUnique<RtpTransportControllerSend>( |
| 466 Clock::GetRealTimeClock(), event_log_.get()); |
| 467 |
463 // Call must be constructed on the worker thread. | 468 // Call must be constructed on the worker thread. |
464 factory_->worker_thread()->Invoke<void>( | 469 factory_->worker_thread()->Invoke<void>( |
465 RTC_FROM_HERE, rtc::Bind(&PeerConnection::CreateCall_w, | 470 RTC_FROM_HERE, rtc::Bind(&PeerConnection::CreateCall_w, |
466 this)); | 471 this)); |
467 | 472 |
468 session_.reset(new WebRtcSession( | 473 session_.reset(new WebRtcSession( |
469 call_.get(), factory_->channel_manager(), configuration.media_config, | 474 call_.get(), factory_->channel_manager(), configuration.media_config, |
470 event_log_.get(), | 475 event_log_.get(), |
471 factory_->network_thread(), | 476 factory_->network_thread(), |
472 factory_->worker_thread(), factory_->signaling_thread(), | 477 factory_->worker_thread(), factory_->signaling_thread(), |
(...skipping 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2334 const int kStartBandwidthBps = 300000; | 2339 const int kStartBandwidthBps = 300000; |
2335 const int kMaxBandwidthBps = 2000000; | 2340 const int kMaxBandwidthBps = 2000000; |
2336 | 2341 |
2337 webrtc::Call::Config call_config(event_log_.get()); | 2342 webrtc::Call::Config call_config(event_log_.get()); |
2338 call_config.audio_state = | 2343 call_config.audio_state = |
2339 factory_->channel_manager() ->media_engine()->GetAudioState(); | 2344 factory_->channel_manager() ->media_engine()->GetAudioState(); |
2340 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; | 2345 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; |
2341 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; | 2346 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; |
2342 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; | 2347 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; |
2343 | 2348 |
2344 call_.reset(webrtc::Call::Create(call_config)); | 2349 call_config.send_side_cc = rtp_transport_controller_send_->send_side_cc(); |
| 2350 call_config.audio_rtp_transport_send = rtp_transport_controller_send_.get(); |
| 2351 call_config.video_rtp_transport_send = rtp_transport_controller_send_.get(); |
| 2352 |
| 2353 call_ = rtc::WrapUnique(webrtc::Call::Create(call_config)); |
2345 } | 2354 } |
2346 | 2355 |
2347 } // namespace webrtc | 2356 } // namespace webrtc |
OLD | NEW |