| 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 | #ifndef PC_PEER_CONNECTION_INTERNAL_H_ |
| 12 | #define PC_PEER_CONNECTION_INTERNAL_H_ |
| 13 |
| 14 | #include <map> |
| 15 | #include <memory> |
| 16 | #include <set> |
| 17 | #include <string> |
| 18 | #include <vector> |
| 19 |
| 20 | #include "api/peer_connection_interface.h" |
| 21 | #include "call/call.h" |
| 22 | #include "pc/rtp_transceiver.h" |
| 23 | #include "pc/sctp_data_channel.h" |
| 24 |
| 25 | namespace webrtc { |
| 26 |
| 27 | // Internal interface for extra PeerConnection methods. |
| 28 | class PeerConnectionInternal : public PeerConnectionInterface { |
| 29 | public: |
| 30 | virtual rtc::Thread* network_thread() const = 0; |
| 31 | virtual rtc::Thread* worker_thread() const = 0; |
| 32 |
| 33 | // The SDP session ID as defined by RFC 3264. |
| 34 | virtual std::string session_id() const = 0; |
| 35 |
| 36 | // Returns true if we were the initial offerer. |
| 37 | virtual bool initial_offerer() const = 0; |
| 38 |
| 39 | virtual std::vector< |
| 40 | rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>> |
| 41 | GetTransceiversInternal() const = 0; |
| 42 |
| 43 | virtual sigslot::signal1<SctpDataChannel*>& |
| 44 | SignalSctpDataChannelCreated() = 0; |
| 45 |
| 46 | // Call on the network thread to fetch stats for all the data channels. |
| 47 | // TODO(tommi): Make pure virtual after downstream updates. |
| 48 | virtual std::vector<DataChannelStats> GetDataChannelStats() const { |
| 49 | return {}; |
| 50 | } |
| 51 |
| 52 | virtual absl::optional<std::string> sctp_transport_name() const = 0; |
| 53 | virtual absl::optional<std::string> sctp_mid() const = 0; |
| 54 |
| 55 | virtual cricket::CandidateStatsList GetPooledCandidateStats() const = 0; |
| 56 |
| 57 | // Returns a map from transport name to transport stats for all given |
| 58 | // transport names. |
| 59 | // Must be called on the network thread. |
| 60 | virtual std::map<std::string, cricket::TransportStats> |
| 61 | GetTransportStatsByNames(const std::set<std::string>& transport_names) = 0; |
| 62 |
| 63 | virtual Call::Stats GetCallStats() = 0; |
| 64 |
| 65 | virtual bool GetLocalCertificate( |
| 66 | const std::string& transport_name, |
| 67 | rtc::scoped_refptr<rtc::RTCCertificate>* certificate) = 0; |
| 68 | virtual std::unique_ptr<rtc::SSLCertChain> GetRemoteSSLCertChain( |
| 69 | const std::string& transport_name) = 0; |
| 70 |
| 71 | // Returns true if there was an ICE restart initiated by the remote offer. |
| 72 | virtual bool IceRestartPending(const std::string& content_name) const = 0; |
| 73 |
| 74 | // Returns true if the ICE restart flag above was set, and no ICE restart has |
| 75 | // occurred yet for this transport (by applying a local description with |
| 76 | // changed ufrag/password). If the transport has been deleted as a result of |
| 77 | // bundling, returns false. |
| 78 | virtual bool NeedsIceRestart(const std::string& content_name) const = 0; |
| 79 |
| 80 | // Get SSL role for an arbitrary m= section (handles bundling correctly). |
| 81 | virtual bool GetSslRole(const std::string& content_name, |
| 82 | rtc::SSLRole* role) = 0; |
| 83 | }; |
| 84 |
| 85 | } // namespace webrtc |
| 86 |
| 87 | #endif // PC_PEER_CONNECTION_INTERNAL_H_ |
| 88 |