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