Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [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 09:11:00 -0800 | [diff] [blame] | 11 | #ifndef PC_JSEP_TRANSPORT_H_ |
| 12 | #define PC_JSEP_TRANSPORT_H_ |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 13 | |
| 14 | #include <map> |
| 15 | #include <memory> |
| 16 | #include <string> |
| 17 | #include <vector> |
| 18 | |
Danil Chapovalov | 66cadcc | 2018-06-19 16:47:43 +0200 | [diff] [blame] | 19 | #include "absl/types/optional.h" |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 20 | #include "api/candidate.h" |
| 21 | #include "api/jsep.h" |
Anton Sukhanov | 7940da0 | 2018-10-10 10:34:49 -0700 | [diff] [blame] | 22 | #include "api/media_transport_interface.h" |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 23 | #include "p2p/base/dtls_transport.h" |
| 24 | #include "p2p/base/p2p_constants.h" |
| 25 | #include "p2p/base/transport_info.h" |
| 26 | #include "pc/dtls_srtp_transport.h" |
| 27 | #include "pc/dtls_transport.h" |
| 28 | #include "pc/rtcp_mux_filter.h" |
| 29 | #include "pc/rtp_transport.h" |
| 30 | #include "pc/session_description.h" |
| 31 | #include "pc/srtp_filter.h" |
| 32 | #include "pc/srtp_transport.h" |
| 33 | #include "pc/transport_stats.h" |
| 34 | #include "rtc_base/constructor_magic.h" |
| 35 | #include "rtc_base/message_queue.h" |
| 36 | #include "rtc_base/rtc_certificate.h" |
| 37 | #include "rtc_base/ssl_stream_adapter.h" |
Artem Titov | e41c433 | 2018-07-25 15:04:28 +0200 | [diff] [blame] | 38 | #include "rtc_base/third_party/sigslot/sigslot.h" |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 39 | #include "rtc_base/thread_checker.h" |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 40 | |
| 41 | namespace cricket { |
| 42 | |
| 43 | class DtlsTransportInternal; |
| 44 | |
| 45 | struct JsepTransportDescription { |
| 46 | public: |
| 47 | JsepTransportDescription(); |
| 48 | JsepTransportDescription( |
| 49 | bool rtcp_mux_enabled, |
| 50 | const std::vector<CryptoParams>& cryptos, |
| 51 | const std::vector<int>& encrypted_header_extension_ids, |
Zhi Huang | e830e68 | 2018-03-30 10:48:35 -0700 | [diff] [blame] | 52 | int rtp_abs_sendtime_extn_id, |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 53 | const TransportDescription& transport_description); |
| 54 | JsepTransportDescription(const JsepTransportDescription& from); |
| 55 | ~JsepTransportDescription(); |
| 56 | |
| 57 | JsepTransportDescription& operator=(const JsepTransportDescription& from); |
| 58 | |
| 59 | bool rtcp_mux_enabled = true; |
| 60 | std::vector<CryptoParams> cryptos; |
| 61 | std::vector<int> encrypted_header_extension_ids; |
Zhi Huang | e830e68 | 2018-03-30 10:48:35 -0700 | [diff] [blame] | 62 | int rtp_abs_sendtime_extn_id = -1; |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 63 | // TODO(zhihuang): Add the ICE and DTLS related variables and methods from |
| 64 | // TransportDescription and remove this extra layer of abstraction. |
| 65 | TransportDescription transport_desc; |
| 66 | }; |
| 67 | |
| 68 | // Helper class used by JsepTransportController that processes |
| 69 | // TransportDescriptions. A TransportDescription represents the |
| 70 | // transport-specific properties of an SDP m= section, processed according to |
| 71 | // JSEP. Each transport consists of DTLS and ICE transport channels for RTP |
| 72 | // (and possibly RTCP, if rtcp-mux isn't used). |
| 73 | // |
Zhi Huang | 365381f | 2018-04-13 16:44:34 -0700 | [diff] [blame] | 74 | // On Threading: JsepTransport performs work solely on the network thread, and |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 75 | // so its methods should only be called on the network thread. |
Piotr (Peter) Slatala | 4eb4112 | 2018-11-01 07:26:03 -0700 | [diff] [blame] | 76 | class JsepTransport : public sigslot::has_slots<>, |
| 77 | public webrtc::MediaTransportStateCallback { |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 78 | public: |
| 79 | // |mid| is just used for log statements in order to identify the Transport. |
| 80 | // Note that |local_certificate| is allowed to be null since a remote |
| 81 | // description may be set before a local certificate is generated. |
Anton Sukhanov | 7940da0 | 2018-10-10 10:34:49 -0700 | [diff] [blame] | 82 | // |
| 83 | // |media_trasport| is optional (experimental). If available it will be used |
| 84 | // to send / receive encoded audio and video frames instead of RTP. |
| 85 | // Currently |media_transport| can co-exist with RTP / RTCP transports. |
Zhi Huang | 365381f | 2018-04-13 16:44:34 -0700 | [diff] [blame] | 86 | JsepTransport( |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 87 | const std::string& mid, |
| 88 | const rtc::scoped_refptr<rtc::RTCCertificate>& local_certificate, |
| 89 | std::unique_ptr<webrtc::RtpTransport> unencrypted_rtp_transport, |
| 90 | std::unique_ptr<webrtc::SrtpTransport> sdes_transport, |
| 91 | std::unique_ptr<webrtc::DtlsSrtpTransport> dtls_srtp_transport, |
| 92 | std::unique_ptr<DtlsTransportInternal> rtp_dtls_transport, |
Anton Sukhanov | 7940da0 | 2018-10-10 10:34:49 -0700 | [diff] [blame] | 93 | std::unique_ptr<DtlsTransportInternal> rtcp_dtls_transport, |
| 94 | std::unique_ptr<webrtc::MediaTransportInterface> media_transport); |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 95 | |
Zhi Huang | 365381f | 2018-04-13 16:44:34 -0700 | [diff] [blame] | 96 | ~JsepTransport() override; |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 97 | |
| 98 | // Returns the MID of this transport. This is only used for logging. |
| 99 | const std::string& mid() const { return mid_; } |
| 100 | |
| 101 | // Must be called before applying local session description. |
| 102 | // Needed in order to verify the local fingerprint. |
| 103 | void SetLocalCertificate( |
| 104 | const rtc::scoped_refptr<rtc::RTCCertificate>& local_certificate) { |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 105 | RTC_DCHECK_RUN_ON(network_thread_); |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 106 | local_certificate_ = local_certificate; |
| 107 | } |
| 108 | |
| 109 | // Return the local certificate provided by SetLocalCertificate. |
| 110 | rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const { |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 111 | RTC_DCHECK_RUN_ON(network_thread_); |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 112 | return local_certificate_; |
| 113 | } |
| 114 | |
| 115 | webrtc::RTCError SetLocalJsepTransportDescription( |
| 116 | const JsepTransportDescription& jsep_description, |
| 117 | webrtc::SdpType type); |
| 118 | |
| 119 | // Set the remote TransportDescription to be used by DTLS and ICE channels |
| 120 | // that are part of this Transport. |
| 121 | webrtc::RTCError SetRemoteJsepTransportDescription( |
| 122 | const JsepTransportDescription& jsep_description, |
| 123 | webrtc::SdpType type); |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 124 | webrtc::RTCError AddRemoteCandidates(const Candidates& candidates); |
| 125 | |
| 126 | // Set the "needs-ice-restart" flag as described in JSEP. After the flag is |
| 127 | // set, offers should generate new ufrags/passwords until an ICE restart |
| 128 | // occurs. |
| 129 | // |
| 130 | // This and the below method can be called safely from any thread as long as |
| 131 | // SetXTransportDescription is not in progress. |
| 132 | void SetNeedsIceRestartFlag(); |
| 133 | // Returns true if the ICE restart flag above was set, and no ICE restart has |
| 134 | // occurred yet for this transport (by applying a local description with |
| 135 | // changed ufrag/password). |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 136 | bool needs_ice_restart() const { |
| 137 | rtc::CritScope scope(&accessor_lock_); |
| 138 | return needs_ice_restart_; |
| 139 | } |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 140 | |
Danil Chapovalov | 66cadcc | 2018-06-19 16:47:43 +0200 | [diff] [blame] | 141 | // Returns role if negotiated, or empty absl::optional if it hasn't been |
| 142 | // negotiated yet. |
| 143 | absl::optional<rtc::SSLRole> GetDtlsRole() const; |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 144 | |
| 145 | // TODO(deadbeef): Make this const. See comment in transportcontroller.h. |
| 146 | bool GetStats(TransportStats* stats); |
| 147 | |
| 148 | const JsepTransportDescription* local_description() const { |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 149 | RTC_DCHECK_RUN_ON(network_thread_); |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 150 | return local_description_.get(); |
| 151 | } |
| 152 | |
| 153 | const JsepTransportDescription* remote_description() const { |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 154 | RTC_DCHECK_RUN_ON(network_thread_); |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 155 | return remote_description_.get(); |
| 156 | } |
| 157 | |
| 158 | webrtc::RtpTransportInternal* rtp_transport() const { |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 159 | // This method is called from the signaling thread, which means |
| 160 | // that a race is possible, making safety analysis complex. |
| 161 | // After fixing, this method should be marked "network thread only". |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 162 | if (dtls_srtp_transport_) { |
| 163 | return dtls_srtp_transport_.get(); |
| 164 | } else if (sdes_transport_) { |
| 165 | return sdes_transport_.get(); |
| 166 | } else { |
| 167 | return unencrypted_rtp_transport_.get(); |
| 168 | } |
| 169 | } |
| 170 | |
Harald Alvestrand | ad88c88 | 2018-11-28 16:47:46 +0100 | [diff] [blame] | 171 | const DtlsTransportInternal* rtp_dtls_transport() const { |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 172 | rtc::CritScope scope(&accessor_lock_); |
Harald Alvestrand | ad88c88 | 2018-11-28 16:47:46 +0100 | [diff] [blame] | 173 | if (rtp_dtls_transport_) { |
| 174 | return rtp_dtls_transport_->internal(); |
| 175 | } else { |
| 176 | return nullptr; |
| 177 | } |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 178 | } |
| 179 | |
Harald Alvestrand | ad88c88 | 2018-11-28 16:47:46 +0100 | [diff] [blame] | 180 | DtlsTransportInternal* rtp_dtls_transport() { |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 181 | rtc::CritScope scope(&accessor_lock_); |
Harald Alvestrand | ad88c88 | 2018-11-28 16:47:46 +0100 | [diff] [blame] | 182 | if (rtp_dtls_transport_) { |
| 183 | return rtp_dtls_transport_->internal(); |
| 184 | } else { |
| 185 | return nullptr; |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | const DtlsTransportInternal* rtcp_dtls_transport() const { |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 190 | rtc::CritScope scope(&accessor_lock_); |
Harald Alvestrand | ad88c88 | 2018-11-28 16:47:46 +0100 | [diff] [blame] | 191 | if (rtcp_dtls_transport_) { |
| 192 | return rtcp_dtls_transport_->internal(); |
| 193 | } else { |
| 194 | return nullptr; |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | DtlsTransportInternal* rtcp_dtls_transport() { |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 199 | rtc::CritScope scope(&accessor_lock_); |
Harald Alvestrand | ad88c88 | 2018-11-28 16:47:46 +0100 | [diff] [blame] | 200 | if (rtcp_dtls_transport_) { |
| 201 | return rtcp_dtls_transport_->internal(); |
| 202 | } else { |
| 203 | return nullptr; |
| 204 | } |
| 205 | } |
| 206 | |
Harald Alvestrand | 4a7b3ac | 2019-01-17 10:39:40 +0100 | [diff] [blame] | 207 | rtc::scoped_refptr<webrtc::DtlsTransport> RtpDtlsTransport() { |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 208 | rtc::CritScope scope(&accessor_lock_); |
Harald Alvestrand | ad88c88 | 2018-11-28 16:47:46 +0100 | [diff] [blame] | 209 | return rtp_dtls_transport_; |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 210 | } |
| 211 | |
Anton Sukhanov | 7940da0 | 2018-10-10 10:34:49 -0700 | [diff] [blame] | 212 | // Returns media transport, if available. |
| 213 | // Note that media transport is owned by jseptransport and the pointer |
| 214 | // to media transport will becomes invalid after destruction of jseptransport. |
| 215 | webrtc::MediaTransportInterface* media_transport() const { |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 216 | rtc::CritScope scope(&accessor_lock_); |
Anton Sukhanov | 7940da0 | 2018-10-10 10:34:49 -0700 | [diff] [blame] | 217 | return media_transport_.get(); |
| 218 | } |
| 219 | |
Piotr (Peter) Slatala | 4eb4112 | 2018-11-01 07:26:03 -0700 | [diff] [blame] | 220 | // Returns the latest media transport state. |
| 221 | webrtc::MediaTransportState media_transport_state() const { |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 222 | rtc::CritScope scope(&accessor_lock_); |
Piotr (Peter) Slatala | 4eb4112 | 2018-11-01 07:26:03 -0700 | [diff] [blame] | 223 | return media_transport_state_; |
| 224 | } |
| 225 | |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 226 | // This is signaled when RTCP-mux becomes active and |
| 227 | // |rtcp_dtls_transport_| is destroyed. The JsepTransportController will |
| 228 | // handle the signal and update the aggregate transport states. |
| 229 | sigslot::signal<> SignalRtcpMuxActive; |
| 230 | |
Piotr (Peter) Slatala | 4eb4112 | 2018-11-01 07:26:03 -0700 | [diff] [blame] | 231 | // This is signaled for changes in |media_transport_| state. |
| 232 | sigslot::signal<> SignalMediaTransportStateChanged; |
| 233 | |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 234 | // TODO(deadbeef): The methods below are only public for testing. Should make |
| 235 | // them utility functions or objects so they can be tested independently from |
| 236 | // this class. |
| 237 | |
| 238 | // Returns an error if the certificate's identity does not match the |
| 239 | // fingerprint, or either is NULL. |
| 240 | webrtc::RTCError VerifyCertificateFingerprint( |
| 241 | const rtc::RTCCertificate* certificate, |
| 242 | const rtc::SSLFingerprint* fingerprint) const; |
| 243 | |
Zhi Huang | b57e169 | 2018-06-12 11:41:11 -0700 | [diff] [blame] | 244 | void SetActiveResetSrtpParams(bool active_reset_srtp_params); |
| 245 | |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 246 | private: |
| 247 | bool SetRtcpMux(bool enable, webrtc::SdpType type, ContentSource source); |
| 248 | |
| 249 | void ActivateRtcpMux(); |
| 250 | |
| 251 | bool SetSdes(const std::vector<CryptoParams>& cryptos, |
| 252 | const std::vector<int>& encrypted_extension_ids, |
| 253 | webrtc::SdpType type, |
| 254 | ContentSource source); |
| 255 | |
| 256 | // Negotiates and sets the DTLS parameters based on the current local and |
| 257 | // remote transport description, such as the DTLS role to use, and whether |
| 258 | // DTLS should be activated. |
| 259 | // |
| 260 | // Called when an answer TransportDescription is applied. |
| 261 | webrtc::RTCError NegotiateAndSetDtlsParameters( |
| 262 | webrtc::SdpType local_description_type); |
| 263 | |
| 264 | // Negotiates the DTLS role based off the offer and answer as specified by |
| 265 | // RFC 4145, section-4.1. Returns an RTCError if role cannot be determined |
| 266 | // from the local description and remote description. |
| 267 | webrtc::RTCError NegotiateDtlsRole( |
| 268 | webrtc::SdpType local_description_type, |
| 269 | ConnectionRole local_connection_role, |
| 270 | ConnectionRole remote_connection_role, |
Danil Chapovalov | 66cadcc | 2018-06-19 16:47:43 +0200 | [diff] [blame] | 271 | absl::optional<rtc::SSLRole>* negotiated_dtls_role); |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 272 | |
| 273 | // Pushes down the ICE parameters from the local description, such |
| 274 | // as the ICE ufrag and pwd. |
| 275 | void SetLocalIceParameters(IceTransportInternal* ice); |
| 276 | |
| 277 | // Pushes down the ICE parameters from the remote description. |
| 278 | void SetRemoteIceParameters(IceTransportInternal* ice); |
| 279 | |
| 280 | // Pushes down the DTLS parameters obtained via negotiation. |
| 281 | webrtc::RTCError SetNegotiatedDtlsParameters( |
| 282 | DtlsTransportInternal* dtls_transport, |
Danil Chapovalov | 66cadcc | 2018-06-19 16:47:43 +0200 | [diff] [blame] | 283 | absl::optional<rtc::SSLRole> dtls_role, |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 284 | rtc::SSLFingerprint* remote_fingerprint); |
| 285 | |
| 286 | bool GetTransportStats(DtlsTransportInternal* dtls_transport, |
| 287 | TransportStats* stats); |
| 288 | |
Piotr (Peter) Slatala | 4eb4112 | 2018-11-01 07:26:03 -0700 | [diff] [blame] | 289 | // Invoked whenever the state of the media transport changes. |
| 290 | void OnStateChanged(webrtc::MediaTransportState state) override; |
| 291 | |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 292 | // Owning thread, for safety checks |
| 293 | const rtc::Thread* const network_thread_; |
| 294 | // Critical scope for fields accessed off-thread |
| 295 | // TODO(https://bugs.webrtc.org/10300): Stop doing this. |
| 296 | rtc::CriticalSection accessor_lock_; |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 297 | const std::string mid_; |
| 298 | // needs-ice-restart bit as described in JSEP. |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 299 | bool needs_ice_restart_ RTC_GUARDED_BY(accessor_lock_) = false; |
| 300 | rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_ |
| 301 | RTC_GUARDED_BY(network_thread_); |
| 302 | std::unique_ptr<JsepTransportDescription> local_description_ |
| 303 | RTC_GUARDED_BY(network_thread_); |
| 304 | std::unique_ptr<JsepTransportDescription> remote_description_ |
| 305 | RTC_GUARDED_BY(network_thread_); |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 306 | |
| 307 | // To avoid downcasting and make it type safe, keep three unique pointers for |
| 308 | // different SRTP mode and only one of these is non-nullptr. |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 309 | // Since these are const, the variables don't need locks; |
| 310 | // accessing the objects depends on the objects' thread safety contract. |
| 311 | const std::unique_ptr<webrtc::RtpTransport> unencrypted_rtp_transport_; |
| 312 | const std::unique_ptr<webrtc::SrtpTransport> sdes_transport_; |
| 313 | const std::unique_ptr<webrtc::DtlsSrtpTransport> dtls_srtp_transport_; |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 314 | |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 315 | rtc::scoped_refptr<webrtc::DtlsTransport> rtp_dtls_transport_ |
| 316 | RTC_GUARDED_BY(accessor_lock_); |
| 317 | rtc::scoped_refptr<webrtc::DtlsTransport> rtcp_dtls_transport_ |
| 318 | RTC_GUARDED_BY(accessor_lock_); |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 319 | |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 320 | SrtpFilter sdes_negotiator_ RTC_GUARDED_BY(network_thread_); |
| 321 | RtcpMuxFilter rtcp_mux_negotiator_ RTC_GUARDED_BY(network_thread_); |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 322 | |
| 323 | // Cache the encrypted header extension IDs for SDES negoitation. |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 324 | absl::optional<std::vector<int>> send_extension_ids_ |
| 325 | RTC_GUARDED_BY(network_thread_); |
| 326 | absl::optional<std::vector<int>> recv_extension_ids_ |
| 327 | RTC_GUARDED_BY(network_thread_); |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 328 | |
Anton Sukhanov | 7940da0 | 2018-10-10 10:34:49 -0700 | [diff] [blame] | 329 | // Optional media transport (experimental). |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 330 | std::unique_ptr<webrtc::MediaTransportInterface> media_transport_ |
| 331 | RTC_GUARDED_BY(accessor_lock_); |
Anton Sukhanov | 7940da0 | 2018-10-10 10:34:49 -0700 | [diff] [blame] | 332 | |
Piotr (Peter) Slatala | 4eb4112 | 2018-11-01 07:26:03 -0700 | [diff] [blame] | 333 | // If |media_transport_| is provided, this variable represents the state of |
| 334 | // media transport. |
Harald Alvestrand | 78a5e96 | 2019-04-03 10:42:39 +0200 | [diff] [blame] | 335 | webrtc::MediaTransportState media_transport_state_ |
| 336 | RTC_GUARDED_BY(accessor_lock_) = webrtc::MediaTransportState::kPending; |
Piotr (Peter) Slatala | 4eb4112 | 2018-11-01 07:26:03 -0700 | [diff] [blame] | 337 | |
Zhi Huang | 365381f | 2018-04-13 16:44:34 -0700 | [diff] [blame] | 338 | RTC_DISALLOW_COPY_AND_ASSIGN(JsepTransport); |
Zhi Huang | e818b6e | 2018-02-22 15:26:27 -0800 | [diff] [blame] | 339 | }; |
| 340 | |
| 341 | } // namespace cricket |
| 342 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 343 | #endif // PC_JSEP_TRANSPORT_H_ |