blob: 78e3fc06fb7861c8059f6130bcc13fabb33edaec [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
Niels Möller2579f0c2019-08-19 09:58:17 +0200132RTCError PeerConnectionInterface::SetConfiguration(
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200133 const PeerConnectionInterface::RTCConfiguration& config) {
Niels Möller2579f0c2019-08-19 09:58:17 +0200134 return RTCError();
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200135}
136
137bool PeerConnectionInterface::RemoveIceCandidates(
138 const std::vector<cricket::Candidate>& candidates) {
139 return false;
140}
141
142RTCError PeerConnectionInterface::SetBitrate(const BitrateSettings& bitrate) {
143 BitrateParameters bitrate_parameters;
144 bitrate_parameters.min_bitrate_bps = bitrate.min_bitrate_bps;
145 bitrate_parameters.current_bitrate_bps = bitrate.start_bitrate_bps;
146 bitrate_parameters.max_bitrate_bps = bitrate.max_bitrate_bps;
147 return SetBitrate(bitrate_parameters);
148}
149
150RTCError PeerConnectionInterface::SetBitrate(
151 const BitrateParameters& bitrate_parameters) {
152 BitrateSettings bitrate;
153 bitrate.min_bitrate_bps = bitrate_parameters.min_bitrate_bps;
154 bitrate.start_bitrate_bps = bitrate_parameters.current_bitrate_bps;
155 bitrate.max_bitrate_bps = bitrate_parameters.max_bitrate_bps;
156 return SetBitrate(bitrate);
157}
158
Jonas Olsson12046902018-12-06 11:25:14 +0100159PeerConnectionInterface::IceConnectionState
160PeerConnectionInterface::standardized_ice_connection_state() {
161 return PeerConnectionInterface::IceConnectionState::kIceConnectionFailed;
162}
163
Jonas Olsson635474e2018-10-18 15:58:17 +0200164PeerConnectionInterface::PeerConnectionState
165PeerConnectionInterface::peer_connection_state() {
Jonas Olsson12046902018-12-06 11:25:14 +0100166 return PeerConnectionInterface::PeerConnectionState::kFailed;
Jonas Olsson635474e2018-10-18 15:58:17 +0200167}
168
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200169bool PeerConnectionInterface::StartRtcEventLog(
170 std::unique_ptr<RtcEventLogOutput> output,
171 int64_t output_period_ms) {
172 return false;
173}
174
Niels Möllerf00ca1a2019-05-10 11:33:12 +0200175bool PeerConnectionInterface::StartRtcEventLog(
176 std::unique_ptr<RtcEventLogOutput> output) {
177 return false;
178}
179
Harald Alvestrandad88c882018-11-28 16:47:46 +0100180rtc::scoped_refptr<DtlsTransportInterface>
181PeerConnectionInterface::LookupDtlsTransportByMid(const std::string& mid) {
Harald Alvestrand41390472018-12-03 18:45:19 +0100182 RTC_NOTREACHED();
Harald Alvestrandad88c882018-11-28 16:47:46 +0100183 return nullptr;
184}
185
Harald Alvestrandc85328f2019-02-28 07:51:00 +0100186rtc::scoped_refptr<SctpTransportInterface>
187PeerConnectionInterface::GetSctpTransport() const {
188 RTC_NOTREACHED();
189 return nullptr;
190}
191
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200192PeerConnectionInterface::BitrateParameters::BitrateParameters() = default;
193
194PeerConnectionInterface::BitrateParameters::~BitrateParameters() = default;
195
196PeerConnectionDependencies::PeerConnectionDependencies(
197 PeerConnectionObserver* observer_in)
198 : observer(observer_in) {}
199
200PeerConnectionDependencies::PeerConnectionDependencies(
201 PeerConnectionDependencies&&) = default;
202
203PeerConnectionDependencies::~PeerConnectionDependencies() = default;
204
205PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
206 default;
207
208PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
209 PeerConnectionFactoryDependencies&&) = default;
210
211PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
212 default;
213
214rtc::scoped_refptr<PeerConnectionInterface>
215PeerConnectionFactoryInterface::CreatePeerConnection(
216 const PeerConnectionInterface::RTCConfiguration& configuration,
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200217 std::unique_ptr<cricket::PortAllocator> allocator,
218 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
219 PeerConnectionObserver* observer) {
220 return nullptr;
221}
222
223rtc::scoped_refptr<PeerConnectionInterface>
224PeerConnectionFactoryInterface::CreatePeerConnection(
225 const PeerConnectionInterface::RTCConfiguration& configuration,
226 PeerConnectionDependencies dependencies) {
227 return nullptr;
228}
229
230RtpCapabilities PeerConnectionFactoryInterface::GetRtpSenderCapabilities(
231 cricket::MediaType kind) const {
232 return {};
233}
234
235RtpCapabilities PeerConnectionFactoryInterface::GetRtpReceiverCapabilities(
236 cricket::MediaType kind) const {
237 return {};
238}
239
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200240} // namespace webrtc