| 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/peer_connection_interface.h" |
| 12 |
| 13 | #include <utility> |
| 14 |
| 15 | #include "pc/media_factory.h" |
| 16 |
| 17 | namespace webrtc { |
| 18 |
| 19 | PeerConnectionInterface::IceServer::IceServer() = default; |
| 20 | PeerConnectionInterface::IceServer::IceServer(const IceServer& rhs) = default; |
| 21 | PeerConnectionInterface::IceServer::~IceServer() = default; |
| 22 |
| 23 | PeerConnectionInterface::RTCConfiguration::RTCConfiguration() = default; |
| 24 |
| 25 | PeerConnectionInterface::RTCConfiguration::RTCConfiguration( |
| 26 | const RTCConfiguration& rhs) = default; |
| 27 |
| 28 | PeerConnectionInterface::RTCConfiguration::RTCConfiguration( |
| 29 | RTCConfigurationType type) { |
| 30 | if (type == RTCConfigurationType::kAggressive) { |
| 31 | // These parameters are also defined in Java and IOS configurations, |
| 32 | // so their values may be overwritten by the Java or IOS configuration. |
| 33 | bundle_policy = kBundlePolicyMaxBundle; |
| 34 | rtcp_mux_policy = kRtcpMuxPolicyRequire; |
| 35 | ice_connection_receiving_timeout = kAggressiveIceConnectionReceivingTimeout; |
| 36 |
| 37 | // These parameters are not defined in Java or IOS configuration, |
| 38 | // so their values will not be overwritten. |
| 39 | enable_ice_renomination = true; |
| 40 | redetermine_role_on_ice_restart = false; |
| 41 | } |
| 42 | } |
| 43 |
| 44 | PeerConnectionInterface::RTCConfiguration::~RTCConfiguration() = default; |
| 45 |
| 46 | PeerConnectionDependencies::PeerConnectionDependencies( |
| 47 | PeerConnectionObserver* observer_in) |
| 48 | : observer(observer_in) {} |
| 49 |
| 50 | // TODO(bugs.webrtc.org/12598: remove pragma once async_resolver_factory |
| 51 | // is removed from PeerConnectionDependencies |
| 52 | #pragma clang diagnostic push |
| 53 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
| 54 | PeerConnectionDependencies::PeerConnectionDependencies( |
| 55 | PeerConnectionDependencies&&) = default; |
| 56 | #pragma clang diagnostic pop |
| 57 |
| 58 | PeerConnectionDependencies::~PeerConnectionDependencies() = default; |
| 59 |
| 60 | PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() = |
| 61 | default; |
| 62 |
| 63 | PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies( |
| 64 | PeerConnectionFactoryDependencies&&) = default; |
| 65 |
| 66 | PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() = |
| 67 | default; |
| 68 |
| 69 | rtc::scoped_refptr<PeerConnectionInterface> |
| 70 | PeerConnectionFactoryInterface::CreatePeerConnection( |
| 71 | const PeerConnectionInterface::RTCConfiguration& configuration, |
| 72 | std::unique_ptr<cricket::PortAllocator> allocator, |
| 73 | std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, |
| 74 | PeerConnectionObserver* observer) { |
| 75 | PeerConnectionDependencies dependencies(observer); |
| 76 | dependencies.allocator = std::move(allocator); |
| 77 | dependencies.cert_generator = std::move(cert_generator); |
| 78 | auto result = |
| 79 | CreatePeerConnectionOrError(configuration, std::move(dependencies)); |
| 80 | if (!result.ok()) { |
| 81 | return nullptr; |
| 82 | } |
| 83 | return result.MoveValue(); |
| 84 | } |
| 85 |
| 86 | rtc::scoped_refptr<PeerConnectionInterface> |
| 87 | PeerConnectionFactoryInterface::CreatePeerConnection( |
| 88 | const PeerConnectionInterface::RTCConfiguration& configuration, |
| 89 | PeerConnectionDependencies dependencies) { |
| 90 | auto result = |
| 91 | CreatePeerConnectionOrError(configuration, std::move(dependencies)); |
| 92 | if (!result.ok()) { |
| 93 | return nullptr; |
| 94 | } |
| 95 | return result.MoveValue(); |
| 96 | } |
| 97 |
| 98 | RTCErrorOr<rtc::scoped_refptr<PeerConnectionInterface>> |
| 99 | PeerConnectionFactoryInterface::CreatePeerConnectionOrError( |
| 100 | const PeerConnectionInterface::RTCConfiguration& configuration, |
| 101 | PeerConnectionDependencies dependencies) { |
| 102 | return RTCError(RTCErrorType::INTERNAL_ERROR); |
| 103 | } |
| 104 |
| 105 | RtpCapabilities PeerConnectionFactoryInterface::GetRtpSenderCapabilities( |
| 106 | cricket::MediaType kind) const { |
| 107 | return {}; |
| 108 | } |
| 109 |
| 110 | RtpCapabilities PeerConnectionFactoryInterface::GetRtpReceiverCapabilities( |
| 111 | cricket::MediaType kind) const { |
| 112 | return {}; |
| 113 | } |
| 114 |
| 115 | } // namespace webrtc |
| 116 |