blob: 6512457945fdd7679fae9eb0a72af9ad061bbe73 [file] [log] [blame]
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +02001/*
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 Anton10542f22019-01-11 09:11:00 -080011#include "api/peer_connection_interface.h"
Jonas Olssona4d87372019-07-05 19:08:33 +020012
Steve Anton10542f22019-01-11 09:11:00 -080013#include "api/dtls_transport_interface.h"
Harald Alvestrandc85328f2019-02-28 07:51:00 +010014#include "api/sctp_transport_interface.h"
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +020015
16namespace webrtc {
17
18PeerConnectionInterface::IceServer::IceServer() = default;
19PeerConnectionInterface::IceServer::IceServer(const IceServer& rhs) = default;
20PeerConnectionInterface::IceServer::~IceServer() = default;
21
22PeerConnectionInterface::RTCConfiguration::RTCConfiguration() = default;
23
24PeerConnectionInterface::RTCConfiguration::RTCConfiguration(
25 const RTCConfiguration& rhs) = default;
26
27PeerConnectionInterface::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
43PeerConnectionInterface::RTCConfiguration::~RTCConfiguration() = default;
44
45RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>
46PeerConnectionInterface::AddTrack(
47 rtc::scoped_refptr<MediaStreamTrackInterface> track,
48 const std::vector<std::string>& stream_ids) {
49 return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented");
50}
51
Steve Anton24db5732018-07-23 10:27:33 -070052bool PeerConnectionInterface::RemoveTrack(RtpSenderInterface* sender) {
53 return RemoveTrackNew(sender).ok();
54}
55
56RTCError PeerConnectionInterface::RemoveTrackNew(
57 rtc::scoped_refptr<RtpSenderInterface> sender) {
58 return RTCError(RemoveTrack(sender) ? RTCErrorType::NONE
59 : RTCErrorType::INTERNAL_ERROR);
60}
61
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +020062RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
63PeerConnectionInterface::AddTransceiver(
64 rtc::scoped_refptr<MediaStreamTrackInterface> track) {
65 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
66}
67
68RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
69PeerConnectionInterface::AddTransceiver(
70 rtc::scoped_refptr<MediaStreamTrackInterface> track,
71 const RtpTransceiverInit& init) {
72 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
73}
74
75RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
76PeerConnectionInterface::AddTransceiver(cricket::MediaType media_type) {
77 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
78}
79
80RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
81PeerConnectionInterface::AddTransceiver(cricket::MediaType media_type,
82 const RtpTransceiverInit& init) {
83 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
84}
85
86rtc::scoped_refptr<RtpSenderInterface> PeerConnectionInterface::CreateSender(
87 const std::string& kind,
88 const std::string& stream_id) {
89 return rtc::scoped_refptr<RtpSenderInterface>();
90}
91
92std::vector<rtc::scoped_refptr<RtpSenderInterface>>
93PeerConnectionInterface::GetSenders() const {
94 return std::vector<rtc::scoped_refptr<RtpSenderInterface>>();
95}
96
97std::vector<rtc::scoped_refptr<RtpReceiverInterface>>
98PeerConnectionInterface::GetReceivers() const {
99 return std::vector<rtc::scoped_refptr<RtpReceiverInterface>>();
100}
101
102std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>
103PeerConnectionInterface::GetTransceivers() const {
Joachim Bauch02a454f2018-07-27 13:01:21 +0200104 return std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>();
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200105}
106
107const SessionDescriptionInterface*
108PeerConnectionInterface::current_local_description() const {
109 return nullptr;
110}
111
112const SessionDescriptionInterface*
113PeerConnectionInterface::current_remote_description() const {
114 return nullptr;
115}
116
117const SessionDescriptionInterface*
118PeerConnectionInterface::pending_local_description() const {
119 return nullptr;
120}
121
122const SessionDescriptionInterface*
123PeerConnectionInterface::pending_remote_description() const {
124 return nullptr;
125}
126
127PeerConnectionInterface::RTCConfiguration
128PeerConnectionInterface::GetConfiguration() {
129 return PeerConnectionInterface::RTCConfiguration();
130}
131
132bool PeerConnectionInterface::SetConfiguration(
133 const PeerConnectionInterface::RTCConfiguration& config,
134 RTCError* error) {
135 return false;
136}
137
138bool PeerConnectionInterface::SetConfiguration(
139 const PeerConnectionInterface::RTCConfiguration& config) {
140 return false;
141}
142
143bool PeerConnectionInterface::RemoveIceCandidates(
144 const std::vector<cricket::Candidate>& candidates) {
145 return false;
146}
147
148RTCError PeerConnectionInterface::SetBitrate(const BitrateSettings& bitrate) {
149 BitrateParameters bitrate_parameters;
150 bitrate_parameters.min_bitrate_bps = bitrate.min_bitrate_bps;
151 bitrate_parameters.current_bitrate_bps = bitrate.start_bitrate_bps;
152 bitrate_parameters.max_bitrate_bps = bitrate.max_bitrate_bps;
153 return SetBitrate(bitrate_parameters);
154}
155
156RTCError PeerConnectionInterface::SetBitrate(
157 const BitrateParameters& bitrate_parameters) {
158 BitrateSettings bitrate;
159 bitrate.min_bitrate_bps = bitrate_parameters.min_bitrate_bps;
160 bitrate.start_bitrate_bps = bitrate_parameters.current_bitrate_bps;
161 bitrate.max_bitrate_bps = bitrate_parameters.max_bitrate_bps;
162 return SetBitrate(bitrate);
163}
164
Jonas Olsson12046902018-12-06 11:25:14 +0100165PeerConnectionInterface::IceConnectionState
166PeerConnectionInterface::standardized_ice_connection_state() {
167 return PeerConnectionInterface::IceConnectionState::kIceConnectionFailed;
168}
169
Jonas Olsson635474e2018-10-18 15:58:17 +0200170PeerConnectionInterface::PeerConnectionState
171PeerConnectionInterface::peer_connection_state() {
Jonas Olsson12046902018-12-06 11:25:14 +0100172 return PeerConnectionInterface::PeerConnectionState::kFailed;
Jonas Olsson635474e2018-10-18 15:58:17 +0200173}
174
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200175bool PeerConnectionInterface::StartRtcEventLog(
176 std::unique_ptr<RtcEventLogOutput> output,
177 int64_t output_period_ms) {
178 return false;
179}
180
Niels Möllerf00ca1a2019-05-10 11:33:12 +0200181bool PeerConnectionInterface::StartRtcEventLog(
182 std::unique_ptr<RtcEventLogOutput> output) {
183 return false;
184}
185
Harald Alvestrandad88c882018-11-28 16:47:46 +0100186rtc::scoped_refptr<DtlsTransportInterface>
187PeerConnectionInterface::LookupDtlsTransportByMid(const std::string& mid) {
Harald Alvestrand41390472018-12-03 18:45:19 +0100188 RTC_NOTREACHED();
Harald Alvestrandad88c882018-11-28 16:47:46 +0100189 return nullptr;
190}
191
Harald Alvestrandc85328f2019-02-28 07:51:00 +0100192rtc::scoped_refptr<SctpTransportInterface>
193PeerConnectionInterface::GetSctpTransport() const {
194 RTC_NOTREACHED();
195 return nullptr;
196}
197
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200198PeerConnectionInterface::BitrateParameters::BitrateParameters() = default;
199
200PeerConnectionInterface::BitrateParameters::~BitrateParameters() = default;
201
202PeerConnectionDependencies::PeerConnectionDependencies(
203 PeerConnectionObserver* observer_in)
204 : observer(observer_in) {}
205
206PeerConnectionDependencies::PeerConnectionDependencies(
207 PeerConnectionDependencies&&) = default;
208
209PeerConnectionDependencies::~PeerConnectionDependencies() = default;
210
211PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
212 default;
213
214PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
215 PeerConnectionFactoryDependencies&&) = default;
216
217PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
218 default;
219
220rtc::scoped_refptr<PeerConnectionInterface>
221PeerConnectionFactoryInterface::CreatePeerConnection(
222 const PeerConnectionInterface::RTCConfiguration& configuration,
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200223 std::unique_ptr<cricket::PortAllocator> allocator,
224 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
225 PeerConnectionObserver* observer) {
226 return nullptr;
227}
228
229rtc::scoped_refptr<PeerConnectionInterface>
230PeerConnectionFactoryInterface::CreatePeerConnection(
231 const PeerConnectionInterface::RTCConfiguration& configuration,
232 PeerConnectionDependencies dependencies) {
233 return nullptr;
234}
235
236RtpCapabilities PeerConnectionFactoryInterface::GetRtpSenderCapabilities(
237 cricket::MediaType kind) const {
238 return {};
239}
240
241RtpCapabilities PeerConnectionFactoryInterface::GetRtpReceiverCapabilities(
242 cricket::MediaType kind) const {
243 return {};
244}
245
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200246} // namespace webrtc