blob: 588a021dc718bd0db4878434b53497324d3f3518 [file] [log] [blame]
Mirko Bonadei79eb4dd2018-07-19 08:39:301/*
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 17:11:0011#include "api/peer_connection_interface.h"
12#include "api/dtls_transport_interface.h"
Harald Alvestrandc85328f2019-02-28 06:51:0013#include "api/sctp_transport_interface.h"
Mirko Bonadei79eb4dd2018-07-19 08:39:3014
15namespace webrtc {
16
17PeerConnectionInterface::IceServer::IceServer() = default;
18PeerConnectionInterface::IceServer::IceServer(const IceServer& rhs) = default;
19PeerConnectionInterface::IceServer::~IceServer() = default;
20
21PeerConnectionInterface::RTCConfiguration::RTCConfiguration() = default;
22
23PeerConnectionInterface::RTCConfiguration::RTCConfiguration(
24 const RTCConfiguration& rhs) = default;
25
26PeerConnectionInterface::RTCConfiguration::RTCConfiguration(
27 RTCConfigurationType type) {
28 if (type == RTCConfigurationType::kAggressive) {
29 // These parameters are also defined in Java and IOS configurations,
30 // so their values may be overwritten by the Java or IOS configuration.
31 bundle_policy = kBundlePolicyMaxBundle;
32 rtcp_mux_policy = kRtcpMuxPolicyRequire;
33 ice_connection_receiving_timeout = kAggressiveIceConnectionReceivingTimeout;
34
35 // These parameters are not defined in Java or IOS configuration,
36 // so their values will not be overwritten.
37 enable_ice_renomination = true;
38 redetermine_role_on_ice_restart = false;
39 }
40}
41
42PeerConnectionInterface::RTCConfiguration::~RTCConfiguration() = default;
43
44RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>
45PeerConnectionInterface::AddTrack(
46 rtc::scoped_refptr<MediaStreamTrackInterface> track,
47 const std::vector<std::string>& stream_ids) {
48 return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented");
49}
50
Steve Anton24db5732018-07-23 17:27:3351bool PeerConnectionInterface::RemoveTrack(RtpSenderInterface* sender) {
52 return RemoveTrackNew(sender).ok();
53}
54
55RTCError PeerConnectionInterface::RemoveTrackNew(
56 rtc::scoped_refptr<RtpSenderInterface> sender) {
57 return RTCError(RemoveTrack(sender) ? RTCErrorType::NONE
58 : RTCErrorType::INTERNAL_ERROR);
59}
60
Mirko Bonadei79eb4dd2018-07-19 08:39:3061RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
62PeerConnectionInterface::AddTransceiver(
63 rtc::scoped_refptr<MediaStreamTrackInterface> track) {
64 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
65}
66
67RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
68PeerConnectionInterface::AddTransceiver(
69 rtc::scoped_refptr<MediaStreamTrackInterface> track,
70 const RtpTransceiverInit& init) {
71 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
72}
73
74RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
75PeerConnectionInterface::AddTransceiver(cricket::MediaType media_type) {
76 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
77}
78
79RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
80PeerConnectionInterface::AddTransceiver(cricket::MediaType media_type,
81 const RtpTransceiverInit& init) {
82 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
83}
84
85rtc::scoped_refptr<RtpSenderInterface> PeerConnectionInterface::CreateSender(
86 const std::string& kind,
87 const std::string& stream_id) {
88 return rtc::scoped_refptr<RtpSenderInterface>();
89}
90
91std::vector<rtc::scoped_refptr<RtpSenderInterface>>
92PeerConnectionInterface::GetSenders() const {
93 return std::vector<rtc::scoped_refptr<RtpSenderInterface>>();
94}
95
96std::vector<rtc::scoped_refptr<RtpReceiverInterface>>
97PeerConnectionInterface::GetReceivers() const {
98 return std::vector<rtc::scoped_refptr<RtpReceiverInterface>>();
99}
100
101std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>
102PeerConnectionInterface::GetTransceivers() const {
Joachim Bauch02a454f2018-07-27 11:01:21103 return std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>();
Mirko Bonadei79eb4dd2018-07-19 08:39:30104}
105
106const SessionDescriptionInterface*
107PeerConnectionInterface::current_local_description() const {
108 return nullptr;
109}
110
111const SessionDescriptionInterface*
112PeerConnectionInterface::current_remote_description() const {
113 return nullptr;
114}
115
116const SessionDescriptionInterface*
117PeerConnectionInterface::pending_local_description() const {
118 return nullptr;
119}
120
121const SessionDescriptionInterface*
122PeerConnectionInterface::pending_remote_description() const {
123 return nullptr;
124}
125
126PeerConnectionInterface::RTCConfiguration
127PeerConnectionInterface::GetConfiguration() {
128 return PeerConnectionInterface::RTCConfiguration();
129}
130
131bool PeerConnectionInterface::SetConfiguration(
132 const PeerConnectionInterface::RTCConfiguration& config,
133 RTCError* error) {
134 return false;
135}
136
137bool PeerConnectionInterface::SetConfiguration(
138 const PeerConnectionInterface::RTCConfiguration& config) {
139 return false;
140}
141
142bool PeerConnectionInterface::RemoveIceCandidates(
143 const std::vector<cricket::Candidate>& candidates) {
144 return false;
145}
146
147RTCError PeerConnectionInterface::SetBitrate(const BitrateSettings& bitrate) {
148 BitrateParameters bitrate_parameters;
149 bitrate_parameters.min_bitrate_bps = bitrate.min_bitrate_bps;
150 bitrate_parameters.current_bitrate_bps = bitrate.start_bitrate_bps;
151 bitrate_parameters.max_bitrate_bps = bitrate.max_bitrate_bps;
152 return SetBitrate(bitrate_parameters);
153}
154
155RTCError PeerConnectionInterface::SetBitrate(
156 const BitrateParameters& bitrate_parameters) {
157 BitrateSettings bitrate;
158 bitrate.min_bitrate_bps = bitrate_parameters.min_bitrate_bps;
159 bitrate.start_bitrate_bps = bitrate_parameters.current_bitrate_bps;
160 bitrate.max_bitrate_bps = bitrate_parameters.max_bitrate_bps;
161 return SetBitrate(bitrate);
162}
163
Jonas Olsson12046902018-12-06 10:25:14164PeerConnectionInterface::IceConnectionState
165PeerConnectionInterface::standardized_ice_connection_state() {
166 return PeerConnectionInterface::IceConnectionState::kIceConnectionFailed;
167}
168
Jonas Olsson635474e2018-10-18 13:58:17169PeerConnectionInterface::PeerConnectionState
170PeerConnectionInterface::peer_connection_state() {
Jonas Olsson12046902018-12-06 10:25:14171 return PeerConnectionInterface::PeerConnectionState::kFailed;
Jonas Olsson635474e2018-10-18 13:58:17172}
173
Mirko Bonadei79eb4dd2018-07-19 08:39:30174bool PeerConnectionInterface::StartRtcEventLog(
175 std::unique_ptr<RtcEventLogOutput> output,
176 int64_t output_period_ms) {
177 return false;
178}
179
Niels Möllerf00ca1a2019-05-10 09:33:12180bool PeerConnectionInterface::StartRtcEventLog(
181 std::unique_ptr<RtcEventLogOutput> output) {
182 return false;
183}
184
Harald Alvestrandad88c882018-11-28 15:47:46185rtc::scoped_refptr<DtlsTransportInterface>
186PeerConnectionInterface::LookupDtlsTransportByMid(const std::string& mid) {
Harald Alvestrand41390472018-12-03 17:45:19187 RTC_NOTREACHED();
Harald Alvestrandad88c882018-11-28 15:47:46188 return nullptr;
189}
190
Harald Alvestrandc85328f2019-02-28 06:51:00191rtc::scoped_refptr<SctpTransportInterface>
192PeerConnectionInterface::GetSctpTransport() const {
193 RTC_NOTREACHED();
194 return nullptr;
195}
196
Mirko Bonadei79eb4dd2018-07-19 08:39:30197PeerConnectionInterface::BitrateParameters::BitrateParameters() = default;
198
199PeerConnectionInterface::BitrateParameters::~BitrateParameters() = default;
200
201PeerConnectionDependencies::PeerConnectionDependencies(
202 PeerConnectionObserver* observer_in)
203 : observer(observer_in) {}
204
205PeerConnectionDependencies::PeerConnectionDependencies(
206 PeerConnectionDependencies&&) = default;
207
208PeerConnectionDependencies::~PeerConnectionDependencies() = default;
209
210PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
211 default;
212
213PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
214 PeerConnectionFactoryDependencies&&) = default;
215
216PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
217 default;
218
219rtc::scoped_refptr<PeerConnectionInterface>
220PeerConnectionFactoryInterface::CreatePeerConnection(
221 const PeerConnectionInterface::RTCConfiguration& configuration,
Mirko Bonadei79eb4dd2018-07-19 08:39:30222 std::unique_ptr<cricket::PortAllocator> allocator,
223 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
224 PeerConnectionObserver* observer) {
225 return nullptr;
226}
227
228rtc::scoped_refptr<PeerConnectionInterface>
229PeerConnectionFactoryInterface::CreatePeerConnection(
230 const PeerConnectionInterface::RTCConfiguration& configuration,
231 PeerConnectionDependencies dependencies) {
232 return nullptr;
233}
234
235RtpCapabilities PeerConnectionFactoryInterface::GetRtpSenderCapabilities(
236 cricket::MediaType kind) const {
237 return {};
238}
239
240RtpCapabilities PeerConnectionFactoryInterface::GetRtpReceiverCapabilities(
241 cricket::MediaType kind) const {
242 return {};
243}
244
Mirko Bonadei79eb4dd2018-07-19 08:39:30245} // namespace webrtc