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.

89 lines
3.2 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. #ifndef PC_PEER_CONNECTION_INTERNAL_H_
  11. #define PC_PEER_CONNECTION_INTERNAL_H_
  12. #include <map>
  13. #include <memory>
  14. #include <set>
  15. #include <string>
  16. #include <vector>
  17. #include "api/peer_connection_interface.h"
  18. #include "call/call.h"
  19. #include "pc/data_channel.h"
  20. #include "pc/rtp_transceiver.h"
  21. namespace webrtc {
  22. // Internal interface for extra PeerConnection methods.
  23. class PeerConnectionInternal : public PeerConnectionInterface {
  24. public:
  25. virtual rtc::Thread* network_thread() const = 0;
  26. virtual rtc::Thread* worker_thread() const = 0;
  27. virtual rtc::Thread* signaling_thread() const = 0;
  28. // The SDP session ID as defined by RFC 3264.
  29. virtual std::string session_id() const = 0;
  30. // Returns true if we were the initial offerer.
  31. virtual bool initial_offerer() const = 0;
  32. virtual std::vector<
  33. rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
  34. GetTransceiversInternal() const = 0;
  35. virtual sigslot::signal1<DataChannel*>& SignalDataChannelCreated() = 0;
  36. // Only valid when using deprecated RTP data channels.
  37. virtual cricket::RtpDataChannel* rtp_data_channel() const = 0;
  38. virtual std::vector<rtc::scoped_refptr<DataChannel>> sctp_data_channels()
  39. const = 0;
  40. virtual absl::optional<std::string> sctp_content_name() const = 0;
  41. virtual absl::optional<std::string> sctp_transport_name() const = 0;
  42. virtual cricket::CandidateStatsList GetPooledCandidateStats() const = 0;
  43. // Returns a map from MID to transport name for all active media sections.
  44. virtual std::map<std::string, std::string> GetTransportNamesByMid() const = 0;
  45. // Returns a map from transport name to transport stats for all given
  46. // transport names.
  47. virtual std::map<std::string, cricket::TransportStats>
  48. GetTransportStatsByNames(const std::set<std::string>& transport_names) = 0;
  49. virtual Call::Stats GetCallStats() = 0;
  50. virtual bool GetLocalCertificate(
  51. const std::string& transport_name,
  52. rtc::scoped_refptr<rtc::RTCCertificate>* certificate) = 0;
  53. virtual std::unique_ptr<rtc::SSLCertChain> GetRemoteSSLCertChain(
  54. const std::string& transport_name) = 0;
  55. // Returns true if there was an ICE restart initiated by the remote offer.
  56. virtual bool IceRestartPending(const std::string& content_name) const = 0;
  57. // Returns true if the ICE restart flag above was set, and no ICE restart has
  58. // occurred yet for this transport (by applying a local description with
  59. // changed ufrag/password). If the transport has been deleted as a result of
  60. // bundling, returns false.
  61. virtual bool NeedsIceRestart(const std::string& content_name) const = 0;
  62. // Get SSL role for an arbitrary m= section (handles bundling correctly).
  63. virtual bool GetSslRole(const std::string& content_name,
  64. rtc::SSLRole* role) = 0;
  65. };
  66. } // namespace webrtc
  67. #endif // PC_PEER_CONNECTION_INTERNAL_H_