Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: webrtc/api/webrtcsession.h

Issue 2166873002: Modified PeerConnection and WebRtcSession for end-to-end QuicDataChannel usage. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Change the comments and minor fix. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/api/test/peerconnectiontestwrapper.cc ('k') | webrtc/api/webrtcsession.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 WebRtcSession( 147 WebRtcSession(
140 webrtc::MediaControllerInterface* media_controller, 148 webrtc::MediaControllerInterface* media_controller,
141 rtc::Thread* network_thread, 149 rtc::Thread* network_thread,
142 rtc::Thread* worker_thread, 150 rtc::Thread* worker_thread,
143 rtc::Thread* signaling_thread, 151 rtc::Thread* signaling_thread,
144 cricket::PortAllocator* port_allocator, 152 cricket::PortAllocator* port_allocator,
145 std::unique_ptr<cricket::TransportController> transport_controller); 153 std::unique_ptr<cricket::TransportController> transport_controller);
146 virtual ~WebRtcSession(); 154 virtual ~WebRtcSession();
147 155
148 // These are const to allow them to be called from const methods. 156 // These are const to allow them to be called from const methods.
157 rtc::Thread* network_thread() const { return network_thread_; }
149 rtc::Thread* worker_thread() const { return worker_thread_; } 158 rtc::Thread* worker_thread() const { return worker_thread_; }
150 rtc::Thread* signaling_thread() const { return signaling_thread_; } 159 rtc::Thread* signaling_thread() const { return signaling_thread_; }
151 160
152 // The ID of this session. 161 // The ID of this session.
153 const std::string& id() const { return sid_; } 162 const std::string& id() const { return sid_; }
154 163
155 bool Initialize( 164 bool Initialize(
156 const PeerConnectionFactoryInterface::Options& options, 165 const PeerConnectionFactoryInterface::Options& options,
157 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, 166 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
158 const PeerConnectionInterface::RTCConfiguration& rtc_configuration); 167 const PeerConnectionInterface::RTCConfiguration& rtc_configuration);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 sigslot::signal0<> SignalVideoChannelDestroyed; 303 sigslot::signal0<> SignalVideoChannelDestroyed;
295 sigslot::signal0<> SignalDataChannelCreated; 304 sigslot::signal0<> SignalDataChannelCreated;
296 sigslot::signal0<> SignalDataChannelDestroyed; 305 sigslot::signal0<> SignalDataChannelDestroyed;
297 // Called when the whole session is destroyed. 306 // Called when the whole session is destroyed.
298 sigslot::signal0<> SignalDestroyed; 307 sigslot::signal0<> SignalDestroyed;
299 308
300 // Called when a valid data channel OPEN message is received. 309 // Called when a valid data channel OPEN message is received.
301 // std::string represents the data channel label. 310 // std::string represents the data channel label.
302 sigslot::signal2<const std::string&, const InternalDataChannelInit&> 311 sigslot::signal2<const std::string&, const InternalDataChannelInit&>
303 SignalDataChannelOpenMessage; 312 SignalDataChannelOpenMessage;
313 #ifdef HAVE_QUIC
314 QuicDataTransport* quic_data_transport() {
315 return quic_data_transport_.get();
316 }
317 #endif // HAVE_QUIC
304 318
305 private: 319 private:
306 // Indicates the type of SessionDescription in a call to SetLocalDescription 320 // Indicates the type of SessionDescription in a call to SetLocalDescription
307 // and SetRemoteDescription. 321 // and SetRemoteDescription.
308 enum Action { 322 enum Action {
309 kOffer, 323 kOffer,
310 kPrAnswer, 324 kPrAnswer,
311 kAnswer, 325 kAnswer,
312 }; 326 };
313 327
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 // Reports stats for all transports in use. 452 // Reports stats for all transports in use.
439 void ReportTransportStats(); 453 void ReportTransportStats();
440 454
441 // Gather the usage of IPv4/IPv6 as best connection. 455 // Gather the usage of IPv4/IPv6 as best connection.
442 void ReportBestConnectionState(const cricket::TransportStats& stats); 456 void ReportBestConnectionState(const cricket::TransportStats& stats);
443 457
444 void ReportNegotiatedCiphers(const cricket::TransportStats& stats); 458 void ReportNegotiatedCiphers(const cricket::TransportStats& stats);
445 459
446 void OnSentPacket_w(const rtc::SentPacket& sent_packet); 460 void OnSentPacket_w(const rtc::SentPacket& sent_packet);
447 461
462 const std::string GetTransportName(const std::string& content_name);
463
464 rtc::Thread* const network_thread_;
448 rtc::Thread* const worker_thread_; 465 rtc::Thread* const worker_thread_;
449 rtc::Thread* const signaling_thread_; 466 rtc::Thread* const signaling_thread_;
450 467
451 State state_ = STATE_INIT; 468 State state_ = STATE_INIT;
452 Error error_ = ERROR_NONE; 469 Error error_ = ERROR_NONE;
453 std::string error_desc_; 470 std::string error_desc_;
454 471
455 const std::string sid_; 472 const std::string sid_;
456 bool initial_offerer_ = false; 473 bool initial_offerer_ = false;
457 474
(...skipping 11 matching lines...) Expand all
469 // If the remote peer is using a older version of implementation. 486 // If the remote peer is using a older version of implementation.
470 bool older_version_remote_peer_; 487 bool older_version_remote_peer_;
471 bool dtls_enabled_; 488 bool dtls_enabled_;
472 // Specifies which kind of data channel is allowed. This is controlled 489 // Specifies which kind of data channel is allowed. This is controlled
473 // by the chrome command-line flag and constraints: 490 // by the chrome command-line flag and constraints:
474 // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled, 491 // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled,
475 // constraint kEnableDtlsSrtp is true, and constaint kEnableRtpDataChannels is 492 // constraint kEnableDtlsSrtp is true, and constaint kEnableRtpDataChannels is
476 // not set or false, SCTP is allowed (DCT_SCTP); 493 // not set or false, SCTP is allowed (DCT_SCTP);
477 // 2. If constraint kEnableRtpDataChannels is true, RTP is allowed (DCT_RTP); 494 // 2. If constraint kEnableRtpDataChannels is true, RTP is allowed (DCT_RTP);
478 // 3. If both 1&2 are false, data channel is not allowed (DCT_NONE). 495 // 3. If both 1&2 are false, data channel is not allowed (DCT_NONE).
496 // The data channel type could be DCT_QUIC if the QUIC data channel is
497 // enabled.
479 cricket::DataChannelType data_channel_type_; 498 cricket::DataChannelType data_channel_type_;
480 // List of content names for which the remote side triggered an ICE restart. 499 // List of content names for which the remote side triggered an ICE restart.
481 std::set<std::string> pending_ice_restarts_; 500 std::set<std::string> pending_ice_restarts_;
482 501
483 std::unique_ptr<WebRtcSessionDescriptionFactory> webrtc_session_desc_factory_; 502 std::unique_ptr<WebRtcSessionDescriptionFactory> webrtc_session_desc_factory_;
484 503
485 // Member variables for caching global options. 504 // Member variables for caching global options.
486 cricket::AudioOptions audio_options_; 505 cricket::AudioOptions audio_options_;
487 cricket::VideoOptions video_options_; 506 cricket::VideoOptions video_options_;
488 MetricsObserverInterface* metrics_observer_; 507 MetricsObserverInterface* metrics_observer_;
489 508
490 // Declares the bundle policy for the WebRTCSession. 509 // Declares the bundle policy for the WebRTCSession.
491 PeerConnectionInterface::BundlePolicy bundle_policy_; 510 PeerConnectionInterface::BundlePolicy bundle_policy_;
492 511
493 // Declares the RTCP mux policy for the WebRTCSession. 512 // Declares the RTCP mux policy for the WebRTCSession.
494 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; 513 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_;
495 514
496 bool received_first_video_packet_ = false; 515 bool received_first_video_packet_ = false;
497 bool received_first_audio_packet_ = false; 516 bool received_first_audio_packet_ = false;
498 517
518 #ifdef HAVE_QUIC
519 std::unique_ptr<QuicDataTransport> quic_data_transport_;
520 #endif // HAVE_QUIC
521
499 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession); 522 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession);
500 }; 523 };
501 } // namespace webrtc 524 } // namespace webrtc
502 525
503 #endif // WEBRTC_API_WEBRTCSESSION_H_ 526 #endif // WEBRTC_API_WEBRTCSESSION_H_
OLDNEW
« no previous file with comments | « webrtc/api/test/peerconnectiontestwrapper.cc ('k') | webrtc/api/webrtcsession.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698