blob: 0c2540578418195c44a193fe8795698c2264e2af [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
Steve Anton10542f22019-01-11 09:11:00 -080011#include "api/peer_connection_interface.h"
Jonas Olssona4d87372019-07-05 19:08:33 +020012
Steve Anton10542f22019-01-11 09:11:00 -080013#include "api/dtls_transport_interface.h"
Harald Alvestrandc85328f2019-02-28 07:51:00 +010014#include "api/sctp_transport_interface.h"
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +020015
16namespace webrtc {
17
18PeerConnectionInterface::IceServer::IceServer() = default;
19PeerConnectionInterface::IceServer::IceServer(const IceServer& rhs) = default;
20PeerConnectionInterface::IceServer::~IceServer() = default;
21
22PeerConnectionInterface::RTCConfiguration::RTCConfiguration() = default;
23
24PeerConnectionInterface::RTCConfiguration::RTCConfiguration(
25 const RTCConfiguration& rhs) = default;
26
27PeerConnectionInterface::RTCConfiguration::RTCConfiguration(
28 RTCConfigurationType type) {
29 if (type == RTCConfigurationType::kAggressive) {
30 // These parameters are also defined in Java and IOS configurations,
31 // so their values may be overwritten by the Java or IOS configuration.
32 bundle_policy = kBundlePolicyMaxBundle;
33 rtcp_mux_policy = kRtcpMuxPolicyRequire;
34 ice_connection_receiving_timeout = kAggressiveIceConnectionReceivingTimeout;
35
36 // These parameters are not defined in Java or IOS configuration,
37 // so their values will not be overwritten.
38 enable_ice_renomination = true;
39 redetermine_role_on_ice_restart = false;
40 }
41}
42
43PeerConnectionInterface::RTCConfiguration::~RTCConfiguration() = default;
44
Steve Anton24db5732018-07-23 10:27:33 -070045RTCError PeerConnectionInterface::RemoveTrackNew(
46 rtc::scoped_refptr<RtpSenderInterface> sender) {
47 return RTCError(RemoveTrack(sender) ? RTCErrorType::NONE
48 : RTCErrorType::INTERNAL_ERROR);
49}
50
Niels Möller2579f0c2019-08-19 09:58:17 +020051RTCError PeerConnectionInterface::SetConfiguration(
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +020052 const PeerConnectionInterface::RTCConfiguration& config) {
Niels Möller2579f0c2019-08-19 09:58:17 +020053 return RTCError();
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +020054}
55
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +020056RTCError PeerConnectionInterface::SetBitrate(const BitrateSettings& bitrate) {
57 BitrateParameters bitrate_parameters;
58 bitrate_parameters.min_bitrate_bps = bitrate.min_bitrate_bps;
59 bitrate_parameters.current_bitrate_bps = bitrate.start_bitrate_bps;
60 bitrate_parameters.max_bitrate_bps = bitrate.max_bitrate_bps;
61 return SetBitrate(bitrate_parameters);
62}
63
64RTCError PeerConnectionInterface::SetBitrate(
65 const BitrateParameters& bitrate_parameters) {
66 BitrateSettings bitrate;
67 bitrate.min_bitrate_bps = bitrate_parameters.min_bitrate_bps;
68 bitrate.start_bitrate_bps = bitrate_parameters.current_bitrate_bps;
69 bitrate.max_bitrate_bps = bitrate_parameters.max_bitrate_bps;
70 return SetBitrate(bitrate);
71}
72
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +020073PeerConnectionInterface::BitrateParameters::BitrateParameters() = default;
74
75PeerConnectionInterface::BitrateParameters::~BitrateParameters() = default;
76
77PeerConnectionDependencies::PeerConnectionDependencies(
78 PeerConnectionObserver* observer_in)
79 : observer(observer_in) {}
80
81PeerConnectionDependencies::PeerConnectionDependencies(
82 PeerConnectionDependencies&&) = default;
83
84PeerConnectionDependencies::~PeerConnectionDependencies() = default;
85
86PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
87 default;
88
89PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
90 PeerConnectionFactoryDependencies&&) = default;
91
92PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
93 default;
94
95rtc::scoped_refptr<PeerConnectionInterface>
96PeerConnectionFactoryInterface::CreatePeerConnection(
97 const PeerConnectionInterface::RTCConfiguration& configuration,
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +020098 std::unique_ptr<cricket::PortAllocator> allocator,
99 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
100 PeerConnectionObserver* observer) {
101 return nullptr;
102}
103
104rtc::scoped_refptr<PeerConnectionInterface>
105PeerConnectionFactoryInterface::CreatePeerConnection(
106 const PeerConnectionInterface::RTCConfiguration& configuration,
107 PeerConnectionDependencies dependencies) {
108 return nullptr;
109}
110
111RtpCapabilities PeerConnectionFactoryInterface::GetRtpSenderCapabilities(
112 cricket::MediaType kind) const {
113 return {};
114}
115
116RtpCapabilities PeerConnectionFactoryInterface::GetRtpReceiverCapabilities(
117 cricket::MediaType kind) const {
118 return {};
119}
120
Mirko Bonadei79eb4dd2018-07-19 10:39:30 +0200121} // namespace webrtc