blob: 57754b6d8809c37322e1cb7c16e7b10694417fa7 [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"
12#include "api/dtls_transport_interface.h"
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +020013
14namespace webrtc {
15
16PeerConnectionInterface::IceServer::IceServer() = default;
17PeerConnectionInterface::IceServer::IceServer(const IceServer& rhs) = default;
18PeerConnectionInterface::IceServer::~IceServer() = default;
19
20PeerConnectionInterface::RTCConfiguration::RTCConfiguration() = default;
21
22PeerConnectionInterface::RTCConfiguration::RTCConfiguration(
23 const RTCConfiguration& rhs) = default;
24
25PeerConnectionInterface::RTCConfiguration::RTCConfiguration(
26 RTCConfigurationType type) {
27 if (type == RTCConfigurationType::kAggressive) {
28 // These parameters are also defined in Java and IOS configurations,
29 // so their values may be overwritten by the Java or IOS configuration.
30 bundle_policy = kBundlePolicyMaxBundle;
31 rtcp_mux_policy = kRtcpMuxPolicyRequire;
32 ice_connection_receiving_timeout = kAggressiveIceConnectionReceivingTimeout;
33
34 // These parameters are not defined in Java or IOS configuration,
35 // so their values will not be overwritten.
36 enable_ice_renomination = true;
37 redetermine_role_on_ice_restart = false;
38 }
39}
40
41PeerConnectionInterface::RTCConfiguration::~RTCConfiguration() = default;
42
43RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>
44PeerConnectionInterface::AddTrack(
45 rtc::scoped_refptr<MediaStreamTrackInterface> track,
46 const std::vector<std::string>& stream_ids) {
47 return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented");
48}
49
Steve Anton24db5732018-07-23 10:27:33 -070050bool PeerConnectionInterface::RemoveTrack(RtpSenderInterface* sender) {
51 return RemoveTrackNew(sender).ok();
52}
53
54RTCError PeerConnectionInterface::RemoveTrackNew(
55 rtc::scoped_refptr<RtpSenderInterface> sender) {
56 return RTCError(RemoveTrack(sender) ? RTCErrorType::NONE
57 : RTCErrorType::INTERNAL_ERROR);
58}
59
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +020060RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
61PeerConnectionInterface::AddTransceiver(
62 rtc::scoped_refptr<MediaStreamTrackInterface> track) {
63 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
64}
65
66RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
67PeerConnectionInterface::AddTransceiver(
68 rtc::scoped_refptr<MediaStreamTrackInterface> track,
69 const RtpTransceiverInit& init) {
70 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
71}
72
73RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
74PeerConnectionInterface::AddTransceiver(cricket::MediaType media_type) {
75 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
76}
77
78RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
79PeerConnectionInterface::AddTransceiver(cricket::MediaType media_type,
80 const RtpTransceiverInit& init) {
81 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
82}
83
84rtc::scoped_refptr<RtpSenderInterface> PeerConnectionInterface::CreateSender(
85 const std::string& kind,
86 const std::string& stream_id) {
87 return rtc::scoped_refptr<RtpSenderInterface>();
88}
89
90std::vector<rtc::scoped_refptr<RtpSenderInterface>>
91PeerConnectionInterface::GetSenders() const {
92 return std::vector<rtc::scoped_refptr<RtpSenderInterface>>();
93}
94
95std::vector<rtc::scoped_refptr<RtpReceiverInterface>>
96PeerConnectionInterface::GetReceivers() const {
97 return std::vector<rtc::scoped_refptr<RtpReceiverInterface>>();
98}
99
100std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>
101PeerConnectionInterface::GetTransceivers() const {
Joachim Bauch02a454f2018-07-27 13:01:21 +0200102 return std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>();
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200103}
104
105const SessionDescriptionInterface*
106PeerConnectionInterface::current_local_description() const {
107 return nullptr;
108}
109
110const SessionDescriptionInterface*
111PeerConnectionInterface::current_remote_description() const {
112 return nullptr;
113}
114
115const SessionDescriptionInterface*
116PeerConnectionInterface::pending_local_description() const {
117 return nullptr;
118}
119
120const SessionDescriptionInterface*
121PeerConnectionInterface::pending_remote_description() const {
122 return nullptr;
123}
124
125PeerConnectionInterface::RTCConfiguration
126PeerConnectionInterface::GetConfiguration() {
127 return PeerConnectionInterface::RTCConfiguration();
128}
129
130bool PeerConnectionInterface::SetConfiguration(
131 const PeerConnectionInterface::RTCConfiguration& config,
132 RTCError* error) {
133 return false;
134}
135
136bool PeerConnectionInterface::SetConfiguration(
137 const PeerConnectionInterface::RTCConfiguration& config) {
138 return false;
139}
140
141bool PeerConnectionInterface::RemoveIceCandidates(
142 const std::vector<cricket::Candidate>& candidates) {
143 return false;
144}
145
146RTCError PeerConnectionInterface::SetBitrate(const BitrateSettings& bitrate) {
147 BitrateParameters bitrate_parameters;
148 bitrate_parameters.min_bitrate_bps = bitrate.min_bitrate_bps;
149 bitrate_parameters.current_bitrate_bps = bitrate.start_bitrate_bps;
150 bitrate_parameters.max_bitrate_bps = bitrate.max_bitrate_bps;
151 return SetBitrate(bitrate_parameters);
152}
153
154RTCError PeerConnectionInterface::SetBitrate(
155 const BitrateParameters& bitrate_parameters) {
156 BitrateSettings bitrate;
157 bitrate.min_bitrate_bps = bitrate_parameters.min_bitrate_bps;
158 bitrate.start_bitrate_bps = bitrate_parameters.current_bitrate_bps;
159 bitrate.max_bitrate_bps = bitrate_parameters.max_bitrate_bps;
160 return SetBitrate(bitrate);
161}
162
Jonas Olsson12046902018-12-06 11:25:14 +0100163PeerConnectionInterface::IceConnectionState
164PeerConnectionInterface::standardized_ice_connection_state() {
165 return PeerConnectionInterface::IceConnectionState::kIceConnectionFailed;
166}
167
Jonas Olsson635474e2018-10-18 15:58:17 +0200168PeerConnectionInterface::PeerConnectionState
169PeerConnectionInterface::peer_connection_state() {
Jonas Olsson12046902018-12-06 11:25:14 +0100170 return PeerConnectionInterface::PeerConnectionState::kFailed;
Jonas Olsson635474e2018-10-18 15:58:17 +0200171}
172
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200173bool PeerConnectionInterface::StartRtcEventLog(rtc::PlatformFile file,
174 int64_t max_size_bytes) {
175 return false;
176}
177
178bool PeerConnectionInterface::StartRtcEventLog(
179 std::unique_ptr<RtcEventLogOutput> output,
180 int64_t output_period_ms) {
181 return false;
182}
183
Harald Alvestrandad88c882018-11-28 16:47:46 +0100184rtc::scoped_refptr<DtlsTransportInterface>
185PeerConnectionInterface::LookupDtlsTransportByMid(const std::string& mid) {
Harald Alvestrand41390472018-12-03 18:45:19 +0100186 RTC_NOTREACHED();
Harald Alvestrandad88c882018-11-28 16:47:46 +0100187 return nullptr;
188}
189
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200190PeerConnectionInterface::BitrateParameters::BitrateParameters() = default;
191
192PeerConnectionInterface::BitrateParameters::~BitrateParameters() = default;
193
194PeerConnectionDependencies::PeerConnectionDependencies(
195 PeerConnectionObserver* observer_in)
196 : observer(observer_in) {}
197
198PeerConnectionDependencies::PeerConnectionDependencies(
199 PeerConnectionDependencies&&) = default;
200
201PeerConnectionDependencies::~PeerConnectionDependencies() = default;
202
203PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
204 default;
205
206PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
207 PeerConnectionFactoryDependencies&&) = default;
208
209PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
210 default;
211
212rtc::scoped_refptr<PeerConnectionInterface>
213PeerConnectionFactoryInterface::CreatePeerConnection(
214 const PeerConnectionInterface::RTCConfiguration& configuration,
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200215 std::unique_ptr<cricket::PortAllocator> allocator,
216 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
217 PeerConnectionObserver* observer) {
218 return nullptr;
219}
220
221rtc::scoped_refptr<PeerConnectionInterface>
222PeerConnectionFactoryInterface::CreatePeerConnection(
223 const PeerConnectionInterface::RTCConfiguration& configuration,
224 PeerConnectionDependencies dependencies) {
225 return nullptr;
226}
227
228RtpCapabilities PeerConnectionFactoryInterface::GetRtpSenderCapabilities(
229 cricket::MediaType kind) const {
230 return {};
231}
232
233RtpCapabilities PeerConnectionFactoryInterface::GetRtpReceiverCapabilities(
234 cricket::MediaType kind) const {
235 return {};
236}
237
238rtc::scoped_refptr<VideoTrackSourceInterface>
239PeerConnectionFactoryInterface::CreateVideoSource(
240 std::unique_ptr<cricket::VideoCapturer> capturer) {
241 return nullptr;
242}
243
244rtc::scoped_refptr<VideoTrackSourceInterface>
245PeerConnectionFactoryInterface::CreateVideoSource(
246 std::unique_ptr<cricket::VideoCapturer> capturer,
247 const MediaConstraintsInterface* constraints) {
248 return nullptr;
249}
250
251rtc::scoped_refptr<VideoTrackSourceInterface>
252PeerConnectionFactoryInterface::CreateVideoSource(
253 cricket::VideoCapturer* capturer) {
254 return CreateVideoSource(std::unique_ptr<cricket::VideoCapturer>(capturer));
255}
256
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200257} // namespace webrtc