blob: aa23da32d05aa0e823c7acfda88c6340560e91b3 [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
49RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
50PeerConnectionInterface::AddTransceiver(
51 rtc::scoped_refptr<MediaStreamTrackInterface> track) {
52 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
53}
54
55RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
56PeerConnectionInterface::AddTransceiver(
57 rtc::scoped_refptr<MediaStreamTrackInterface> track,
58 const RtpTransceiverInit& init) {
59 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
60}
61
62RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
63PeerConnectionInterface::AddTransceiver(cricket::MediaType media_type) {
64 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
65}
66
67RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
68PeerConnectionInterface::AddTransceiver(cricket::MediaType media_type,
69 const RtpTransceiverInit& init) {
70 return RTCError(RTCErrorType::INTERNAL_ERROR, "not implemented");
71}
72
73rtc::scoped_refptr<RtpSenderInterface> PeerConnectionInterface::CreateSender(
74 const std::string& kind,
75 const std::string& stream_id) {
76 return rtc::scoped_refptr<RtpSenderInterface>();
77}
78
79std::vector<rtc::scoped_refptr<RtpSenderInterface>>
80PeerConnectionInterface::GetSenders() const {
81 return std::vector<rtc::scoped_refptr<RtpSenderInterface>>();
82}
83
84std::vector<rtc::scoped_refptr<RtpReceiverInterface>>
85PeerConnectionInterface::GetReceivers() const {
86 return std::vector<rtc::scoped_refptr<RtpReceiverInterface>>();
87}
88
89std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>
90PeerConnectionInterface::GetTransceivers() const {
91 return {};
92}
93
94const SessionDescriptionInterface*
95PeerConnectionInterface::current_local_description() const {
96 return nullptr;
97}
98
99const SessionDescriptionInterface*
100PeerConnectionInterface::current_remote_description() const {
101 return nullptr;
102}
103
104const SessionDescriptionInterface*
105PeerConnectionInterface::pending_local_description() const {
106 return nullptr;
107}
108
109const SessionDescriptionInterface*
110PeerConnectionInterface::pending_remote_description() const {
111 return nullptr;
112}
113
114PeerConnectionInterface::RTCConfiguration
115PeerConnectionInterface::GetConfiguration() {
116 return PeerConnectionInterface::RTCConfiguration();
117}
118
119bool PeerConnectionInterface::SetConfiguration(
120 const PeerConnectionInterface::RTCConfiguration& config,
121 RTCError* error) {
122 return false;
123}
124
125bool PeerConnectionInterface::SetConfiguration(
126 const PeerConnectionInterface::RTCConfiguration& config) {
127 return false;
128}
129
130bool PeerConnectionInterface::RemoveIceCandidates(
131 const std::vector<cricket::Candidate>& candidates) {
132 return false;
133}
134
135RTCError PeerConnectionInterface::SetBitrate(const BitrateSettings& bitrate) {
136 BitrateParameters bitrate_parameters;
137 bitrate_parameters.min_bitrate_bps = bitrate.min_bitrate_bps;
138 bitrate_parameters.current_bitrate_bps = bitrate.start_bitrate_bps;
139 bitrate_parameters.max_bitrate_bps = bitrate.max_bitrate_bps;
140 return SetBitrate(bitrate_parameters);
141}
142
143RTCError PeerConnectionInterface::SetBitrate(
144 const BitrateParameters& bitrate_parameters) {
145 BitrateSettings bitrate;
146 bitrate.min_bitrate_bps = bitrate_parameters.min_bitrate_bps;
147 bitrate.start_bitrate_bps = bitrate_parameters.current_bitrate_bps;
148 bitrate.max_bitrate_bps = bitrate_parameters.max_bitrate_bps;
149 return SetBitrate(bitrate);
150}
151
152bool PeerConnectionInterface::StartRtcEventLog(rtc::PlatformFile file,
153 int64_t max_size_bytes) {
154 return false;
155}
156
157bool PeerConnectionInterface::StartRtcEventLog(
158 std::unique_ptr<RtcEventLogOutput> output,
159 int64_t output_period_ms) {
160 return false;
161}
162
163PeerConnectionInterface::BitrateParameters::BitrateParameters() = default;
164
165PeerConnectionInterface::BitrateParameters::~BitrateParameters() = default;
166
167PeerConnectionDependencies::PeerConnectionDependencies(
168 PeerConnectionObserver* observer_in)
169 : observer(observer_in) {}
170
171PeerConnectionDependencies::PeerConnectionDependencies(
172 PeerConnectionDependencies&&) = default;
173
174PeerConnectionDependencies::~PeerConnectionDependencies() = default;
175
176PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
177 default;
178
179PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
180 PeerConnectionFactoryDependencies&&) = default;
181
182PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
183 default;
184
185rtc::scoped_refptr<PeerConnectionInterface>
186PeerConnectionFactoryInterface::CreatePeerConnection(
187 const PeerConnectionInterface::RTCConfiguration& configuration,
188 const MediaConstraintsInterface* constraints,
189 std::unique_ptr<cricket::PortAllocator> allocator,
190 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
191 PeerConnectionObserver* observer) {
192 return nullptr;
193}
194
195rtc::scoped_refptr<PeerConnectionInterface>
196PeerConnectionFactoryInterface::CreatePeerConnection(
197 const PeerConnectionInterface::RTCConfiguration& configuration,
198 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
240rtc::scoped_refptr<VideoTrackSourceInterface>
241PeerConnectionFactoryInterface::CreateVideoSource(
242 cricket::VideoCapturer* capturer,
243 const MediaConstraintsInterface* constraints) {
244 return CreateVideoSource(std::unique_ptr<cricket::VideoCapturer>(capturer),
245 constraints);
246}
247
248} // namespace webrtc