blob: f28c10c2dbb1d775a5894ae7cb5551779fe3bc99 [file] [log] [blame]
Zhi Huange818b6e2018-02-22 15:26:27 -08001/*
2 * Copyright 2017 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_CONTROLLER_H_
12#define PC_JSEP_TRANSPORT_CONTROLLER_H_
Zhi Huange818b6e2018-02-22 15:26:27 -080013
14#include <map>
15#include <memory>
16#include <string>
17#include <utility>
18#include <vector>
19
20#include "api/candidate.h"
Steve Anton10542f22019-01-11 09:11:00 -080021#include "api/crypto/crypto_options.h"
Anton Sukhanov7940da02018-10-10 10:34:49 -070022#include "api/media_transport_interface.h"
Steve Anton10542f22019-01-11 09:11:00 -080023#include "api/peer_connection_interface.h"
Qingsi Wang7685e862018-06-11 20:15:46 -070024#include "logging/rtc_event_log/rtc_event_log.h"
Steve Anton10542f22019-01-11 09:11:00 -080025#include "media/sctp/sctp_transport_internal.h"
26#include "p2p/base/dtls_transport.h"
27#include "p2p/base/p2p_transport_channel.h"
28#include "p2p/base/transport_factory_interface.h"
Zhi Huange818b6e2018-02-22 15:26:27 -080029#include "pc/channel.h"
Steve Anton10542f22019-01-11 09:11:00 -080030#include "pc/dtls_srtp_transport.h"
31#include "pc/dtls_transport.h"
32#include "pc/jsep_transport.h"
33#include "pc/rtp_transport.h"
34#include "pc/srtp_transport.h"
35#include "rtc_base/async_invoker.h"
36#include "rtc_base/constructor_magic.h"
37#include "rtc_base/ref_counted_object.h"
Artem Titove41c4332018-07-25 15:04:28 +020038#include "rtc_base/third_party/sigslot/sigslot.h"
Zhi Huange818b6e2018-02-22 15:26:27 -080039
40namespace rtc {
41class Thread;
42class PacketTransportInternal;
43} // namespace rtc
44
45namespace webrtc {
46
Steve Antond25828a2018-08-31 13:06:05 -070047class JsepTransportController : public sigslot::has_slots<> {
Zhi Huange818b6e2018-02-22 15:26:27 -080048 public:
Zhi Huang365381f2018-04-13 16:44:34 -070049 // Used when the RtpTransport/DtlsTransport of the m= section is changed
50 // because the section is rejected or BUNDLE is enabled.
51 class Observer {
52 public:
53 virtual ~Observer() {}
54
55 // Returns true if media associated with |mid| was successfully set up to be
56 // demultiplexed on |rtp_transport|. Could return false if two bundled m=
57 // sections use the same SSRC, for example.
Taylor Brandstettercbaa2542018-04-16 16:42:14 -070058 virtual bool OnTransportChanged(
Zhi Huang365381f2018-04-13 16:44:34 -070059 const std::string& mid,
Taylor Brandstettercbaa2542018-04-16 16:42:14 -070060 RtpTransportInternal* rtp_transport,
Piotr (Peter) Slatalacc8e8bb2018-11-15 08:26:19 -080061 cricket::DtlsTransportInternal* dtls_transport,
62 MediaTransportInterface* media_transport) = 0;
Zhi Huang365381f2018-04-13 16:44:34 -070063 };
64
Zhi Huange818b6e2018-02-22 15:26:27 -080065 struct Config {
66 // If |redetermine_role_on_ice_restart| is true, ICE role is redetermined
67 // upon setting a local transport description that indicates an ICE
68 // restart.
69 bool redetermine_role_on_ice_restart = true;
70 rtc::SSLProtocolVersion ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12;
71 // |crypto_options| is used to determine if created DTLS transports
72 // negotiate GCM crypto suites or not.
Benjamin Wrighta54daf12018-10-11 15:33:17 -070073 webrtc::CryptoOptions crypto_options;
Zhi Huange818b6e2018-02-22 15:26:27 -080074 PeerConnectionInterface::BundlePolicy bundle_policy =
75 PeerConnectionInterface::kBundlePolicyBalanced;
76 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy =
77 PeerConnectionInterface::kRtcpMuxPolicyRequire;
78 bool disable_encryption = false;
79 bool enable_external_auth = false;
80 // Used to inject the ICE/DTLS transports created externally.
81 cricket::TransportFactoryInterface* external_transport_factory = nullptr;
Zhi Huang365381f2018-04-13 16:44:34 -070082 Observer* transport_observer = nullptr;
Zhi Huangb57e1692018-06-12 11:41:11 -070083 bool active_reset_srtp_params = false;
Qingsi Wang7685e862018-06-11 20:15:46 -070084 RtcEventLog* event_log = nullptr;
Anton Sukhanov7940da02018-10-10 10:34:49 -070085
Piotr (Peter) Slatala55b91b92019-01-25 13:31:15 -080086 // Whether media transport is used for media.
87 bool use_media_transport_for_media = false;
88
89 // Whether media transport is used for data channels.
90 bool use_media_transport_for_data_channels = false;
91
Anton Sukhanov7940da02018-10-10 10:34:49 -070092 // Optional media transport factory (experimental). If provided it will be
Piotr (Peter) Slatala55b91b92019-01-25 13:31:15 -080093 // used to create media_transport (as long as either
94 // |use_media_transport_for_media| or
95 // |use_media_transport_for_data_channels| is set to true). However, whether
96 // it will be used to send / receive audio and video frames instead of RTP
97 // is determined by |use_media_transport_for_media|. Note that currently
98 // media_transport co-exists with RTP / RTCP transports and may use the same
Anton Sukhanov7940da02018-10-10 10:34:49 -070099 // underlying ICE transport.
100 MediaTransportFactory* media_transport_factory = nullptr;
Zhi Huange818b6e2018-02-22 15:26:27 -0800101 };
102
103 // The ICE related events are signaled on the |signaling_thread|.
104 // All the transport related methods are called on the |network_thread|.
105 JsepTransportController(rtc::Thread* signaling_thread,
106 rtc::Thread* network_thread,
107 cricket::PortAllocator* port_allocator,
Zach Steine20867f2018-08-02 13:20:15 -0700108 AsyncResolverFactory* async_resolver_factory,
Zhi Huange818b6e2018-02-22 15:26:27 -0800109 Config config);
110 virtual ~JsepTransportController();
111
112 // The main method to be called; applies a description at the transport
113 // level, creating/destroying transport objects as needed and updating their
114 // properties. This includes RTP, DTLS, and ICE (but not SCTP). At least not
115 // yet? May make sense to in the future.
116 RTCError SetLocalDescription(SdpType type,
117 const cricket::SessionDescription* description);
118
119 RTCError SetRemoteDescription(SdpType type,
120 const cricket::SessionDescription* description);
121
122 // Get transports to be used for the provided |mid|. If bundling is enabled,
123 // calling GetRtpTransport for multiple MIDs may yield the same object.
124 RtpTransportInternal* GetRtpTransport(const std::string& mid) const;
Harald Alvestrandad88c882018-11-28 16:47:46 +0100125 cricket::DtlsTransportInternal* GetDtlsTransport(const std::string& mid);
126 const cricket::DtlsTransportInternal* GetRtcpDtlsTransport(
Zhi Huange818b6e2018-02-22 15:26:27 -0800127 const std::string& mid) const;
Harald Alvestrandad88c882018-11-28 16:47:46 +0100128 // Gets the externally sharable version of the DtlsTransport.
Harald Alvestrand4a7b3ac2019-01-17 10:39:40 +0100129 rtc::scoped_refptr<webrtc::DtlsTransport> LookupDtlsTransportByMid(
Harald Alvestrandad88c882018-11-28 16:47:46 +0100130 const std::string& mid);
Zhi Huange818b6e2018-02-22 15:26:27 -0800131
Anton Sukhanov7940da02018-10-10 10:34:49 -0700132 MediaTransportInterface* GetMediaTransport(const std::string& mid) const;
Bjorn Mellem175aa2e2018-11-08 11:23:22 -0800133 MediaTransportState GetMediaTransportState(const std::string& mid) const;
Anton Sukhanov7940da02018-10-10 10:34:49 -0700134
Zhi Huange818b6e2018-02-22 15:26:27 -0800135 /*********************
136 * ICE-related methods
137 ********************/
138 // This method is public to allow PeerConnection to update it from
139 // SetConfiguration.
140 void SetIceConfig(const cricket::IceConfig& config);
141 // Set the "needs-ice-restart" flag as described in JSEP. After the flag is
142 // set, offers should generate new ufrags/passwords until an ICE restart
143 // occurs.
144 void SetNeedsIceRestartFlag();
145 // Returns true if the ICE restart flag above was set, and no ICE restart has
146 // occurred yet for this transport (by applying a local description with
147 // changed ufrag/password). If the transport has been deleted as a result of
148 // bundling, returns false.
149 bool NeedsIceRestart(const std::string& mid) const;
150 // Start gathering candidates for any new transports, or transports doing an
151 // ICE restart.
152 void MaybeStartGathering();
153 RTCError AddRemoteCandidates(
154 const std::string& mid,
155 const std::vector<cricket::Candidate>& candidates);
156 RTCError RemoveRemoteCandidates(
157 const std::vector<cricket::Candidate>& candidates);
158
159 /**********************
160 * DTLS-related methods
161 *********************/
162 // Specifies the identity to use in this session.
163 // Can only be called once.
164 bool SetLocalCertificate(
165 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate);
166 rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate(
167 const std::string& mid) const;
Taylor Brandstetterc3928662018-02-23 13:04:51 -0800168 // Caller owns returned certificate chain. This method mainly exists for
169 // stats reporting.
170 std::unique_ptr<rtc::SSLCertChain> GetRemoteSSLCertChain(
Zhi Huange818b6e2018-02-22 15:26:27 -0800171 const std::string& mid) const;
172 // Get negotiated role, if one has been negotiated.
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200173 absl::optional<rtc::SSLRole> GetDtlsRole(const std::string& mid) const;
Zhi Huange818b6e2018-02-22 15:26:27 -0800174
175 // TODO(deadbeef): GetStats isn't const because all the way down to
176 // OpenSSLStreamAdapter, GetSslCipherSuite and GetDtlsSrtpCryptoSuite are not
177 // const. Fix this.
178 bool GetStats(const std::string& mid, cricket::TransportStats* stats);
Zhi Huange818b6e2018-02-22 15:26:27 -0800179
Zhi Huange830e682018-03-30 10:48:35 -0700180 bool initial_offerer() const { return initial_offerer_ && *initial_offerer_; }
Zhi Huang365381f2018-04-13 16:44:34 -0700181
Zhi Huangb57e1692018-06-12 11:41:11 -0700182 void SetActiveResetSrtpParams(bool active_reset_srtp_params);
183
Piotr (Peter) Slatala97fc11f2018-10-18 12:57:59 -0700184 // Allows to overwrite the settings from config. You may set or reset the
Piotr (Peter) Slatala55b91b92019-01-25 13:31:15 -0800185 // media transport configuration on the jsep transport controller, as long as
186 // you did not call 'GetMediaTransport' or 'MaybeCreateJsepTransport'. Once
187 // Jsep transport is created, you can't change this setting.
188 void SetMediaTransportSettings(bool use_media_transport_for_media,
189 bool use_media_transport_for_data_channels);
Piotr (Peter) Slatala97fc11f2018-10-18 12:57:59 -0700190
Zhi Huange818b6e2018-02-22 15:26:27 -0800191 // All of these signals are fired on the signaling thread.
192
193 // If any transport failed => failed,
194 // Else if all completed => completed,
195 // Else if all connected => connected,
196 // Else => connecting
Alex Loiko9289eda2018-11-23 16:18:59 +0000197 sigslot::signal1<cricket::IceConnectionState> SignalIceConnectionState;
Zhi Huange818b6e2018-02-22 15:26:27 -0800198
Jonas Olsson635474e2018-10-18 15:58:17 +0200199 sigslot::signal1<PeerConnectionInterface::PeerConnectionState>
200 SignalConnectionState;
Alex Loiko9289eda2018-11-23 16:18:59 +0000201 sigslot::signal1<PeerConnectionInterface::IceConnectionState>
202 SignalStandardizedIceConnectionState;
Jonas Olsson635474e2018-10-18 15:58:17 +0200203
Zhi Huange818b6e2018-02-22 15:26:27 -0800204 // If all transports done gathering => complete,
205 // Else if any are gathering => gathering,
206 // Else => new
207 sigslot::signal1<cricket::IceGatheringState> SignalIceGatheringState;
208
209 // (mid, candidates)
210 sigslot::signal2<const std::string&, const std::vector<cricket::Candidate>&>
211 SignalIceCandidatesGathered;
212
213 sigslot::signal1<const std::vector<cricket::Candidate>&>
214 SignalIceCandidatesRemoved;
215
216 sigslot::signal1<rtc::SSLHandshakeError> SignalDtlsHandshakeError;
217
Bjorn Mellem175aa2e2018-11-08 11:23:22 -0800218 sigslot::signal<> SignalMediaTransportStateChanged;
219
Zhi Huange818b6e2018-02-22 15:26:27 -0800220 private:
Zhi Huange818b6e2018-02-22 15:26:27 -0800221 RTCError ApplyDescription_n(bool local,
222 SdpType type,
223 const cricket::SessionDescription* description);
Zhi Huangd2248f82018-04-10 14:41:03 -0700224 RTCError ValidateAndMaybeUpdateBundleGroup(
225 bool local,
226 SdpType type,
227 const cricket::SessionDescription* description);
Zhi Huange830e682018-03-30 10:48:35 -0700228 RTCError ValidateContent(const cricket::ContentInfo& content_info);
Zhi Huange818b6e2018-02-22 15:26:27 -0800229
Taylor Brandstettercbaa2542018-04-16 16:42:14 -0700230 void HandleRejectedContent(const cricket::ContentInfo& content_info,
Zhi Huangd2248f82018-04-10 14:41:03 -0700231 const cricket::SessionDescription* description);
Zhi Huang365381f2018-04-13 16:44:34 -0700232 bool HandleBundledContent(const cricket::ContentInfo& content_info);
Zhi Huange818b6e2018-02-22 15:26:27 -0800233
Zhi Huang365381f2018-04-13 16:44:34 -0700234 bool SetTransportForMid(const std::string& mid,
Taylor Brandstettercbaa2542018-04-16 16:42:14 -0700235 cricket::JsepTransport* jsep_transport);
236 void RemoveTransportForMid(const std::string& mid);
Zhi Huangd2248f82018-04-10 14:41:03 -0700237
Zhi Huange818b6e2018-02-22 15:26:27 -0800238 cricket::JsepTransportDescription CreateJsepTransportDescription(
239 cricket::ContentInfo content_info,
240 cricket::TransportInfo transport_info,
Zhi Huange830e682018-03-30 10:48:35 -0700241 const std::vector<int>& encrypted_extension_ids,
242 int rtp_abs_sendtime_extn_id);
Zhi Huange818b6e2018-02-22 15:26:27 -0800243
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200244 absl::optional<std::string> bundled_mid() const {
245 absl::optional<std::string> bundled_mid;
Taylor Brandstetter0ab56512018-04-12 10:30:48 -0700246 if (bundle_group_ && bundle_group_->FirstContentName()) {
247 bundled_mid = *(bundle_group_->FirstContentName());
Zhi Huange818b6e2018-02-22 15:26:27 -0800248 }
249 return bundled_mid;
250 }
251
252 bool IsBundled(const std::string& mid) const {
253 return bundle_group_ && bundle_group_->HasContentName(mid);
254 }
255
256 bool ShouldUpdateBundleGroup(SdpType type,
257 const cricket::SessionDescription* description);
258
259 std::vector<int> MergeEncryptedHeaderExtensionIdsForBundle(
260 const cricket::SessionDescription* description);
Zhi Huange818b6e2018-02-22 15:26:27 -0800261 std::vector<int> GetEncryptedHeaderExtensionIds(
262 const cricket::ContentInfo& content_info);
263
Zhi Huange830e682018-03-30 10:48:35 -0700264 int GetRtpAbsSendTimeHeaderExtensionId(
265 const cricket::ContentInfo& content_info);
Zhi Huange818b6e2018-02-22 15:26:27 -0800266
Zhi Huange830e682018-03-30 10:48:35 -0700267 // This method takes the BUNDLE group into account. If the JsepTransport is
268 // destroyed because of BUNDLE, it would return the transport which other
269 // transports are bundled on (In current implementation, it is the first
270 // content in the BUNDLE group).
Zhi Huang365381f2018-04-13 16:44:34 -0700271 const cricket::JsepTransport* GetJsepTransportForMid(
Zhi Huange830e682018-03-30 10:48:35 -0700272 const std::string& mid) const;
Zhi Huang365381f2018-04-13 16:44:34 -0700273 cricket::JsepTransport* GetJsepTransportForMid(const std::string& mid);
Zhi Huange830e682018-03-30 10:48:35 -0700274
275 // Get the JsepTransport without considering the BUNDLE group. Return nullptr
276 // if the JsepTransport is destroyed.
Zhi Huang365381f2018-04-13 16:44:34 -0700277 const cricket::JsepTransport* GetJsepTransportByName(
Zhi Huange830e682018-03-30 10:48:35 -0700278 const std::string& transport_name) const;
Zhi Huang365381f2018-04-13 16:44:34 -0700279 cricket::JsepTransport* GetJsepTransportByName(
Zhi Huange830e682018-03-30 10:48:35 -0700280 const std::string& transport_name);
281
Anton Sukhanov7940da02018-10-10 10:34:49 -0700282 // Creates jsep transport. Noop if transport is already created.
283 // Transport is created either during SetLocalDescription (|local| == true) or
284 // during SetRemoteDescription (|local| == false). Passing |local| helps to
285 // differentiate initiator (caller) from answerer (callee).
286 RTCError MaybeCreateJsepTransport(bool local,
287 const cricket::ContentInfo& content_info);
Piotr (Peter) Slatala47dfdca2018-11-16 14:13:58 -0800288
289 // Creates media transport if config wants to use it, and pre-shared key is
290 // provided in content info. It modifies the config to disable media transport
291 // if pre-shared key is not provided.
292 std::unique_ptr<webrtc::MediaTransportInterface> MaybeCreateMediaTransport(
293 const cricket::ContentInfo& content_info,
294 bool local,
295 cricket::IceTransportInternal* ice_transport);
Zhi Huange818b6e2018-02-22 15:26:27 -0800296 void MaybeDestroyJsepTransport(const std::string& mid);
297 void DestroyAllJsepTransports_n();
298
299 void SetIceRole_n(cricket::IceRole ice_role);
300
301 cricket::IceRole DetermineIceRole(
Zhi Huang365381f2018-04-13 16:44:34 -0700302 cricket::JsepTransport* jsep_transport,
Zhi Huange818b6e2018-02-22 15:26:27 -0800303 const cricket::TransportInfo& transport_info,
304 SdpType type,
305 bool local);
306
307 std::unique_ptr<cricket::DtlsTransportInternal> CreateDtlsTransport(
Piotr (Peter) Slatala2b5baee2019-01-16 08:25:21 -0800308 std::unique_ptr<cricket::IceTransportInternal> ice);
309 std::unique_ptr<cricket::IceTransportInternal> CreateIceTransport(
310 const std::string transport_name,
Zhi Huange818b6e2018-02-22 15:26:27 -0800311 bool rtcp);
312
313 std::unique_ptr<webrtc::RtpTransport> CreateUnencryptedRtpTransport(
314 const std::string& transport_name,
315 rtc::PacketTransportInternal* rtp_packet_transport,
316 rtc::PacketTransportInternal* rtcp_packet_transport);
317 std::unique_ptr<webrtc::SrtpTransport> CreateSdesTransport(
318 const std::string& transport_name,
Zhi Huange830e682018-03-30 10:48:35 -0700319 cricket::DtlsTransportInternal* rtp_dtls_transport,
320 cricket::DtlsTransportInternal* rtcp_dtls_transport);
Zhi Huange818b6e2018-02-22 15:26:27 -0800321 std::unique_ptr<webrtc::DtlsSrtpTransport> CreateDtlsSrtpTransport(
322 const std::string& transport_name,
323 cricket::DtlsTransportInternal* rtp_dtls_transport,
324 cricket::DtlsTransportInternal* rtcp_dtls_transport);
325
326 // Collect all the DtlsTransports, including RTP and RTCP, from the
327 // JsepTransports. JsepTransportController can iterate all the DtlsTransports
328 // and update the aggregate states.
329 std::vector<cricket::DtlsTransportInternal*> GetDtlsTransports();
330
331 // Handlers for signals from Transport.
332 void OnTransportWritableState_n(rtc::PacketTransportInternal* transport);
333 void OnTransportReceivingState_n(rtc::PacketTransportInternal* transport);
334 void OnTransportGatheringState_n(cricket::IceTransportInternal* transport);
335 void OnTransportCandidateGathered_n(cricket::IceTransportInternal* transport,
336 const cricket::Candidate& candidate);
Zhi Huange818b6e2018-02-22 15:26:27 -0800337 void OnTransportCandidatesRemoved_n(cricket::IceTransportInternal* transport,
338 const cricket::Candidates& candidates);
339 void OnTransportRoleConflict_n(cricket::IceTransportInternal* transport);
340 void OnTransportStateChanged_n(cricket::IceTransportInternal* transport);
Bjorn Mellem175aa2e2018-11-08 11:23:22 -0800341 void OnMediaTransportStateChanged_n();
Zhi Huange818b6e2018-02-22 15:26:27 -0800342
343 void UpdateAggregateStates_n();
344
345 void OnDtlsHandshakeError(rtc::SSLHandshakeError error);
346
347 rtc::Thread* const signaling_thread_ = nullptr;
348 rtc::Thread* const network_thread_ = nullptr;
349 cricket::PortAllocator* const port_allocator_ = nullptr;
Zach Steine20867f2018-08-02 13:20:15 -0700350 AsyncResolverFactory* const async_resolver_factory_ = nullptr;
Zhi Huange818b6e2018-02-22 15:26:27 -0800351
Zhi Huang365381f2018-04-13 16:44:34 -0700352 std::map<std::string, std::unique_ptr<cricket::JsepTransport>>
Zhi Huange830e682018-03-30 10:48:35 -0700353 jsep_transports_by_name_;
Zhi Huangd2248f82018-04-10 14:41:03 -0700354 // This keeps track of the mapping between media section
Zhi Huang365381f2018-04-13 16:44:34 -0700355 // (BaseChannel/SctpTransport) and the JsepTransport underneath.
356 std::map<std::string, cricket::JsepTransport*> mid_to_transport_;
Zhi Huange818b6e2018-02-22 15:26:27 -0800357
Jonas Olsson635474e2018-10-18 15:58:17 +0200358 // Aggregate states for Transports.
Alex Loiko9289eda2018-11-23 16:18:59 +0000359 // standardized_ice_connection_state_ is intended to replace
360 // ice_connection_state, see bugs.webrtc.org/9308
361 cricket::IceConnectionState ice_connection_state_ =
362 cricket::kIceConnectionConnecting;
363 PeerConnectionInterface::IceConnectionState
364 standardized_ice_connection_state_ =
365 PeerConnectionInterface::kIceConnectionNew;
Jonas Olsson635474e2018-10-18 15:58:17 +0200366 PeerConnectionInterface::PeerConnectionState combined_connection_state_ =
367 PeerConnectionInterface::PeerConnectionState::kNew;
Zhi Huange818b6e2018-02-22 15:26:27 -0800368 cricket::IceGatheringState ice_gathering_state_ = cricket::kIceGatheringNew;
369
370 Config config_;
Piotr (Peter) Slatala63a176b2019-01-25 08:25:33 -0800371 // Determines if Config::media_transport_factory should be used
372 // to create a media transport. (when falling back to RTP this may be false).
373 // This is a prerequisite, but is not sufficient to create media transport
374 // (the factory needs to be provided in the config, and config must allow for
375 // media transport).
376 bool is_media_transport_factory_enabled_ = true;
Zhi Huange818b6e2018-02-22 15:26:27 -0800377 const cricket::SessionDescription* local_desc_ = nullptr;
378 const cricket::SessionDescription* remote_desc_ = nullptr;
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200379 absl::optional<bool> initial_offerer_;
Zhi Huange818b6e2018-02-22 15:26:27 -0800380
Danil Chapovalov66cadcc2018-06-19 16:47:43 +0200381 absl::optional<cricket::ContentGroup> bundle_group_;
Zhi Huange818b6e2018-02-22 15:26:27 -0800382
383 cricket::IceConfig ice_config_;
384 cricket::IceRole ice_role_ = cricket::ICEROLE_CONTROLLING;
385 uint64_t ice_tiebreaker_ = rtc::CreateRandomId64();
386 rtc::scoped_refptr<rtc::RTCCertificate> certificate_;
387 rtc::AsyncInvoker invoker_;
388
Zhi Huange818b6e2018-02-22 15:26:27 -0800389 RTC_DISALLOW_COPY_AND_ASSIGN(JsepTransportController);
390};
391
392} // namespace webrtc
393
Steve Anton10542f22019-01-11 09:11:00 -0800394#endif // PC_JSEP_TRANSPORT_CONTROLLER_H_