| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "webrtc/api/statstypes.h" | 23 #include "webrtc/api/statstypes.h" |
| 24 #include "webrtc/base/constructormagic.h" | 24 #include "webrtc/base/constructormagic.h" |
| 25 #include "webrtc/base/sigslot.h" | 25 #include "webrtc/base/sigslot.h" |
| 26 #include "webrtc/base/sslidentity.h" | 26 #include "webrtc/base/sslidentity.h" |
| 27 #include "webrtc/base/thread.h" | 27 #include "webrtc/base/thread.h" |
| 28 #include "webrtc/media/base/mediachannel.h" | 28 #include "webrtc/media/base/mediachannel.h" |
| 29 #include "webrtc/p2p/base/candidate.h" | 29 #include "webrtc/p2p/base/candidate.h" |
| 30 #include "webrtc/p2p/base/transportcontroller.h" | 30 #include "webrtc/p2p/base/transportcontroller.h" |
| 31 #include "webrtc/pc/mediasession.h" | 31 #include "webrtc/pc/mediasession.h" |
| 32 | 32 |
| 33 #ifdef HAVE_QUIC |
| 34 #include "webrtc/api/quicdatatransport.h" |
| 35 #endif // HAVE_QUIC |
| 36 |
| 33 namespace cricket { | 37 namespace cricket { |
| 34 | 38 |
| 35 class ChannelManager; | 39 class ChannelManager; |
| 36 class DataChannel; | 40 class DataChannel; |
| 37 class StatsReport; | 41 class StatsReport; |
| 38 class VideoChannel; | 42 class VideoChannel; |
| 39 class VoiceChannel; | 43 class VoiceChannel; |
| 40 | 44 |
| 45 #ifdef HAVE_QUIC |
| 46 class QuicTransportChannel; |
| 47 #endif // HAVE_QUIC |
| 48 |
| 41 } // namespace cricket | 49 } // namespace cricket |
| 42 | 50 |
| 43 namespace webrtc { | 51 namespace webrtc { |
| 44 | 52 |
| 45 class IceRestartAnswerLatch; | 53 class IceRestartAnswerLatch; |
| 46 class JsepIceCandidate; | 54 class JsepIceCandidate; |
| 47 class MediaStreamSignaling; | 55 class MediaStreamSignaling; |
| 48 class WebRtcSessionDescriptionFactory; | 56 class WebRtcSessionDescriptionFactory; |
| 49 | 57 |
| 50 extern const char kBundleWithoutRtcpMux[]; | 58 extern const char kBundleWithoutRtcpMux[]; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 }; | 145 }; |
| 138 | 146 |
| 139 WebRtcSession(webrtc::MediaControllerInterface* media_controller, | 147 WebRtcSession(webrtc::MediaControllerInterface* media_controller, |
| 140 rtc::Thread* network_thread, | 148 rtc::Thread* network_thread, |
| 141 rtc::Thread* worker_thread, | 149 rtc::Thread* worker_thread, |
| 142 rtc::Thread* signaling_thread, | 150 rtc::Thread* signaling_thread, |
| 143 cricket::PortAllocator* port_allocator); | 151 cricket::PortAllocator* port_allocator); |
| 144 virtual ~WebRtcSession(); | 152 virtual ~WebRtcSession(); |
| 145 | 153 |
| 146 // These are const to allow them to be called from const methods. | 154 // These are const to allow them to be called from const methods. |
| 155 rtc::Thread* network_thread() const { return network_thread_; } |
| 147 rtc::Thread* worker_thread() const { return worker_thread_; } | 156 rtc::Thread* worker_thread() const { return worker_thread_; } |
| 148 rtc::Thread* signaling_thread() const { return signaling_thread_; } | 157 rtc::Thread* signaling_thread() const { return signaling_thread_; } |
| 149 | 158 |
| 150 // The ID of this session. | 159 // The ID of this session. |
| 151 const std::string& id() const { return sid_; } | 160 const std::string& id() const { return sid_; } |
| 152 | 161 |
| 153 bool Initialize( | 162 bool Initialize( |
| 154 const PeerConnectionFactoryInterface::Options& options, | 163 const PeerConnectionFactoryInterface::Options& options, |
| 155 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, | 164 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, |
| 156 const PeerConnectionInterface::RTCConfiguration& rtc_configuration); | 165 const PeerConnectionInterface::RTCConfiguration& rtc_configuration); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 sigslot::signal0<> SignalVideoChannelDestroyed; | 301 sigslot::signal0<> SignalVideoChannelDestroyed; |
| 293 sigslot::signal0<> SignalDataChannelCreated; | 302 sigslot::signal0<> SignalDataChannelCreated; |
| 294 sigslot::signal0<> SignalDataChannelDestroyed; | 303 sigslot::signal0<> SignalDataChannelDestroyed; |
| 295 // Called when the whole session is destroyed. | 304 // Called when the whole session is destroyed. |
| 296 sigslot::signal0<> SignalDestroyed; | 305 sigslot::signal0<> SignalDestroyed; |
| 297 | 306 |
| 298 // Called when a valid data channel OPEN message is received. | 307 // Called when a valid data channel OPEN message is received. |
| 299 // std::string represents the data channel label. | 308 // std::string represents the data channel label. |
| 300 sigslot::signal2<const std::string&, const InternalDataChannelInit&> | 309 sigslot::signal2<const std::string&, const InternalDataChannelInit&> |
| 301 SignalDataChannelOpenMessage; | 310 SignalDataChannelOpenMessage; |
| 311 #ifdef HAVE_QUIC |
| 312 QuicDataTransport* quic_data_transport() { |
| 313 return quic_data_transport_.get(); |
| 314 } |
| 315 #endif // HAVE_QUIC |
| 302 | 316 |
| 303 private: | 317 private: |
| 304 // Indicates the type of SessionDescription in a call to SetLocalDescription | 318 // Indicates the type of SessionDescription in a call to SetLocalDescription |
| 305 // and SetRemoteDescription. | 319 // and SetRemoteDescription. |
| 306 enum Action { | 320 enum Action { |
| 307 kOffer, | 321 kOffer, |
| 308 kPrAnswer, | 322 kPrAnswer, |
| 309 kAnswer, | 323 kAnswer, |
| 310 }; | 324 }; |
| 311 | 325 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 // Reports stats for all transports in use. | 450 // Reports stats for all transports in use. |
| 437 void ReportTransportStats(); | 451 void ReportTransportStats(); |
| 438 | 452 |
| 439 // Gather the usage of IPv4/IPv6 as best connection. | 453 // Gather the usage of IPv4/IPv6 as best connection. |
| 440 void ReportBestConnectionState(const cricket::TransportStats& stats); | 454 void ReportBestConnectionState(const cricket::TransportStats& stats); |
| 441 | 455 |
| 442 void ReportNegotiatedCiphers(const cricket::TransportStats& stats); | 456 void ReportNegotiatedCiphers(const cricket::TransportStats& stats); |
| 443 | 457 |
| 444 void OnSentPacket_w(const rtc::SentPacket& sent_packet); | 458 void OnSentPacket_w(const rtc::SentPacket& sent_packet); |
| 445 | 459 |
| 460 rtc::Thread* const network_thread_; |
| 446 rtc::Thread* const worker_thread_; | 461 rtc::Thread* const worker_thread_; |
| 447 rtc::Thread* const signaling_thread_; | 462 rtc::Thread* const signaling_thread_; |
| 448 | 463 |
| 449 State state_ = STATE_INIT; | 464 State state_ = STATE_INIT; |
| 450 Error error_ = ERROR_NONE; | 465 Error error_ = ERROR_NONE; |
| 451 std::string error_desc_; | 466 std::string error_desc_; |
| 452 | 467 |
| 453 const std::string sid_; | 468 const std::string sid_; |
| 454 bool initial_offerer_ = false; | 469 bool initial_offerer_ = false; |
| 455 | 470 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 | 502 |
| 488 // Declares the bundle policy for the WebRTCSession. | 503 // Declares the bundle policy for the WebRTCSession. |
| 489 PeerConnectionInterface::BundlePolicy bundle_policy_; | 504 PeerConnectionInterface::BundlePolicy bundle_policy_; |
| 490 | 505 |
| 491 // Declares the RTCP mux policy for the WebRTCSession. | 506 // Declares the RTCP mux policy for the WebRTCSession. |
| 492 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; | 507 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; |
| 493 | 508 |
| 494 bool received_first_video_packet_ = false; | 509 bool received_first_video_packet_ = false; |
| 495 bool received_first_audio_packet_ = false; | 510 bool received_first_audio_packet_ = false; |
| 496 | 511 |
| 512 #ifdef HAVE_QUIC |
| 513 cricket::QuicTransportChannel* quic_transport_channel_ = nullptr; |
| 514 std::unique_ptr<QuicDataTransport> quic_data_transport_; |
| 515 #endif // HAVE_QUIC |
| 516 |
| 497 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession); | 517 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession); |
| 498 }; | 518 }; |
| 499 } // namespace webrtc | 519 } // namespace webrtc |
| 500 | 520 |
| 501 #endif // WEBRTC_API_WEBRTCSESSION_H_ | 521 #endif // WEBRTC_API_WEBRTCSESSION_H_ |
| OLD | NEW |