blob: 1a0e7b499a2712d3e358bed94efecaf1dd3991bc [file] [log] [blame]
Zhi Huange818b6e2018-02-22 15:26:27 -08001/*
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 Anton10542f22019-01-11 09:11:00 -080011#ifndef PC_JSEP_TRANSPORT_H_
12#define PC_JSEP_TRANSPORT_H_
Zhi Huange818b6e2018-02-22 15:26:27 -080013
14#include <map>
15#include <memory>
16#include <string>
17#include <vector>
18
Danil Chapovalov66cadcc2018-06-19 16:47:43 +020019#include "absl/types/optional.h"
Zhi Huange818b6e2018-02-22 15:26:27 -080020#include "api/candidate.h"
Anton Sukhanov292ce4e2019-06-03 13:00:24 -070021#include "api/datagram_transport_interface.h"
Zhi Huange818b6e2018-02-22 15:26:27 -080022#include "api/jsep.h"
Anton Sukhanov7940da02018-10-10 10:34:49 -070023#include "api/media_transport_interface.h"
Steve Anton10542f22019-01-11 09:11:00 -080024#include "p2p/base/dtls_transport.h"
25#include "p2p/base/p2p_constants.h"
26#include "p2p/base/transport_info.h"
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -070027#include "pc/composite_rtp_transport.h"
Steve Anton10542f22019-01-11 09:11:00 -080028#include "pc/dtls_srtp_transport.h"
29#include "pc/dtls_transport.h"
30#include "pc/rtcp_mux_filter.h"
31#include "pc/rtp_transport.h"
32#include "pc/session_description.h"
33#include "pc/srtp_filter.h"
34#include "pc/srtp_transport.h"
35#include "pc/transport_stats.h"
36#include "rtc_base/constructor_magic.h"
37#include "rtc_base/message_queue.h"
38#include "rtc_base/rtc_certificate.h"
39#include "rtc_base/ssl_stream_adapter.h"
Artem Titove41c4332018-07-25 15:04:28 +020040#include "rtc_base/third_party/sigslot/sigslot.h"
Harald Alvestrand78a5e962019-04-03 10:42:39 +020041#include "rtc_base/thread_checker.h"
Zhi Huange818b6e2018-02-22 15:26:27 -080042
43namespace cricket {
44
45class DtlsTransportInternal;
46
47struct JsepTransportDescription {
48 public:
49 JsepTransportDescription();
50 JsepTransportDescription(
51 bool rtcp_mux_enabled,
52 const std::vector<CryptoParams>& cryptos,
53 const std::vector<int>& encrypted_header_extension_ids,
Zhi Huange830e682018-03-30 10:48:35 -070054 int rtp_abs_sendtime_extn_id,
Zhi Huange818b6e2018-02-22 15:26:27 -080055 const TransportDescription& transport_description);
56 JsepTransportDescription(const JsepTransportDescription& from);
57 ~JsepTransportDescription();
58
59 JsepTransportDescription& operator=(const JsepTransportDescription& from);
60
61 bool rtcp_mux_enabled = true;
62 std::vector<CryptoParams> cryptos;
63 std::vector<int> encrypted_header_extension_ids;
Zhi Huange830e682018-03-30 10:48:35 -070064 int rtp_abs_sendtime_extn_id = -1;
Zhi Huange818b6e2018-02-22 15:26:27 -080065 // TODO(zhihuang): Add the ICE and DTLS related variables and methods from
66 // TransportDescription and remove this extra layer of abstraction.
67 TransportDescription transport_desc;
68};
69
70// Helper class used by JsepTransportController that processes
71// TransportDescriptions. A TransportDescription represents the
72// transport-specific properties of an SDP m= section, processed according to
73// JSEP. Each transport consists of DTLS and ICE transport channels for RTP
74// (and possibly RTCP, if rtcp-mux isn't used).
75//
Zhi Huang365381f2018-04-13 16:44:34 -070076// On Threading: JsepTransport performs work solely on the network thread, and
Zhi Huange818b6e2018-02-22 15:26:27 -080077// so its methods should only be called on the network thread.
Piotr (Peter) Slatala4eb41122018-11-01 07:26:03 -070078class JsepTransport : public sigslot::has_slots<>,
79 public webrtc::MediaTransportStateCallback {
Zhi Huange818b6e2018-02-22 15:26:27 -080080 public:
81 // |mid| is just used for log statements in order to identify the Transport.
82 // Note that |local_certificate| is allowed to be null since a remote
83 // description may be set before a local certificate is generated.
Anton Sukhanov7940da02018-10-10 10:34:49 -070084 //
85 // |media_trasport| is optional (experimental). If available it will be used
86 // to send / receive encoded audio and video frames instead of RTP.
87 // Currently |media_transport| can co-exist with RTP / RTCP transports.
Zhi Huang365381f2018-04-13 16:44:34 -070088 JsepTransport(
Zhi Huange818b6e2018-02-22 15:26:27 -080089 const std::string& mid,
90 const rtc::scoped_refptr<rtc::RTCCertificate>& local_certificate,
Bjorn A Mellem0c1c1b42019-05-29 17:34:13 -070091 std::unique_ptr<cricket::IceTransportInternal> ice_transport,
92 std::unique_ptr<cricket::IceTransportInternal> rtcp_ice_transport,
Zhi Huange818b6e2018-02-22 15:26:27 -080093 std::unique_ptr<webrtc::RtpTransport> unencrypted_rtp_transport,
94 std::unique_ptr<webrtc::SrtpTransport> sdes_transport,
95 std::unique_ptr<webrtc::DtlsSrtpTransport> dtls_srtp_transport,
Bjorn A Mellem364b2672019-08-20 16:58:03 -070096 std::unique_ptr<webrtc::RtpTransportInternal> datagram_rtp_transport,
Zhi Huange818b6e2018-02-22 15:26:27 -080097 std::unique_ptr<DtlsTransportInternal> rtp_dtls_transport,
Anton Sukhanov7940da02018-10-10 10:34:49 -070098 std::unique_ptr<DtlsTransportInternal> rtcp_dtls_transport,
Anton Sukhanov292ce4e2019-06-03 13:00:24 -070099 std::unique_ptr<webrtc::MediaTransportInterface> media_transport,
100 std::unique_ptr<webrtc::DatagramTransportInterface> datagram_transport);
Zhi Huange818b6e2018-02-22 15:26:27 -0800101
Zhi Huang365381f2018-04-13 16:44:34 -0700102 ~JsepTransport() override;
Zhi Huange818b6e2018-02-22 15:26:27 -0800103
104 // Returns the MID of this transport. This is only used for logging.
105 const std::string& mid() const { return mid_; }
106
107 // Must be called before applying local session description.
108 // Needed in order to verify the local fingerprint.
109 void SetLocalCertificate(
110 const rtc::scoped_refptr<rtc::RTCCertificate>& local_certificate) {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200111 RTC_DCHECK_RUN_ON(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800112 local_certificate_ = local_certificate;
113 }
114
115 // Return the local certificate provided by SetLocalCertificate.
116 rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200117 RTC_DCHECK_RUN_ON(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800118 return local_certificate_;
119 }
120
121 webrtc::RTCError SetLocalJsepTransportDescription(
122 const JsepTransportDescription& jsep_description,
123 webrtc::SdpType type);
124
125 // Set the remote TransportDescription to be used by DTLS and ICE channels
126 // that are part of this Transport.
127 webrtc::RTCError SetRemoteJsepTransportDescription(
128 const JsepTransportDescription& jsep_description,
129 webrtc::SdpType type);
Zhi Huange818b6e2018-02-22 15:26:27 -0800130 webrtc::RTCError AddRemoteCandidates(const Candidates& candidates);
131
132 // Set the "needs-ice-restart" flag as described in JSEP. After the flag is
133 // set, offers should generate new ufrags/passwords until an ICE restart
134 // occurs.
135 //
136 // This and the below method can be called safely from any thread as long as
137 // SetXTransportDescription is not in progress.
138 void SetNeedsIceRestartFlag();
139 // Returns true if the ICE restart flag above was set, and no ICE restart has
140 // occurred yet for this transport (by applying a local description with
141 // changed ufrag/password).
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200142 bool needs_ice_restart() const {
143 rtc::CritScope scope(&accessor_lock_);
144 return needs_ice_restart_;
145 }
Zhi Huange818b6e2018-02-22 15:26:27 -0800146
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200147 // Returns role if negotiated, or empty absl::optional if it hasn't been
148 // negotiated yet.
149 absl::optional<rtc::SSLRole> GetDtlsRole() const;
Zhi Huange818b6e2018-02-22 15:26:27 -0800150
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700151 absl::optional<OpaqueTransportParameters> GetTransportParameters() const;
152
Zhi Huange818b6e2018-02-22 15:26:27 -0800153 // TODO(deadbeef): Make this const. See comment in transportcontroller.h.
154 bool GetStats(TransportStats* stats);
155
156 const JsepTransportDescription* local_description() const {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200157 RTC_DCHECK_RUN_ON(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800158 return local_description_.get();
159 }
160
161 const JsepTransportDescription* remote_description() const {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200162 RTC_DCHECK_RUN_ON(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800163 return remote_description_.get();
164 }
165
166 webrtc::RtpTransportInternal* rtp_transport() const {
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700167 rtc::CritScope scope(&accessor_lock_);
168 if (composite_rtp_transport_) {
169 return composite_rtp_transport_.get();
170 } else if (datagram_rtp_transport_) {
171 return datagram_rtp_transport_.get();
Zhi Huange818b6e2018-02-22 15:26:27 -0800172 } else {
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700173 return default_rtp_transport();
Zhi Huange818b6e2018-02-22 15:26:27 -0800174 }
175 }
176
Harald Alvestrandad88c882018-11-28 16:47:46 +0100177 const DtlsTransportInternal* rtp_dtls_transport() const {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200178 rtc::CritScope scope(&accessor_lock_);
Harald Alvestrandad88c882018-11-28 16:47:46 +0100179 if (rtp_dtls_transport_) {
180 return rtp_dtls_transport_->internal();
181 } else {
182 return nullptr;
183 }
Zhi Huange818b6e2018-02-22 15:26:27 -0800184 }
185
Harald Alvestrandad88c882018-11-28 16:47:46 +0100186 DtlsTransportInternal* rtp_dtls_transport() {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200187 rtc::CritScope scope(&accessor_lock_);
Harald Alvestrandad88c882018-11-28 16:47:46 +0100188 if (rtp_dtls_transport_) {
189 return rtp_dtls_transport_->internal();
190 } else {
191 return nullptr;
192 }
193 }
194
195 const DtlsTransportInternal* rtcp_dtls_transport() const {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200196 rtc::CritScope scope(&accessor_lock_);
Harald Alvestrandad88c882018-11-28 16:47:46 +0100197 if (rtcp_dtls_transport_) {
198 return rtcp_dtls_transport_->internal();
199 } else {
200 return nullptr;
201 }
202 }
203
204 DtlsTransportInternal* rtcp_dtls_transport() {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200205 rtc::CritScope scope(&accessor_lock_);
Harald Alvestrandad88c882018-11-28 16:47:46 +0100206 if (rtcp_dtls_transport_) {
207 return rtcp_dtls_transport_->internal();
208 } else {
209 return nullptr;
210 }
211 }
212
Harald Alvestrand4a7b3ac2019-01-17 10:39:40 +0100213 rtc::scoped_refptr<webrtc::DtlsTransport> RtpDtlsTransport() {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200214 rtc::CritScope scope(&accessor_lock_);
Harald Alvestrandad88c882018-11-28 16:47:46 +0100215 return rtp_dtls_transport_;
Zhi Huange818b6e2018-02-22 15:26:27 -0800216 }
217
Anton Sukhanov7940da02018-10-10 10:34:49 -0700218 // Returns media transport, if available.
219 // Note that media transport is owned by jseptransport and the pointer
220 // to media transport will becomes invalid after destruction of jseptransport.
221 webrtc::MediaTransportInterface* media_transport() const {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200222 rtc::CritScope scope(&accessor_lock_);
Anton Sukhanov7940da02018-10-10 10:34:49 -0700223 return media_transport_.get();
224 }
225
Anton Sukhanov316f3ac2019-05-23 15:50:38 -0700226 // Returns datagram transport, if available.
227 webrtc::DatagramTransportInterface* datagram_transport() const {
228 rtc::CritScope scope(&accessor_lock_);
Anton Sukhanov292ce4e2019-06-03 13:00:24 -0700229 return datagram_transport_.get();
Anton Sukhanov316f3ac2019-05-23 15:50:38 -0700230 }
231
Piotr (Peter) Slatala4eb41122018-11-01 07:26:03 -0700232 // Returns the latest media transport state.
233 webrtc::MediaTransportState media_transport_state() const {
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200234 rtc::CritScope scope(&accessor_lock_);
Piotr (Peter) Slatala4eb41122018-11-01 07:26:03 -0700235 return media_transport_state_;
236 }
237
Zhi Huange818b6e2018-02-22 15:26:27 -0800238 // This is signaled when RTCP-mux becomes active and
239 // |rtcp_dtls_transport_| is destroyed. The JsepTransportController will
240 // handle the signal and update the aggregate transport states.
241 sigslot::signal<> SignalRtcpMuxActive;
242
Piotr (Peter) Slatala4eb41122018-11-01 07:26:03 -0700243 // This is signaled for changes in |media_transport_| state.
244 sigslot::signal<> SignalMediaTransportStateChanged;
245
Bjorn A Mellemb689af42019-08-21 10:44:59 -0700246 // Signals that a data channel transport was negotiated and may be used to
247 // send data. The first parameter is |this|. The second parameter is the
248 // transport that was negotiated, or null if negotiation rejected the data
249 // channel transport. The third parameter (bool) indicates whether the
250 // negotiation was provisional or final. If true, it is provisional, if
251 // false, it is final.
252 sigslot::signal3<JsepTransport*, webrtc::DataChannelTransportInterface*, bool>
253 SignalDataChannelTransportNegotiated;
254
Zhi Huange818b6e2018-02-22 15:26:27 -0800255 // TODO(deadbeef): The methods below are only public for testing. Should make
256 // them utility functions or objects so they can be tested independently from
257 // this class.
258
259 // Returns an error if the certificate's identity does not match the
260 // fingerprint, or either is NULL.
261 webrtc::RTCError VerifyCertificateFingerprint(
262 const rtc::RTCCertificate* certificate,
263 const rtc::SSLFingerprint* fingerprint) const;
264
Zhi Huangb57e1692018-06-12 11:41:11 -0700265 void SetActiveResetSrtpParams(bool active_reset_srtp_params);
266
Zhi Huange818b6e2018-02-22 15:26:27 -0800267 private:
268 bool SetRtcpMux(bool enable, webrtc::SdpType type, ContentSource source);
269
270 void ActivateRtcpMux();
271
272 bool SetSdes(const std::vector<CryptoParams>& cryptos,
273 const std::vector<int>& encrypted_extension_ids,
274 webrtc::SdpType type,
275 ContentSource source);
276
277 // Negotiates and sets the DTLS parameters based on the current local and
278 // remote transport description, such as the DTLS role to use, and whether
279 // DTLS should be activated.
280 //
281 // Called when an answer TransportDescription is applied.
282 webrtc::RTCError NegotiateAndSetDtlsParameters(
283 webrtc::SdpType local_description_type);
284
285 // Negotiates the DTLS role based off the offer and answer as specified by
286 // RFC 4145, section-4.1. Returns an RTCError if role cannot be determined
287 // from the local description and remote description.
288 webrtc::RTCError NegotiateDtlsRole(
289 webrtc::SdpType local_description_type,
290 ConnectionRole local_connection_role,
291 ConnectionRole remote_connection_role,
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200292 absl::optional<rtc::SSLRole>* negotiated_dtls_role);
Zhi Huange818b6e2018-02-22 15:26:27 -0800293
294 // Pushes down the ICE parameters from the local description, such
295 // as the ICE ufrag and pwd.
296 void SetLocalIceParameters(IceTransportInternal* ice);
297
298 // Pushes down the ICE parameters from the remote description.
299 void SetRemoteIceParameters(IceTransportInternal* ice);
300
301 // Pushes down the DTLS parameters obtained via negotiation.
302 webrtc::RTCError SetNegotiatedDtlsParameters(
303 DtlsTransportInternal* dtls_transport,
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200304 absl::optional<rtc::SSLRole> dtls_role,
Zhi Huange818b6e2018-02-22 15:26:27 -0800305 rtc::SSLFingerprint* remote_fingerprint);
306
307 bool GetTransportStats(DtlsTransportInternal* dtls_transport,
308 TransportStats* stats);
309
Piotr (Peter) Slatala4eb41122018-11-01 07:26:03 -0700310 // Invoked whenever the state of the media transport changes.
311 void OnStateChanged(webrtc::MediaTransportState state) override;
312
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700313 // Deactivates, signals removal, and deletes |composite_rtp_transport_| if the
314 // current state of negotiation is sufficient to determine which rtp_transport
Bjorn A Mellemb689af42019-08-21 10:44:59 -0700315 // and data channel transport to use.
316 void NegotiateDatagramTransport(webrtc::SdpType type)
317 RTC_RUN_ON(network_thread_);
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700318
319 // Returns the default (non-datagram) rtp transport, if any.
320 webrtc::RtpTransportInternal* default_rtp_transport() const
321 RTC_EXCLUSIVE_LOCKS_REQUIRED(accessor_lock_) {
322 if (dtls_srtp_transport_) {
323 return dtls_srtp_transport_.get();
324 } else if (sdes_transport_) {
325 return sdes_transport_.get();
326 } else if (unencrypted_rtp_transport_) {
327 return unencrypted_rtp_transport_.get();
328 } else {
329 return nullptr;
330 }
331 }
332
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200333 // Owning thread, for safety checks
334 const rtc::Thread* const network_thread_;
335 // Critical scope for fields accessed off-thread
336 // TODO(https://bugs.webrtc.org/10300): Stop doing this.
337 rtc::CriticalSection accessor_lock_;
Zhi Huange818b6e2018-02-22 15:26:27 -0800338 const std::string mid_;
339 // needs-ice-restart bit as described in JSEP.
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200340 bool needs_ice_restart_ RTC_GUARDED_BY(accessor_lock_) = false;
341 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_
342 RTC_GUARDED_BY(network_thread_);
343 std::unique_ptr<JsepTransportDescription> local_description_
344 RTC_GUARDED_BY(network_thread_);
345 std::unique_ptr<JsepTransportDescription> remote_description_
346 RTC_GUARDED_BY(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800347
Bjorn A Mellem0c1c1b42019-05-29 17:34:13 -0700348 // Ice transport which may be used by any of upper-layer transports (below).
349 // Owned by JsepTransport and guaranteed to outlive the transports below.
350 const std::unique_ptr<cricket::IceTransportInternal> ice_transport_;
351 const std::unique_ptr<cricket::IceTransportInternal> rtcp_ice_transport_;
352
Zhi Huange818b6e2018-02-22 15:26:27 -0800353 // To avoid downcasting and make it type safe, keep three unique pointers for
354 // different SRTP mode and only one of these is non-nullptr.
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700355 std::unique_ptr<webrtc::RtpTransport> unencrypted_rtp_transport_
356 RTC_GUARDED_BY(accessor_lock_);
357 std::unique_ptr<webrtc::SrtpTransport> sdes_transport_
358 RTC_GUARDED_BY(accessor_lock_);
359 std::unique_ptr<webrtc::DtlsSrtpTransport> dtls_srtp_transport_
360 RTC_GUARDED_BY(accessor_lock_);
Bjorn A Mellem364b2672019-08-20 16:58:03 -0700361 std::unique_ptr<webrtc::RtpTransportInternal> datagram_rtp_transport_
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700362 RTC_GUARDED_BY(accessor_lock_);
363
364 // If multiple RTP transports are in use, |composite_rtp_transport_| will be
365 // passed to callers. This is only valid for offer-only, receive-only
366 // scenarios, as it is not possible for the composite to correctly choose
367 // which transport to use for sending.
368 std::unique_ptr<webrtc::CompositeRtpTransport> composite_rtp_transport_
369 RTC_GUARDED_BY(accessor_lock_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800370
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200371 rtc::scoped_refptr<webrtc::DtlsTransport> rtp_dtls_transport_
372 RTC_GUARDED_BY(accessor_lock_);
373 rtc::scoped_refptr<webrtc::DtlsTransport> rtcp_dtls_transport_
374 RTC_GUARDED_BY(accessor_lock_);
Bjorn A Mellemc85ebbe2019-06-07 10:28:06 -0700375 rtc::scoped_refptr<webrtc::DtlsTransport> datagram_dtls_transport_
376 RTC_GUARDED_BY(accessor_lock_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800377
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200378 SrtpFilter sdes_negotiator_ RTC_GUARDED_BY(network_thread_);
379 RtcpMuxFilter rtcp_mux_negotiator_ RTC_GUARDED_BY(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800380
381 // Cache the encrypted header extension IDs for SDES negoitation.
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200382 absl::optional<std::vector<int>> send_extension_ids_
383 RTC_GUARDED_BY(network_thread_);
384 absl::optional<std::vector<int>> recv_extension_ids_
385 RTC_GUARDED_BY(network_thread_);
Zhi Huange818b6e2018-02-22 15:26:27 -0800386
Anton Sukhanov7940da02018-10-10 10:34:49 -0700387 // Optional media transport (experimental).
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200388 std::unique_ptr<webrtc::MediaTransportInterface> media_transport_
389 RTC_GUARDED_BY(accessor_lock_);
Anton Sukhanov7940da02018-10-10 10:34:49 -0700390
Anton Sukhanov292ce4e2019-06-03 13:00:24 -0700391 // Optional datagram transport (experimental).
392 std::unique_ptr<webrtc::DatagramTransportInterface> datagram_transport_
393 RTC_GUARDED_BY(accessor_lock_);
394
Piotr (Peter) Slatala4eb41122018-11-01 07:26:03 -0700395 // If |media_transport_| is provided, this variable represents the state of
396 // media transport.
Anton Sukhanov316f3ac2019-05-23 15:50:38 -0700397 //
398 // NOTE: datagram transport state is handled by DatagramDtlsAdaptor, because
399 // DatagramDtlsAdaptor owns DatagramTransport. This state only represents
400 // media transport.
Harald Alvestrand78a5e962019-04-03 10:42:39 +0200401 webrtc::MediaTransportState media_transport_state_
402 RTC_GUARDED_BY(accessor_lock_) = webrtc::MediaTransportState::kPending;
Piotr (Peter) Slatala4eb41122018-11-01 07:26:03 -0700403
Zhi Huang365381f2018-04-13 16:44:34 -0700404 RTC_DISALLOW_COPY_AND_ASSIGN(JsepTransport);
Zhi Huange818b6e2018-02-22 15:26:27 -0800405};
406
407} // namespace cricket
408
Steve Anton10542f22019-01-11 09:11:00 -0800409#endif // PC_JSEP_TRANSPORT_H_