You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
4.3 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  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. #include "api/peer_connection_interface.h"
  11. #include "api/dtls_transport_interface.h"
  12. #include "api/sctp_transport_interface.h"
  13. namespace webrtc {
  14. PeerConnectionInterface::IceServer::IceServer() = default;
  15. PeerConnectionInterface::IceServer::IceServer(const IceServer& rhs) = default;
  16. PeerConnectionInterface::IceServer::~IceServer() = default;
  17. PeerConnectionInterface::RTCConfiguration::RTCConfiguration() = default;
  18. PeerConnectionInterface::RTCConfiguration::RTCConfiguration(
  19. const RTCConfiguration& rhs) = default;
  20. PeerConnectionInterface::RTCConfiguration::RTCConfiguration(
  21. RTCConfigurationType type) {
  22. if (type == RTCConfigurationType::kAggressive) {
  23. // These parameters are also defined in Java and IOS configurations,
  24. // so their values may be overwritten by the Java or IOS configuration.
  25. bundle_policy = kBundlePolicyMaxBundle;
  26. rtcp_mux_policy = kRtcpMuxPolicyRequire;
  27. ice_connection_receiving_timeout = kAggressiveIceConnectionReceivingTimeout;
  28. // These parameters are not defined in Java or IOS configuration,
  29. // so their values will not be overwritten.
  30. enable_ice_renomination = true;
  31. redetermine_role_on_ice_restart = false;
  32. }
  33. }
  34. PeerConnectionInterface::RTCConfiguration::~RTCConfiguration() = default;
  35. RTCError PeerConnectionInterface::RemoveTrackNew(
  36. rtc::scoped_refptr<RtpSenderInterface> sender) {
  37. return RTCError(RemoveTrack(sender) ? RTCErrorType::NONE
  38. : RTCErrorType::INTERNAL_ERROR);
  39. }
  40. RTCError PeerConnectionInterface::SetConfiguration(
  41. const PeerConnectionInterface::RTCConfiguration& config) {
  42. return RTCError();
  43. }
  44. RTCError PeerConnectionInterface::SetBitrate(const BitrateSettings& bitrate) {
  45. BitrateParameters bitrate_parameters;
  46. bitrate_parameters.min_bitrate_bps = bitrate.min_bitrate_bps;
  47. bitrate_parameters.current_bitrate_bps = bitrate.start_bitrate_bps;
  48. bitrate_parameters.max_bitrate_bps = bitrate.max_bitrate_bps;
  49. return SetBitrate(bitrate_parameters);
  50. }
  51. RTCError PeerConnectionInterface::SetBitrate(
  52. const BitrateParameters& bitrate_parameters) {
  53. BitrateSettings bitrate;
  54. bitrate.min_bitrate_bps = bitrate_parameters.min_bitrate_bps;
  55. bitrate.start_bitrate_bps = bitrate_parameters.current_bitrate_bps;
  56. bitrate.max_bitrate_bps = bitrate_parameters.max_bitrate_bps;
  57. return SetBitrate(bitrate);
  58. }
  59. PeerConnectionInterface::BitrateParameters::BitrateParameters() = default;
  60. PeerConnectionInterface::BitrateParameters::~BitrateParameters() = default;
  61. PeerConnectionDependencies::PeerConnectionDependencies(
  62. PeerConnectionObserver* observer_in)
  63. : observer(observer_in) {}
  64. PeerConnectionDependencies::PeerConnectionDependencies(
  65. PeerConnectionDependencies&&) = default;
  66. PeerConnectionDependencies::~PeerConnectionDependencies() = default;
  67. PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
  68. default;
  69. PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
  70. PeerConnectionFactoryDependencies&&) = default;
  71. PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
  72. default;
  73. rtc::scoped_refptr<PeerConnectionInterface>
  74. PeerConnectionFactoryInterface::CreatePeerConnection(
  75. const PeerConnectionInterface::RTCConfiguration& configuration,
  76. std::unique_ptr<cricket::PortAllocator> allocator,
  77. std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
  78. PeerConnectionObserver* observer) {
  79. return nullptr;
  80. }
  81. rtc::scoped_refptr<PeerConnectionInterface>
  82. PeerConnectionFactoryInterface::CreatePeerConnection(
  83. const PeerConnectionInterface::RTCConfiguration& configuration,
  84. PeerConnectionDependencies dependencies) {
  85. return nullptr;
  86. }
  87. RtpCapabilities PeerConnectionFactoryInterface::GetRtpSenderCapabilities(
  88. cricket::MediaType kind) const {
  89. return {};
  90. }
  91. RtpCapabilities PeerConnectionFactoryInterface::GetRtpReceiverCapabilities(
  92. cricket::MediaType kind) const {
  93. return {};
  94. }
  95. } // namespace webrtc