blob: a86180138984d5bb675ab78e9c7b4f18370d91ca [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) {
181 return nullptr;
182}
183
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200184PeerConnectionInterface::BitrateParameters::BitrateParameters() = default;
185
186PeerConnectionInterface::BitrateParameters::~BitrateParameters() = default;
187
188PeerConnectionDependencies::PeerConnectionDependencies(
189 PeerConnectionObserver* observer_in)
190 : observer(observer_in) {}
191
192PeerConnectionDependencies::PeerConnectionDependencies(
193 PeerConnectionDependencies&&) = default;
194
195PeerConnectionDependencies::~PeerConnectionDependencies() = default;
196
197PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
198 default;
199
200PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
201 PeerConnectionFactoryDependencies&&) = default;
202
203PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
204 default;
205
206rtc::scoped_refptr<PeerConnectionInterface>
207PeerConnectionFactoryInterface::CreatePeerConnection(
208 const PeerConnectionInterface::RTCConfiguration& configuration,
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200209 std::unique_ptr<cricket::PortAllocator> allocator,
210 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
211 PeerConnectionObserver* observer) {
212 return nullptr;
213}
214
215rtc::scoped_refptr<PeerConnectionInterface>
216PeerConnectionFactoryInterface::CreatePeerConnection(
217 const PeerConnectionInterface::RTCConfiguration& configuration,
218 PeerConnectionDependencies dependencies) {
219 return nullptr;
220}
221
222RtpCapabilities PeerConnectionFactoryInterface::GetRtpSenderCapabilities(
223 cricket::MediaType kind) const {
224 return {};
225}
226
227RtpCapabilities PeerConnectionFactoryInterface::GetRtpReceiverCapabilities(
228 cricket::MediaType kind) const {
229 return {};
230}
231
232rtc::scoped_refptr<VideoTrackSourceInterface>
233PeerConnectionFactoryInterface::CreateVideoSource(
234 std::unique_ptr<cricket::VideoCapturer> capturer) {
235 return nullptr;
236}
237
238rtc::scoped_refptr<VideoTrackSourceInterface>
239PeerConnectionFactoryInterface::CreateVideoSource(
240 std::unique_ptr<cricket::VideoCapturer> capturer,
241 const MediaConstraintsInterface* constraints) {
242 return nullptr;
243}
244
245rtc::scoped_refptr<VideoTrackSourceInterface>
246PeerConnectionFactoryInterface::CreateVideoSource(
247 cricket::VideoCapturer* capturer) {
248 return CreateVideoSource(std::unique_ptr<cricket::VideoCapturer>(capturer));
249}
250
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200251} // namespace webrtc