OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include <string> | 31 #include <string> |
32 #include <vector> | 32 #include <vector> |
33 | 33 |
34 #include "talk/app/webrtc/datachannel.h" | 34 #include "talk/app/webrtc/datachannel.h" |
35 #include "talk/app/webrtc/dtmfsender.h" | 35 #include "talk/app/webrtc/dtmfsender.h" |
36 #include "talk/app/webrtc/mediacontroller.h" | 36 #include "talk/app/webrtc/mediacontroller.h" |
37 #include "talk/app/webrtc/mediastreamprovider.h" | 37 #include "talk/app/webrtc/mediastreamprovider.h" |
38 #include "talk/app/webrtc/peerconnectioninterface.h" | 38 #include "talk/app/webrtc/peerconnectioninterface.h" |
39 #include "talk/app/webrtc/statstypes.h" | 39 #include "talk/app/webrtc/statstypes.h" |
40 #include "talk/media/base/mediachannel.h" | 40 #include "talk/media/base/mediachannel.h" |
41 #include "webrtc/p2p/base/session.h" | 41 #include "webrtc/p2p/base/transportcontroller.h" |
42 #include "talk/session/media/mediasession.h" | 42 #include "talk/session/media/mediasession.h" |
43 #include "webrtc/base/sigslot.h" | 43 #include "webrtc/base/sigslot.h" |
44 #include "webrtc/base/sslidentity.h" | 44 #include "webrtc/base/sslidentity.h" |
45 #include "webrtc/base/thread.h" | 45 #include "webrtc/base/thread.h" |
46 | 46 |
47 namespace cricket { | 47 namespace cricket { |
48 | 48 |
49 class BaseChannel; | |
50 class ChannelManager; | 49 class ChannelManager; |
51 class DataChannel; | 50 class DataChannel; |
52 class StatsReport; | 51 class StatsReport; |
53 class VideoCapturer; | 52 class VideoCapturer; |
54 class VideoChannel; | 53 class VideoChannel; |
55 class VoiceChannel; | 54 class VoiceChannel; |
56 | 55 |
57 } // namespace cricket | 56 } // namespace cricket |
58 | 57 |
59 namespace webrtc { | 58 namespace webrtc { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // Called whenever the state changes between receiving and not receiving. | 104 // Called whenever the state changes between receiving and not receiving. |
106 virtual void OnIceConnectionReceivingChange(bool receiving) {} | 105 virtual void OnIceConnectionReceivingChange(bool receiving) {} |
107 | 106 |
108 protected: | 107 protected: |
109 ~IceObserver() {} | 108 ~IceObserver() {} |
110 | 109 |
111 private: | 110 private: |
112 RTC_DISALLOW_COPY_AND_ASSIGN(IceObserver); | 111 RTC_DISALLOW_COPY_AND_ASSIGN(IceObserver); |
113 }; | 112 }; |
114 | 113 |
115 class WebRtcSession : public cricket::BaseSession, | 114 // Statistics for all the transports of the session. |
116 public AudioProviderInterface, | 115 typedef std::map<std::string, cricket::TransportStats> TransportStatsMap; |
| 116 typedef std::map<std::string, std::string> ProxyTransportMap; |
| 117 |
| 118 // TODO(pthatcher): Think of a better name for this. We already have |
| 119 // a TransportStats in transport.h. Perhaps TransportsStats? |
| 120 struct SessionStats { |
| 121 ProxyTransportMap proxy_to_transport; |
| 122 TransportStatsMap transport_stats; |
| 123 }; |
| 124 |
| 125 // A WebRtcSession manages general session state. This includes negotiation |
| 126 // of both the application-level and network-level protocols: the former |
| 127 // defines what will be sent and the latter defines how it will be sent. Each |
| 128 // network-level protocol is represented by a Transport object. Each Transport |
| 129 // participates in the network-level negotiation. The individual streams of |
| 130 // packets are represented by TransportChannels. The application-level protocol |
| 131 // is represented by SessionDecription objects. |
| 132 class WebRtcSession : public AudioProviderInterface, |
117 public VideoProviderInterface, | 133 public VideoProviderInterface, |
118 public DtmfProviderInterface, | 134 public DtmfProviderInterface, |
119 public DataChannelProviderInterface { | 135 public DataChannelProviderInterface, |
| 136 public sigslot::has_slots<> { |
120 public: | 137 public: |
| 138 enum State { |
| 139 STATE_INIT = 0, |
| 140 STATE_SENTOFFER, // Sent offer, waiting for answer. |
| 141 STATE_RECEIVEDOFFER, // Received an offer. Need to send answer. |
| 142 STATE_SENTPRANSWER, // Sent provisional answer. Need to send answer. |
| 143 STATE_RECEIVEDPRANSWER, // Received provisional answer, waiting for answer. |
| 144 STATE_INPROGRESS, // Offer/answer exchange completed. |
| 145 STATE_CLOSED, // Close() was called. |
| 146 }; |
| 147 |
| 148 enum Error { |
| 149 ERROR_NONE = 0, // no error |
| 150 ERROR_CONTENT = 1, // channel errors in SetLocalContent/SetRemoteContent |
| 151 ERROR_TRANSPORT = 2, // transport error of some kind |
| 152 }; |
| 153 |
121 WebRtcSession(cricket::ChannelManager* channel_manager, | 154 WebRtcSession(cricket::ChannelManager* channel_manager, |
122 rtc::Thread* signaling_thread, | 155 rtc::Thread* signaling_thread, |
123 rtc::Thread* worker_thread, | 156 rtc::Thread* worker_thread, |
124 cricket::PortAllocator* port_allocator); | 157 cricket::PortAllocator* port_allocator); |
125 virtual ~WebRtcSession(); | 158 virtual ~WebRtcSession(); |
126 | 159 |
| 160 // These are const to allow them to be called from const methods. |
| 161 rtc::Thread* signaling_thread() const { return signaling_thread_; } |
| 162 rtc::Thread* worker_thread() const { return worker_thread_; } |
| 163 cricket::PortAllocator* port_allocator() const { return port_allocator_; } |
| 164 |
| 165 // The ID of this session. |
| 166 const std::string& id() const { return sid_; } |
| 167 |
127 bool Initialize( | 168 bool Initialize( |
128 const PeerConnectionFactoryInterface::Options& options, | 169 const PeerConnectionFactoryInterface::Options& options, |
129 const MediaConstraintsInterface* constraints, | 170 const MediaConstraintsInterface* constraints, |
130 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 171 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
131 const PeerConnectionInterface::RTCConfiguration& rtc_configuration); | 172 const PeerConnectionInterface::RTCConfiguration& rtc_configuration); |
132 // Deletes the voice, video and data channel and changes the session state | 173 // Deletes the voice, video and data channel and changes the session state |
133 // to STATE_RECEIVEDTERMINATE. | 174 // to STATE_CLOSED. |
134 void Terminate(); | 175 void Close(); |
| 176 |
| 177 // Returns true if we were the initial offerer. |
| 178 bool initial_offerer() const { return initial_offerer_; } |
| 179 |
| 180 // Returns the current state of the session. See the enum above for details. |
| 181 // Each time the state changes, we will fire this signal. |
| 182 State state() const { return state_; } |
| 183 sigslot::signal2<WebRtcSession*, State> SignalState; |
| 184 |
| 185 // Returns the last error in the session. See the enum above for details. |
| 186 Error error() const { return error_; } |
| 187 const std::string& error_desc() const { return error_desc_; } |
135 | 188 |
136 void RegisterIceObserver(IceObserver* observer) { | 189 void RegisterIceObserver(IceObserver* observer) { |
137 ice_observer_ = observer; | 190 ice_observer_ = observer; |
138 } | 191 } |
139 | 192 |
140 virtual cricket::VoiceChannel* voice_channel() { | 193 virtual cricket::VoiceChannel* voice_channel() { |
141 return voice_channel_.get(); | 194 return voice_channel_.get(); |
142 } | 195 } |
143 virtual cricket::VideoChannel* video_channel() { | 196 virtual cricket::VideoChannel* video_channel() { |
144 return video_channel_.get(); | 197 return video_channel_.get(); |
145 } | 198 } |
146 virtual cricket::DataChannel* data_channel() { | 199 virtual cricket::DataChannel* data_channel() { |
147 return data_channel_.get(); | 200 return data_channel_.get(); |
148 } | 201 } |
149 | 202 |
150 void SetSdesPolicy(cricket::SecurePolicy secure_policy); | 203 void SetSdesPolicy(cricket::SecurePolicy secure_policy); |
151 cricket::SecurePolicy SdesPolicy() const; | 204 cricket::SecurePolicy SdesPolicy() const; |
152 | 205 |
153 // Get current ssl role from transport. | 206 // Get current ssl role from transport. |
154 bool GetSslRole(rtc::SSLRole* role); | 207 bool GetSslRole(rtc::SSLRole* role); |
155 | 208 |
156 // Generic error message callback from WebRtcSession. | |
157 // TODO - It may be necessary to supply error code as well. | |
158 sigslot::signal0<> SignalError; | |
159 | |
160 void CreateOffer( | 209 void CreateOffer( |
161 CreateSessionDescriptionObserver* observer, | 210 CreateSessionDescriptionObserver* observer, |
162 const PeerConnectionInterface::RTCOfferAnswerOptions& options, | 211 const PeerConnectionInterface::RTCOfferAnswerOptions& options, |
163 const cricket::MediaSessionOptions& session_options); | 212 const cricket::MediaSessionOptions& session_options); |
164 void CreateAnswer(CreateSessionDescriptionObserver* observer, | 213 void CreateAnswer(CreateSessionDescriptionObserver* observer, |
165 const MediaConstraintsInterface* constraints, | 214 const MediaConstraintsInterface* constraints, |
166 const cricket::MediaSessionOptions& session_options); | 215 const cricket::MediaSessionOptions& session_options); |
167 // The ownership of |desc| will be transferred after this call. | 216 // The ownership of |desc| will be transferred after this call. |
168 bool SetLocalDescription(SessionDescriptionInterface* desc, | 217 bool SetLocalDescription(SessionDescriptionInterface* desc, |
169 std::string* err_desc); | 218 std::string* err_desc); |
170 // The ownership of |desc| will be transferred after this call. | 219 // The ownership of |desc| will be transferred after this call. |
171 bool SetRemoteDescription(SessionDescriptionInterface* desc, | 220 bool SetRemoteDescription(SessionDescriptionInterface* desc, |
172 std::string* err_desc); | 221 std::string* err_desc); |
173 bool ProcessIceMessage(const IceCandidateInterface* ice_candidate); | 222 bool ProcessIceMessage(const IceCandidateInterface* ice_candidate); |
174 | 223 |
175 bool SetIceTransports(PeerConnectionInterface::IceTransportsType type); | 224 bool SetIceTransports(PeerConnectionInterface::IceTransportsType type); |
176 | 225 |
177 cricket::IceConfig ParseIceConfig( | 226 cricket::IceConfig ParseIceConfig( |
178 const PeerConnectionInterface::RTCConfiguration& config) const; | 227 const PeerConnectionInterface::RTCConfiguration& config) const; |
179 | 228 |
| 229 void SetIceConfig(const cricket::IceConfig& ice_config); |
| 230 |
| 231 // Start gathering candidates for any new transports, or transports doing an |
| 232 // ICE restart. |
| 233 void MaybeStartGathering(); |
| 234 |
180 const SessionDescriptionInterface* local_description() const { | 235 const SessionDescriptionInterface* local_description() const { |
181 return local_desc_.get(); | 236 return local_desc_.get(); |
182 } | 237 } |
183 const SessionDescriptionInterface* remote_description() const { | 238 const SessionDescriptionInterface* remote_description() const { |
184 return remote_desc_.get(); | 239 return remote_desc_.get(); |
185 } | 240 } |
186 // TODO(pthatcher): Cleanup the distinction between | |
187 // SessionDescription and SessionDescriptionInterface and remove | |
188 // these if possible. | |
189 const cricket::SessionDescription* base_local_description() const { | |
190 return BaseSession::local_description(); | |
191 } | |
192 const cricket::SessionDescription* base_remote_description() const { | |
193 return BaseSession::remote_description(); | |
194 } | |
195 | 241 |
196 // Get the id used as a media stream track's "id" field from ssrc. | 242 // Get the id used as a media stream track's "id" field from ssrc. |
197 virtual bool GetLocalTrackIdBySsrc(uint32_t ssrc, std::string* track_id); | 243 virtual bool GetLocalTrackIdBySsrc(uint32_t ssrc, std::string* track_id); |
198 virtual bool GetRemoteTrackIdBySsrc(uint32_t ssrc, std::string* track_id); | 244 virtual bool GetRemoteTrackIdBySsrc(uint32_t ssrc, std::string* track_id); |
199 | 245 |
200 // AudioMediaProviderInterface implementation. | 246 // AudioMediaProviderInterface implementation. |
201 void SetAudioPlayout(uint32_t ssrc, bool enable) override; | 247 void SetAudioPlayout(uint32_t ssrc, bool enable) override; |
202 void SetAudioSend(uint32_t ssrc, | 248 void SetAudioSend(uint32_t ssrc, |
203 bool enable, | 249 bool enable, |
204 const cricket::AudioOptions& options, | 250 const cricket::AudioOptions& options, |
(...skipping 20 matching lines...) Expand all Loading... |
225 const rtc::Buffer& payload, | 271 const rtc::Buffer& payload, |
226 cricket::SendDataResult* result) override; | 272 cricket::SendDataResult* result) override; |
227 bool ConnectDataChannel(DataChannel* webrtc_data_channel) override; | 273 bool ConnectDataChannel(DataChannel* webrtc_data_channel) override; |
228 void DisconnectDataChannel(DataChannel* webrtc_data_channel) override; | 274 void DisconnectDataChannel(DataChannel* webrtc_data_channel) override; |
229 void AddSctpDataStream(int sid) override; | 275 void AddSctpDataStream(int sid) override; |
230 void RemoveSctpDataStream(int sid) override; | 276 void RemoveSctpDataStream(int sid) override; |
231 bool ReadyToSendData() const override; | 277 bool ReadyToSendData() const override; |
232 | 278 |
233 // Returns stats for all channels of all transports. | 279 // Returns stats for all channels of all transports. |
234 // This avoids exposing the internal structures used to track them. | 280 // This avoids exposing the internal structures used to track them. |
235 virtual bool GetTransportStats(cricket::SessionStats* stats); | 281 virtual bool GetTransportStats(SessionStats* stats); |
236 | 282 |
237 // Get stats for a specific channel | 283 // Get stats for a specific channel |
238 bool GetChannelTransportStats(cricket::BaseChannel* ch, | 284 bool GetChannelTransportStats(cricket::BaseChannel* ch, SessionStats* stats); |
239 cricket::SessionStats* stats); | |
240 | 285 |
241 // virtual so it can be mocked in unit tests | 286 // virtual so it can be mocked in unit tests |
242 virtual bool GetLocalCertificate( | 287 virtual bool GetLocalCertificate( |
243 const std::string& transport_name, | 288 const std::string& transport_name, |
244 rtc::scoped_refptr<rtc::RTCCertificate>* certificate); | 289 rtc::scoped_refptr<rtc::RTCCertificate>* certificate); |
245 | 290 |
246 // Caller owns returned certificate | 291 // Caller owns returned certificate |
247 virtual bool GetRemoteSSLCertificate(const std::string& transport_name, | 292 virtual bool GetRemoteSSLCertificate(const std::string& transport_name, |
248 rtc::SSLCertificate** cert); | 293 rtc::SSLCertificate** cert); |
249 | 294 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 329 |
285 private: | 330 private: |
286 // Indicates the type of SessionDescription in a call to SetLocalDescription | 331 // Indicates the type of SessionDescription in a call to SetLocalDescription |
287 // and SetRemoteDescription. | 332 // and SetRemoteDescription. |
288 enum Action { | 333 enum Action { |
289 kOffer, | 334 kOffer, |
290 kPrAnswer, | 335 kPrAnswer, |
291 kAnswer, | 336 kAnswer, |
292 }; | 337 }; |
293 | 338 |
| 339 // Log session state. |
| 340 void LogState(State old_state, State new_state); |
| 341 |
| 342 // Updates the state, signaling if necessary. |
| 343 virtual void SetState(State state); |
| 344 |
| 345 // Updates the error state, signaling if necessary. |
| 346 // TODO(ronghuawu): remove the SetError method that doesn't take |error_desc|. |
| 347 virtual void SetError(Error error, const std::string& error_desc); |
| 348 |
294 bool UpdateSessionState(Action action, cricket::ContentSource source, | 349 bool UpdateSessionState(Action action, cricket::ContentSource source, |
295 std::string* err_desc); | 350 std::string* err_desc); |
296 static Action GetAction(const std::string& type); | 351 static Action GetAction(const std::string& type); |
297 // Push the media parts of the local or remote session description | 352 // Push the media parts of the local or remote session description |
298 // down to all of the channels. | 353 // down to all of the channels. |
299 bool PushdownMediaDescription(cricket::ContentAction action, | 354 bool PushdownMediaDescription(cricket::ContentAction action, |
300 cricket::ContentSource source, | 355 cricket::ContentSource source, |
301 std::string* error_desc); | 356 std::string* error_desc); |
302 | 357 |
| 358 bool PushdownTransportDescription(cricket::ContentSource source, |
| 359 cricket::ContentAction action, |
| 360 std::string* error_desc); |
| 361 |
| 362 // Helper methods to push local and remote transport descriptions. |
| 363 bool PushdownLocalTransportDescription( |
| 364 const cricket::SessionDescription* sdesc, |
| 365 cricket::ContentAction action, |
| 366 std::string* error_desc); |
| 367 bool PushdownRemoteTransportDescription( |
| 368 const cricket::SessionDescription* sdesc, |
| 369 cricket::ContentAction action, |
| 370 std::string* error_desc); |
| 371 |
| 372 // Returns true and the TransportInfo of the given |content_name| |
| 373 // from |description|. Returns false if it's not available. |
| 374 static bool GetTransportDescription( |
| 375 const cricket::SessionDescription* description, |
| 376 const std::string& content_name, |
| 377 cricket::TransportDescription* info); |
| 378 |
303 cricket::BaseChannel* GetChannel(const std::string& content_name); | 379 cricket::BaseChannel* GetChannel(const std::string& content_name); |
304 // Cause all the BaseChannels in the bundle group to have the same | 380 // Cause all the BaseChannels in the bundle group to have the same |
305 // transport channel. | 381 // transport channel. |
306 bool EnableBundle(const cricket::ContentGroup& bundle); | 382 bool EnableBundle(const cricket::ContentGroup& bundle); |
307 | 383 |
308 // Enables media channels to allow sending of media. | 384 // Enables media channels to allow sending of media. |
309 void EnableChannels(); | 385 void EnableChannels(); |
310 // Returns the media index for a local ice candidate given the content name. | 386 // Returns the media index for a local ice candidate given the content name. |
311 // Returns false if the local session description does not have a media | 387 // Returns false if the local session description does not have a media |
312 // content called |content_name|. | 388 // content called |content_name|. |
(...skipping 11 matching lines...) Expand all Loading... |
324 // Allocates media channels based on the |desc|. If |desc| doesn't have | 400 // Allocates media channels based on the |desc|. If |desc| doesn't have |
325 // the BUNDLE option, this method will disable BUNDLE in PortAllocator. | 401 // the BUNDLE option, this method will disable BUNDLE in PortAllocator. |
326 // This method will also delete any existing media channels before creating. | 402 // This method will also delete any existing media channels before creating. |
327 bool CreateChannels(const cricket::SessionDescription* desc); | 403 bool CreateChannels(const cricket::SessionDescription* desc); |
328 | 404 |
329 // Helper methods to create media channels. | 405 // Helper methods to create media channels. |
330 bool CreateVoiceChannel(const cricket::ContentInfo* content); | 406 bool CreateVoiceChannel(const cricket::ContentInfo* content); |
331 bool CreateVideoChannel(const cricket::ContentInfo* content); | 407 bool CreateVideoChannel(const cricket::ContentInfo* content); |
332 bool CreateDataChannel(const cricket::ContentInfo* content); | 408 bool CreateDataChannel(const cricket::ContentInfo* content); |
333 | 409 |
334 // Copy the candidates from |saved_candidates_| to |dest_desc|. | |
335 // The |saved_candidates_| will be cleared after this function call. | |
336 void CopySavedCandidates(SessionDescriptionInterface* dest_desc); | |
337 | |
338 // Listens to SCTP CONTROL messages on unused SIDs and process them as OPEN | 410 // Listens to SCTP CONTROL messages on unused SIDs and process them as OPEN |
339 // messages. | 411 // messages. |
340 void OnDataChannelMessageReceived(cricket::DataChannel* channel, | 412 void OnDataChannelMessageReceived(cricket::DataChannel* channel, |
341 const cricket::ReceiveDataParams& params, | 413 const cricket::ReceiveDataParams& params, |
342 const rtc::Buffer& payload); | 414 const rtc::Buffer& payload); |
343 | 415 |
344 std::string BadStateErrMsg(State state); | 416 std::string BadStateErrMsg(State state); |
345 void SetIceConnectionState(PeerConnectionInterface::IceConnectionState state); | 417 void SetIceConnectionState(PeerConnectionInterface::IceConnectionState state); |
346 void SetIceConnectionReceiving(bool receiving); | 418 void SetIceConnectionReceiving(bool receiving); |
347 | 419 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 | 451 |
380 // Invoked when TransportController connection completion is signaled. | 452 // Invoked when TransportController connection completion is signaled. |
381 // Reports stats for all transports in use. | 453 // Reports stats for all transports in use. |
382 void ReportTransportStats(); | 454 void ReportTransportStats(); |
383 | 455 |
384 // Gather the usage of IPv4/IPv6 as best connection. | 456 // Gather the usage of IPv4/IPv6 as best connection. |
385 void ReportBestConnectionState(const cricket::TransportStats& stats); | 457 void ReportBestConnectionState(const cricket::TransportStats& stats); |
386 | 458 |
387 void ReportNegotiatedCiphers(const cricket::TransportStats& stats); | 459 void ReportNegotiatedCiphers(const cricket::TransportStats& stats); |
388 | 460 |
| 461 rtc::Thread* const signaling_thread_; |
| 462 rtc::Thread* const worker_thread_; |
| 463 cricket::PortAllocator* const port_allocator_; |
| 464 |
| 465 State state_ = STATE_INIT; |
| 466 Error error_ = ERROR_NONE; |
| 467 std::string error_desc_; |
| 468 |
| 469 const std::string sid_; |
| 470 bool initial_offerer_ = false; |
| 471 |
| 472 rtc::scoped_ptr<cricket::TransportController> transport_controller_; |
389 rtc::scoped_ptr<MediaControllerInterface> media_controller_; | 473 rtc::scoped_ptr<MediaControllerInterface> media_controller_; |
390 rtc::scoped_ptr<cricket::VoiceChannel> voice_channel_; | 474 rtc::scoped_ptr<cricket::VoiceChannel> voice_channel_; |
391 rtc::scoped_ptr<cricket::VideoChannel> video_channel_; | 475 rtc::scoped_ptr<cricket::VideoChannel> video_channel_; |
392 rtc::scoped_ptr<cricket::DataChannel> data_channel_; | 476 rtc::scoped_ptr<cricket::DataChannel> data_channel_; |
393 cricket::ChannelManager* channel_manager_; | 477 cricket::ChannelManager* channel_manager_; |
394 IceObserver* ice_observer_; | 478 IceObserver* ice_observer_; |
395 PeerConnectionInterface::IceConnectionState ice_connection_state_; | 479 PeerConnectionInterface::IceConnectionState ice_connection_state_; |
396 bool ice_connection_receiving_; | 480 bool ice_connection_receiving_; |
397 rtc::scoped_ptr<SessionDescriptionInterface> local_desc_; | 481 rtc::scoped_ptr<SessionDescriptionInterface> local_desc_; |
398 rtc::scoped_ptr<SessionDescriptionInterface> remote_desc_; | 482 rtc::scoped_ptr<SessionDescriptionInterface> remote_desc_; |
399 // Candidates that arrived before the remote description was set. | |
400 std::vector<IceCandidateInterface*> saved_candidates_; | |
401 // If the remote peer is using a older version of implementation. | 483 // If the remote peer is using a older version of implementation. |
402 bool older_version_remote_peer_; | 484 bool older_version_remote_peer_; |
403 bool dtls_enabled_; | 485 bool dtls_enabled_; |
404 // Specifies which kind of data channel is allowed. This is controlled | 486 // Specifies which kind of data channel is allowed. This is controlled |
405 // by the chrome command-line flag and constraints: | 487 // by the chrome command-line flag and constraints: |
406 // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled, | 488 // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled, |
407 // constraint kEnableDtlsSrtp is true, and constaint kEnableRtpDataChannels is | 489 // constraint kEnableDtlsSrtp is true, and constaint kEnableRtpDataChannels is |
408 // not set or false, SCTP is allowed (DCT_SCTP); | 490 // not set or false, SCTP is allowed (DCT_SCTP); |
409 // 2. If constraint kEnableRtpDataChannels is true, RTP is allowed (DCT_RTP); | 491 // 2. If constraint kEnableRtpDataChannels is true, RTP is allowed (DCT_RTP); |
410 // 3. If both 1&2 are false, data channel is not allowed (DCT_NONE). | 492 // 3. If both 1&2 are false, data channel is not allowed (DCT_NONE). |
(...skipping 12 matching lines...) Expand all Loading... |
423 PeerConnectionInterface::BundlePolicy bundle_policy_; | 505 PeerConnectionInterface::BundlePolicy bundle_policy_; |
424 | 506 |
425 // Declares the RTCP mux policy for the WebRTCSession. | 507 // Declares the RTCP mux policy for the WebRTCSession. |
426 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; | 508 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; |
427 | 509 |
428 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession); | 510 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession); |
429 }; | 511 }; |
430 } // namespace webrtc | 512 } // namespace webrtc |
431 | 513 |
432 #endif // TALK_APP_WEBRTC_WEBRTCSESSION_H_ | 514 #endif // TALK_APP_WEBRTC_WEBRTCSESSION_H_ |
OLD | NEW |