Mirko Bonadei | 79eb4dd | 2018-07-19 10:39:30 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 11 | #include "api/peer_connection_interface.h" |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 12 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 13 | #include "api/dtls_transport_interface.h" |
Harald Alvestrand | c85328f | 2019-02-28 07:51:00 +0100 | [diff] [blame] | 14 | #include "api/sctp_transport_interface.h" |
Mirko Bonadei | 79eb4dd | 2018-07-19 10:39:30 +0200 | [diff] [blame] | 15 | |
| 16 | namespace webrtc { |
| 17 | |
| 18 | PeerConnectionInterface::IceServer::IceServer() = default; |
| 19 | PeerConnectionInterface::IceServer::IceServer(const IceServer& rhs) = default; |
| 20 | PeerConnectionInterface::IceServer::~IceServer() = default; |
| 21 | |
| 22 | PeerConnectionInterface::RTCConfiguration::RTCConfiguration() = default; |
| 23 | |
| 24 | PeerConnectionInterface::RTCConfiguration::RTCConfiguration( |
| 25 | const RTCConfiguration& rhs) = default; |
| 26 | |
| 27 | PeerConnectionInterface::RTCConfiguration::RTCConfiguration( |
| 28 | RTCConfigurationType type) { |
| 29 | if (type == RTCConfigurationType::kAggressive) { |
| 30 | // These parameters are also defined in Java and IOS configurations, |
| 31 | // so their values may be overwritten by the Java or IOS configuration. |
| 32 | bundle_policy = kBundlePolicyMaxBundle; |
| 33 | rtcp_mux_policy = kRtcpMuxPolicyRequire; |
| 34 | ice_connection_receiving_timeout = kAggressiveIceConnectionReceivingTimeout; |
| 35 | |
| 36 | // These parameters are not defined in Java or IOS configuration, |
| 37 | // so their values will not be overwritten. |
| 38 | enable_ice_renomination = true; |
| 39 | redetermine_role_on_ice_restart = false; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | PeerConnectionInterface::RTCConfiguration::~RTCConfiguration() = default; |
| 44 | |
Steve Anton | 24db573 | 2018-07-23 10:27:33 -0700 | [diff] [blame] | 45 | RTCError PeerConnectionInterface::RemoveTrackNew( |
| 46 | rtc::scoped_refptr<RtpSenderInterface> sender) { |
| 47 | return RTCError(RemoveTrack(sender) ? RTCErrorType::NONE |
| 48 | : RTCErrorType::INTERNAL_ERROR); |
| 49 | } |
| 50 | |
Niels Möller | 2579f0c | 2019-08-19 09:58:17 +0200 | [diff] [blame] | 51 | RTCError PeerConnectionInterface::SetConfiguration( |
Mirko Bonadei | 79eb4dd | 2018-07-19 10:39:30 +0200 | [diff] [blame] | 52 | const PeerConnectionInterface::RTCConfiguration& config) { |
Niels Möller | 2579f0c | 2019-08-19 09:58:17 +0200 | [diff] [blame] | 53 | return RTCError(); |
Mirko Bonadei | 79eb4dd | 2018-07-19 10:39:30 +0200 | [diff] [blame] | 54 | } |
| 55 | |
Mirko Bonadei | 79eb4dd | 2018-07-19 10:39:30 +0200 | [diff] [blame] | 56 | RTCError PeerConnectionInterface::SetBitrate(const BitrateSettings& bitrate) { |
| 57 | BitrateParameters bitrate_parameters; |
| 58 | bitrate_parameters.min_bitrate_bps = bitrate.min_bitrate_bps; |
| 59 | bitrate_parameters.current_bitrate_bps = bitrate.start_bitrate_bps; |
| 60 | bitrate_parameters.max_bitrate_bps = bitrate.max_bitrate_bps; |
| 61 | return SetBitrate(bitrate_parameters); |
| 62 | } |
| 63 | |
| 64 | RTCError PeerConnectionInterface::SetBitrate( |
| 65 | const BitrateParameters& bitrate_parameters) { |
| 66 | BitrateSettings bitrate; |
| 67 | bitrate.min_bitrate_bps = bitrate_parameters.min_bitrate_bps; |
| 68 | bitrate.start_bitrate_bps = bitrate_parameters.current_bitrate_bps; |
| 69 | bitrate.max_bitrate_bps = bitrate_parameters.max_bitrate_bps; |
| 70 | return SetBitrate(bitrate); |
| 71 | } |
| 72 | |
Mirko Bonadei | 79eb4dd | 2018-07-19 10:39:30 +0200 | [diff] [blame] | 73 | PeerConnectionInterface::BitrateParameters::BitrateParameters() = default; |
| 74 | |
| 75 | PeerConnectionInterface::BitrateParameters::~BitrateParameters() = default; |
| 76 | |
| 77 | PeerConnectionDependencies::PeerConnectionDependencies( |
| 78 | PeerConnectionObserver* observer_in) |
| 79 | : observer(observer_in) {} |
| 80 | |
| 81 | PeerConnectionDependencies::PeerConnectionDependencies( |
| 82 | PeerConnectionDependencies&&) = default; |
| 83 | |
| 84 | PeerConnectionDependencies::~PeerConnectionDependencies() = default; |
| 85 | |
| 86 | PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() = |
| 87 | default; |
| 88 | |
| 89 | PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies( |
| 90 | PeerConnectionFactoryDependencies&&) = default; |
| 91 | |
| 92 | PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() = |
| 93 | default; |
| 94 | |
| 95 | rtc::scoped_refptr<PeerConnectionInterface> |
| 96 | PeerConnectionFactoryInterface::CreatePeerConnection( |
| 97 | const PeerConnectionInterface::RTCConfiguration& configuration, |
Mirko Bonadei | 79eb4dd | 2018-07-19 10:39:30 +0200 | [diff] [blame] | 98 | std::unique_ptr<cricket::PortAllocator> allocator, |
| 99 | std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, |
| 100 | PeerConnectionObserver* observer) { |
| 101 | return nullptr; |
| 102 | } |
| 103 | |
| 104 | rtc::scoped_refptr<PeerConnectionInterface> |
| 105 | PeerConnectionFactoryInterface::CreatePeerConnection( |
| 106 | const PeerConnectionInterface::RTCConfiguration& configuration, |
| 107 | PeerConnectionDependencies dependencies) { |
| 108 | return nullptr; |
| 109 | } |
| 110 | |
| 111 | RtpCapabilities PeerConnectionFactoryInterface::GetRtpSenderCapabilities( |
| 112 | cricket::MediaType kind) const { |
| 113 | return {}; |
| 114 | } |
| 115 | |
| 116 | RtpCapabilities PeerConnectionFactoryInterface::GetRtpReceiverCapabilities( |
| 117 | cricket::MediaType kind) const { |
| 118 | return {}; |
| 119 | } |
| 120 | |
Mirko Bonadei | 79eb4dd | 2018-07-19 10:39:30 +0200 | [diff] [blame] | 121 | } // namespace webrtc |