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