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 | |
37 namespace cricket { | 33 namespace cricket { |
38 | 34 |
39 class ChannelManager; | 35 class ChannelManager; |
40 class DataChannel; | 36 class DataChannel; |
41 class StatsReport; | 37 class StatsReport; |
42 class VideoChannel; | 38 class VideoChannel; |
43 class VoiceChannel; | 39 class VoiceChannel; |
44 | 40 |
45 #ifdef HAVE_QUIC | |
46 class QuicTransportChannel; | |
47 #endif // HAVE_QUIC | |
48 | |
49 } // namespace cricket | 41 } // namespace cricket |
50 | 42 |
51 namespace webrtc { | 43 namespace webrtc { |
52 | 44 |
53 class IceRestartAnswerLatch; | 45 class IceRestartAnswerLatch; |
54 class JsepIceCandidate; | 46 class JsepIceCandidate; |
55 class MediaStreamSignaling; | 47 class MediaStreamSignaling; |
56 class WebRtcSessionDescriptionFactory; | 48 class WebRtcSessionDescriptionFactory; |
57 | 49 |
58 extern const char kBundleWithoutRtcpMux[]; | 50 extern const char kBundleWithoutRtcpMux[]; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 WebRtcSession( | 139 WebRtcSession( |
148 webrtc::MediaControllerInterface* media_controller, | 140 webrtc::MediaControllerInterface* media_controller, |
149 rtc::Thread* network_thread, | 141 rtc::Thread* network_thread, |
150 rtc::Thread* worker_thread, | 142 rtc::Thread* worker_thread, |
151 rtc::Thread* signaling_thread, | 143 rtc::Thread* signaling_thread, |
152 cricket::PortAllocator* port_allocator, | 144 cricket::PortAllocator* port_allocator, |
153 std::unique_ptr<cricket::TransportController> transport_controller); | 145 std::unique_ptr<cricket::TransportController> transport_controller); |
154 virtual ~WebRtcSession(); | 146 virtual ~WebRtcSession(); |
155 | 147 |
156 // These are const to allow them to be called from const methods. | 148 // These are const to allow them to be called from const methods. |
157 rtc::Thread* network_thread() const { return network_thread_; } | |
158 rtc::Thread* worker_thread() const { return worker_thread_; } | 149 rtc::Thread* worker_thread() const { return worker_thread_; } |
159 rtc::Thread* signaling_thread() const { return signaling_thread_; } | 150 rtc::Thread* signaling_thread() const { return signaling_thread_; } |
160 | 151 |
161 // The ID of this session. | 152 // The ID of this session. |
162 const std::string& id() const { return sid_; } | 153 const std::string& id() const { return sid_; } |
163 | 154 |
164 bool Initialize( | 155 bool Initialize( |
165 const PeerConnectionFactoryInterface::Options& options, | 156 const PeerConnectionFactoryInterface::Options& options, |
166 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, | 157 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, |
167 const PeerConnectionInterface::RTCConfiguration& rtc_configuration); | 158 const PeerConnectionInterface::RTCConfiguration& rtc_configuration); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 sigslot::signal0<> SignalVideoChannelDestroyed; | 294 sigslot::signal0<> SignalVideoChannelDestroyed; |
304 sigslot::signal0<> SignalDataChannelCreated; | 295 sigslot::signal0<> SignalDataChannelCreated; |
305 sigslot::signal0<> SignalDataChannelDestroyed; | 296 sigslot::signal0<> SignalDataChannelDestroyed; |
306 // Called when the whole session is destroyed. | 297 // Called when the whole session is destroyed. |
307 sigslot::signal0<> SignalDestroyed; | 298 sigslot::signal0<> SignalDestroyed; |
308 | 299 |
309 // Called when a valid data channel OPEN message is received. | 300 // Called when a valid data channel OPEN message is received. |
310 // std::string represents the data channel label. | 301 // std::string represents the data channel label. |
311 sigslot::signal2<const std::string&, const InternalDataChannelInit&> | 302 sigslot::signal2<const std::string&, const InternalDataChannelInit&> |
312 SignalDataChannelOpenMessage; | 303 SignalDataChannelOpenMessage; |
313 #ifdef HAVE_QUIC | |
314 QuicDataTransport* quic_data_transport() { | |
315 return quic_data_transport_.get(); | |
316 } | |
317 #endif // HAVE_QUIC | |
318 | 304 |
319 private: | 305 private: |
320 // Indicates the type of SessionDescription in a call to SetLocalDescription | 306 // Indicates the type of SessionDescription in a call to SetLocalDescription |
321 // and SetRemoteDescription. | 307 // and SetRemoteDescription. |
322 enum Action { | 308 enum Action { |
323 kOffer, | 309 kOffer, |
324 kPrAnswer, | 310 kPrAnswer, |
325 kAnswer, | 311 kAnswer, |
326 }; | 312 }; |
327 | 313 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 // Reports stats for all transports in use. | 438 // Reports stats for all transports in use. |
453 void ReportTransportStats(); | 439 void ReportTransportStats(); |
454 | 440 |
455 // Gather the usage of IPv4/IPv6 as best connection. | 441 // Gather the usage of IPv4/IPv6 as best connection. |
456 void ReportBestConnectionState(const cricket::TransportStats& stats); | 442 void ReportBestConnectionState(const cricket::TransportStats& stats); |
457 | 443 |
458 void ReportNegotiatedCiphers(const cricket::TransportStats& stats); | 444 void ReportNegotiatedCiphers(const cricket::TransportStats& stats); |
459 | 445 |
460 void OnSentPacket_w(const rtc::SentPacket& sent_packet); | 446 void OnSentPacket_w(const rtc::SentPacket& sent_packet); |
461 | 447 |
462 const std::string GetTransportName(const std::string& content_name); | |
463 | |
464 rtc::Thread* const network_thread_; | |
465 rtc::Thread* const worker_thread_; | 448 rtc::Thread* const worker_thread_; |
466 rtc::Thread* const signaling_thread_; | 449 rtc::Thread* const signaling_thread_; |
467 | 450 |
468 State state_ = STATE_INIT; | 451 State state_ = STATE_INIT; |
469 Error error_ = ERROR_NONE; | 452 Error error_ = ERROR_NONE; |
470 std::string error_desc_; | 453 std::string error_desc_; |
471 | 454 |
472 const std::string sid_; | 455 const std::string sid_; |
473 bool initial_offerer_ = false; | 456 bool initial_offerer_ = false; |
474 | 457 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 | 489 |
507 // Declares the bundle policy for the WebRTCSession. | 490 // Declares the bundle policy for the WebRTCSession. |
508 PeerConnectionInterface::BundlePolicy bundle_policy_; | 491 PeerConnectionInterface::BundlePolicy bundle_policy_; |
509 | 492 |
510 // Declares the RTCP mux policy for the WebRTCSession. | 493 // Declares the RTCP mux policy for the WebRTCSession. |
511 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; | 494 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; |
512 | 495 |
513 bool received_first_video_packet_ = false; | 496 bool received_first_video_packet_ = false; |
514 bool received_first_audio_packet_ = false; | 497 bool received_first_audio_packet_ = false; |
515 | 498 |
516 #ifdef HAVE_QUIC | |
517 std::unique_ptr<QuicDataTransport> quic_data_transport_; | |
518 #endif // HAVE_QUIC | |
519 | |
520 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession); | 499 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession); |
521 }; | 500 }; |
522 } // namespace webrtc | 501 } // namespace webrtc |
523 | 502 |
524 #endif // WEBRTC_API_WEBRTCSESSION_H_ | 503 #endif // WEBRTC_API_WEBRTCSESSION_H_ |
OLD | NEW |