Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 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 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 11 | #ifndef PC_PEER_CONNECTION_INTERNAL_H_ |
| 12 | #define PC_PEER_CONNECTION_INTERNAL_H_ |
Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 13 | |
| 14 | #include <map> |
| 15 | #include <memory> |
Steve Anton | 5dfde18 | 2018-02-06 18:34:40 | [diff] [blame] | 16 | #include <set> |
Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 17 | #include <string> |
| 18 | #include <vector> |
| 19 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 20 | #include "api/peer_connection_interface.h" |
Niels Möller | 8366e17 | 2018-02-14 11:20:13 | [diff] [blame] | 21 | #include "call/call.h" |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 22 | #include "pc/data_channel.h" |
| 23 | #include "pc/rtp_transceiver.h" |
Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 24 | |
| 25 | namespace webrtc { |
| 26 | |
Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 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 | virtual rtc::Thread* signaling_thread() const = 0; |
| 33 | |
| 34 | // The SDP session ID as defined by RFC 3264. |
Steve Anton | be5e208 | 2018-01-24 23:29:17 | [diff] [blame] | 35 | virtual std::string session_id() const = 0; |
Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 36 | |
| 37 | // Returns true if we were the initial offerer. |
| 38 | virtual bool initial_offerer() const = 0; |
| 39 | |
Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 40 | virtual std::vector< |
| 41 | rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>> |
Steve Anton | b886711 | 2018-02-13 18:07:54 | [diff] [blame] | 42 | GetTransceiversInternal() const = 0; |
Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 43 | |
Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 44 | virtual sigslot::signal1<DataChannel*>& SignalDataChannelCreated() = 0; |
| 45 | |
| 46 | // Only valid when using deprecated RTP data channels. |
| 47 | virtual cricket::RtpDataChannel* rtp_data_channel() const = 0; |
| 48 | |
Steve Anton | be5e208 | 2018-01-24 23:29:17 | [diff] [blame] | 49 | virtual std::vector<rtc::scoped_refptr<DataChannel>> sctp_data_channels() |
| 50 | const = 0; |
Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 51 | |
Danil Chapovalov | 66cadcc | 2018-06-19 14:47:43 | [diff] [blame] | 52 | virtual absl::optional<std::string> sctp_content_name() const = 0; |
| 53 | virtual absl::optional<std::string> sctp_transport_name() const = 0; |
Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 54 | |
Qingsi Wang | 72a43a1 | 2018-02-21 00:03:18 | [diff] [blame] | 55 | virtual cricket::CandidateStatsList GetPooledCandidateStats() const = 0; |
| 56 | |
Steve Anton | 5dfde18 | 2018-02-06 18:34:40 | [diff] [blame] | 57 | // Returns a map from MID to transport name for all active media sections. |
| 58 | virtual std::map<std::string, std::string> GetTransportNamesByMid() const = 0; |
| 59 | |
| 60 | // Returns a map from transport name to transport stats for all given |
| 61 | // transport names. |
| 62 | virtual std::map<std::string, cricket::TransportStats> |
| 63 | GetTransportStatsByNames(const std::set<std::string>& transport_names) = 0; |
Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 64 | |
| 65 | virtual Call::Stats GetCallStats() = 0; |
| 66 | |
| 67 | virtual bool GetLocalCertificate( |
| 68 | const std::string& transport_name, |
| 69 | rtc::scoped_refptr<rtc::RTCCertificate>* certificate) = 0; |
Taylor Brandstetter | c392866 | 2018-02-23 21:04:51 | [diff] [blame] | 70 | virtual std::unique_ptr<rtc::SSLCertChain> GetRemoteSSLCertChain( |
Steve Anton | 2d8609c | 2018-01-24 00:38:46 | [diff] [blame] | 71 | const std::string& transport_name) = 0; |
| 72 | |
| 73 | // Returns true if there was an ICE restart initiated by the remote offer. |
| 74 | virtual bool IceRestartPending(const std::string& content_name) const = 0; |
| 75 | |
| 76 | // Returns true if the ICE restart flag above was set, and no ICE restart has |
| 77 | // occurred yet for this transport (by applying a local description with |
| 78 | // changed ufrag/password). If the transport has been deleted as a result of |
| 79 | // bundling, returns false. |
| 80 | virtual bool NeedsIceRestart(const std::string& content_name) const = 0; |
| 81 | |
| 82 | // Get SSL role for an arbitrary m= section (handles bundling correctly). |
| 83 | virtual bool GetSslRole(const std::string& content_name, |
| 84 | rtc::SSLRole* role) = 0; |
| 85 | }; |
| 86 | |
| 87 | } // namespace webrtc |
| 88 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 89 | #endif // PC_PEER_CONNECTION_INTERNAL_H_ |