blob: 665760c973b3f87a876bb0c30e503a40dca08d8f [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
11#include "api/peerconnectioninterface.h"
Harald Alvestrandad88c882018-11-28 16:47:46 +010012#include "api/dtlstransportinterface.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 Olsson635474e2018-10-18 15:58:17 +0200163PeerConnectionInterface::PeerConnectionState
164PeerConnectionInterface::peer_connection_state() {
165 return PeerConnectionInterface::PeerConnectionState::kNew;
166}
167
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200168bool PeerConnectionInterface::StartRtcEventLog(rtc::PlatformFile file,
169 int64_t max_size_bytes) {
170 return false;
171}
172
173bool PeerConnectionInterface::StartRtcEventLog(
174 std::unique_ptr<RtcEventLogOutput> output,
175 int64_t output_period_ms) {
176 return false;
177}
178
Harald Alvestrandad88c882018-11-28 16:47:46 +0100179rtc::scoped_refptr<DtlsTransportInterface>
180PeerConnectionInterface::LookupDtlsTransportByMid(const std::string& mid) {
Harald Alvestrand41390472018-12-03 18:45:19 +0100181 RTC_NOTREACHED();
Harald Alvestrandad88c882018-11-28 16:47:46 +0100182 return nullptr;
183}
184
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200185PeerConnectionInterface::BitrateParameters::BitrateParameters() = default;
186
187PeerConnectionInterface::BitrateParameters::~BitrateParameters() = default;
188
189PeerConnectionDependencies::PeerConnectionDependencies(
190 PeerConnectionObserver* observer_in)
191 : observer(observer_in) {}
192
193PeerConnectionDependencies::PeerConnectionDependencies(
194 PeerConnectionDependencies&&) = default;
195
196PeerConnectionDependencies::~PeerConnectionDependencies() = default;
197
198PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
199 default;
200
201PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
202 PeerConnectionFactoryDependencies&&) = default;
203
204PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
205 default;
206
207rtc::scoped_refptr<PeerConnectionInterface>
208PeerConnectionFactoryInterface::CreatePeerConnection(
209 const PeerConnectionInterface::RTCConfiguration& configuration,
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200210 std::unique_ptr<cricket::PortAllocator> allocator,
211 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
212 PeerConnectionObserver* observer) {
213 return nullptr;
214}
215
216rtc::scoped_refptr<PeerConnectionInterface>
217PeerConnectionFactoryInterface::CreatePeerConnection(
218 const PeerConnectionInterface::RTCConfiguration& configuration,
219 PeerConnectionDependencies dependencies) {
220 return nullptr;
221}
222
223RtpCapabilities PeerConnectionFactoryInterface::GetRtpSenderCapabilities(
224 cricket::MediaType kind) const {
225 return {};
226}
227
228RtpCapabilities PeerConnectionFactoryInterface::GetRtpReceiverCapabilities(
229 cricket::MediaType kind) const {
230 return {};
231}
232
233rtc::scoped_refptr<VideoTrackSourceInterface>
234PeerConnectionFactoryInterface::CreateVideoSource(
235 std::unique_ptr<cricket::VideoCapturer> capturer) {
236 return nullptr;
237}
238
239rtc::scoped_refptr<VideoTrackSourceInterface>
240PeerConnectionFactoryInterface::CreateVideoSource(
241 std::unique_ptr<cricket::VideoCapturer> capturer,
242 const MediaConstraintsInterface* constraints) {
243 return nullptr;
244}
245
246rtc::scoped_refptr<VideoTrackSourceInterface>
247PeerConnectionFactoryInterface::CreateVideoSource(
248 cricket::VideoCapturer* capturer) {
249 return CreateVideoSource(std::unique_ptr<cricket::VideoCapturer>(capturer));
250}
251
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200252} // namespace webrtc