OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 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/ortc/rtptransportcontrolleradapter.h" | 11 #include "webrtc/ortc/rtptransportcontrolleradapter.h" |
12 | 12 |
13 #include <algorithm> // For "remove", "find". | 13 #include <algorithm> // For "remove", "find". |
14 #include <set> | 14 #include <set> |
15 #include <sstream> | 15 #include <sstream> |
16 #include <unordered_map> | 16 #include <unordered_map> |
17 #include <utility> // For std::move. | 17 #include <utility> // For std::move. |
18 | 18 |
19 #include "webrtc/api/proxy.h" | 19 #include "webrtc/api/proxy.h" |
20 #include "webrtc/base/checks.h" | 20 #include "webrtc/base/checks.h" |
| 21 #include "webrtc/base/ptr_util.h" |
| 22 #include "webrtc/call/rtp_transport_controller_send.h" |
21 #include "webrtc/media/base/mediaconstants.h" | 23 #include "webrtc/media/base/mediaconstants.h" |
22 #include "webrtc/ortc/ortcrtpreceiveradapter.h" | 24 #include "webrtc/ortc/ortcrtpreceiveradapter.h" |
23 #include "webrtc/ortc/ortcrtpsenderadapter.h" | 25 #include "webrtc/ortc/ortcrtpsenderadapter.h" |
24 #include "webrtc/ortc/rtpparametersconversion.h" | 26 #include "webrtc/ortc/rtpparametersconversion.h" |
25 #include "webrtc/ortc/rtptransportadapter.h" | 27 #include "webrtc/ortc/rtptransportadapter.h" |
26 | 28 |
27 namespace webrtc { | 29 namespace webrtc { |
28 | 30 |
29 // Note: It's assumed that each individual list doesn't have conflicts, since | 31 // Note: It's assumed that each individual list doesn't have conflicts, since |
30 // they should have been detected already by rtpparametersconversion.cc. This | 32 // they should have been detected already by rtpparametersconversion.cc. This |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 // TODO(nisse): Duplicates corresponding method in PeerConnection (used | 615 // TODO(nisse): Duplicates corresponding method in PeerConnection (used |
614 // to be in MediaController). | 616 // to be in MediaController). |
615 void RtpTransportControllerAdapter::Init_w() { | 617 void RtpTransportControllerAdapter::Init_w() { |
616 RTC_DCHECK(worker_thread_->IsCurrent()); | 618 RTC_DCHECK(worker_thread_->IsCurrent()); |
617 RTC_DCHECK(!call_); | 619 RTC_DCHECK(!call_); |
618 | 620 |
619 const int kMinBandwidthBps = 30000; | 621 const int kMinBandwidthBps = 30000; |
620 const int kStartBandwidthBps = 300000; | 622 const int kStartBandwidthBps = 300000; |
621 const int kMaxBandwidthBps = 2000000; | 623 const int kMaxBandwidthBps = 2000000; |
622 | 624 |
| 625 rtp_transport_controller_send_ = rtc::MakeUnique<RtpTransportControllerSend>( |
| 626 Clock::GetRealTimeClock(), event_log_); |
623 webrtc::Call::Config call_config(event_log_); | 627 webrtc::Call::Config call_config(event_log_); |
624 call_config.audio_state = channel_manager_->media_engine()->GetAudioState(); | 628 call_config.audio_state = channel_manager_->media_engine()->GetAudioState(); |
625 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; | 629 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; |
626 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; | 630 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; |
627 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; | 631 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; |
628 | 632 call_config.audio_rtp_transport_send = rtp_transport_controller_send_.get(); |
629 call_.reset(webrtc::Call::Create(call_config)); | 633 call_config.video_rtp_transport_send = rtp_transport_controller_send_.get(); |
| 634 call_config.send_side_cc = rtp_transport_controller_send_->send_side_cc(); |
| 635 call_ = rtc::WrapUnique(webrtc::Call::Create(call_config)); |
630 } | 636 } |
631 | 637 |
632 void RtpTransportControllerAdapter::Close_w() { | 638 void RtpTransportControllerAdapter::Close_w() { |
633 call_.reset(); | 639 call_.reset(); |
634 } | 640 } |
635 | 641 |
636 RTCError RtpTransportControllerAdapter::AttachAudioSender( | 642 RTCError RtpTransportControllerAdapter::AttachAudioSender( |
637 OrtcRtpSenderAdapter* sender, | 643 OrtcRtpSenderAdapter* sender, |
638 RtpTransportInterface* inner_transport) { | 644 RtpTransportInterface* inner_transport) { |
639 if (have_audio_sender_) { | 645 if (have_audio_sender_) { |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 local_description->set_cryptos(cryptos); | 980 local_description->set_cryptos(cryptos); |
975 | 981 |
976 cryptos.clear(); | 982 cryptos.clear(); |
977 cryptos.push_back(*(rtp_transport->GetInternal()->send_key())); | 983 cryptos.push_back(*(rtp_transport->GetInternal()->send_key())); |
978 remote_description->set_cryptos(cryptos); | 984 remote_description->set_cryptos(cryptos); |
979 } | 985 } |
980 return RTCError::OK(); | 986 return RTCError::OK(); |
981 } | 987 } |
982 | 988 |
983 } // namespace webrtc | 989 } // namespace webrtc |
OLD | NEW |