blob: f2953b5b0c28c611fb10efbf8306de245e673f2b [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
Jonas Olsson635474e2018-10-18 15:58:17 +0200162PeerConnectionInterface::PeerConnectionState
163PeerConnectionInterface::peer_connection_state() {
164 return PeerConnectionInterface::PeerConnectionState::kNew;
165}
166
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200167bool PeerConnectionInterface::StartRtcEventLog(rtc::PlatformFile file,
168 int64_t max_size_bytes) {
169 return false;
170}
171
172bool PeerConnectionInterface::StartRtcEventLog(
173 std::unique_ptr<RtcEventLogOutput> output,
174 int64_t output_period_ms) {
175 return false;
176}
177
178PeerConnectionInterface::BitrateParameters::BitrateParameters() = default;
179
180PeerConnectionInterface::BitrateParameters::~BitrateParameters() = default;
181
182PeerConnectionDependencies::PeerConnectionDependencies(
183 PeerConnectionObserver* observer_in)
184 : observer(observer_in) {}
185
186PeerConnectionDependencies::PeerConnectionDependencies(
187 PeerConnectionDependencies&&) = default;
188
189PeerConnectionDependencies::~PeerConnectionDependencies() = default;
190
191PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
192 default;
193
194PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
195 PeerConnectionFactoryDependencies&&) = default;
196
197PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
198 default;
199
200rtc::scoped_refptr<PeerConnectionInterface>
201PeerConnectionFactoryInterface::CreatePeerConnection(
202 const PeerConnectionInterface::RTCConfiguration& configuration,
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200203 std::unique_ptr<cricket::PortAllocator> allocator,
204 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
205 PeerConnectionObserver* observer) {
206 return nullptr;
207}
208
209rtc::scoped_refptr<PeerConnectionInterface>
210PeerConnectionFactoryInterface::CreatePeerConnection(
211 const PeerConnectionInterface::RTCConfiguration& configuration,
212 PeerConnectionDependencies dependencies) {
213 return nullptr;
214}
215
216RtpCapabilities PeerConnectionFactoryInterface::GetRtpSenderCapabilities(
217 cricket::MediaType kind) const {
218 return {};
219}
220
221RtpCapabilities PeerConnectionFactoryInterface::GetRtpReceiverCapabilities(
222 cricket::MediaType kind) const {
223 return {};
224}
225
226rtc::scoped_refptr<VideoTrackSourceInterface>
227PeerConnectionFactoryInterface::CreateVideoSource(
228 std::unique_ptr<cricket::VideoCapturer> capturer) {
229 return nullptr;
230}
231
232rtc::scoped_refptr<VideoTrackSourceInterface>
233PeerConnectionFactoryInterface::CreateVideoSource(
234 std::unique_ptr<cricket::VideoCapturer> capturer,
235 const MediaConstraintsInterface* constraints) {
236 return nullptr;
237}
238
239rtc::scoped_refptr<VideoTrackSourceInterface>
240PeerConnectionFactoryInterface::CreateVideoSource(
241 cricket::VideoCapturer* capturer) {
242 return CreateVideoSource(std::unique_ptr<cricket::VideoCapturer>(capturer));
243}
244
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200245} // namespace webrtc