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 |
11 #ifndef WEBRTC_API_PEERCONNECTION_H_ | 11 #ifndef WEBRTC_API_PEERCONNECTION_H_ |
12 #define WEBRTC_API_PEERCONNECTION_H_ | 12 #define WEBRTC_API_PEERCONNECTION_H_ |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 #include <map> | 15 #include <map> |
16 #include <memory> | 16 #include <memory> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/api/dtlsidentitystore.h" | 19 #include "webrtc/api/dtlsidentitystore.h" |
20 #include "webrtc/api/peerconnectionfactory.h" | 20 #include "webrtc/api/peerconnectionfactory.h" |
21 #include "webrtc/api/peerconnectioninterface.h" | 21 #include "webrtc/api/peerconnectioninterface.h" |
22 #include "webrtc/api/rtpreceiverinterface.h" | 22 #include "webrtc/api/rtpreceiverinterface.h" |
23 #include "webrtc/api/rtpsenderinterface.h" | 23 #include "webrtc/api/rtpsenderinterface.h" |
24 #include "webrtc/api/statscollector.h" | 24 #include "webrtc/api/statscollector.h" |
25 #include "webrtc/api/streamcollection.h" | 25 #include "webrtc/api/streamcollection.h" |
26 #include "webrtc/api/webrtcsession.h" | 26 #include "webrtc/api/webrtcsession.h" |
27 #include "webrtc/base/scoped_ptr.h" | 27 #include "webrtc/base/scoped_ptr.h" |
28 | 28 |
| 29 #ifdef HAVE_QUIC |
| 30 #include "webrtc/api/quicdatatransport.h" |
| 31 #endif // HAVE_QUIC |
| 32 |
29 namespace webrtc { | 33 namespace webrtc { |
30 | 34 |
31 class MediaStreamObserver; | 35 class MediaStreamObserver; |
32 class VideoRtpReceiver; | 36 class VideoRtpReceiver; |
33 | 37 |
34 // Populates |session_options| from |rtc_options|, and returns true if options | 38 // Populates |session_options| from |rtc_options|, and returns true if options |
35 // are valid. | 39 // are valid. |
36 // |session_options|->transport_options map entries must exist in order for | 40 // |session_options|->transport_options map entries must exist in order for |
37 // them to be populated from |rtc_options|. | 41 // them to be populated from |rtc_options|. |
38 bool ExtractMediaSessionOptions( | 42 bool ExtractMediaSessionOptions( |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 330 |
327 // Notifications from WebRtcSession relating to BaseChannels. | 331 // Notifications from WebRtcSession relating to BaseChannels. |
328 void OnVoiceChannelDestroyed(); | 332 void OnVoiceChannelDestroyed(); |
329 void OnVideoChannelDestroyed(); | 333 void OnVideoChannelDestroyed(); |
330 void OnDataChannelCreated(); | 334 void OnDataChannelCreated(); |
331 void OnDataChannelDestroyed(); | 335 void OnDataChannelDestroyed(); |
332 // Called when the cricket::DataChannel receives a message indicating that a | 336 // Called when the cricket::DataChannel receives a message indicating that a |
333 // webrtc::DataChannel should be opened. | 337 // webrtc::DataChannel should be opened. |
334 void OnDataChannelOpenMessage(const std::string& label, | 338 void OnDataChannelOpenMessage(const std::string& label, |
335 const InternalDataChannelInit& config); | 339 const InternalDataChannelInit& config); |
| 340 #ifdef HAVE_QUIC |
| 341 void OnQuicTransportChannelCreated(cricket::QuicTransportChannel* channel); |
| 342 #endif // HAVE_QUIC |
336 | 343 |
337 RtpSenderInterface* FindSenderById(const std::string& id); | 344 RtpSenderInterface* FindSenderById(const std::string& id); |
338 | 345 |
339 std::vector<rtc::scoped_refptr<RtpSenderInterface>>::iterator | 346 std::vector<rtc::scoped_refptr<RtpSenderInterface>>::iterator |
340 FindSenderForTrack(MediaStreamTrackInterface* track); | 347 FindSenderForTrack(MediaStreamTrackInterface* track); |
341 std::vector<rtc::scoped_refptr<RtpReceiverInterface>>::iterator | 348 std::vector<rtc::scoped_refptr<RtpReceiverInterface>>::iterator |
342 FindReceiverForTrack(const std::string& track_id); | 349 FindReceiverForTrack(const std::string& track_id); |
343 | 350 |
344 TrackInfos* GetRemoteTracks(cricket::MediaType media_type); | 351 TrackInfos* GetRemoteTracks(cricket::MediaType media_type); |
345 TrackInfos* GetLocalTracks(cricket::MediaType media_type); | 352 TrackInfos* GetLocalTracks(cricket::MediaType media_type); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 TrackInfos remote_audio_tracks_; | 387 TrackInfos remote_audio_tracks_; |
381 TrackInfos remote_video_tracks_; | 388 TrackInfos remote_video_tracks_; |
382 TrackInfos local_audio_tracks_; | 389 TrackInfos local_audio_tracks_; |
383 TrackInfos local_video_tracks_; | 390 TrackInfos local_video_tracks_; |
384 | 391 |
385 SctpSidAllocator sid_allocator_; | 392 SctpSidAllocator sid_allocator_; |
386 // label -> DataChannel | 393 // label -> DataChannel |
387 std::map<std::string, rtc::scoped_refptr<DataChannel>> rtp_data_channels_; | 394 std::map<std::string, rtc::scoped_refptr<DataChannel>> rtp_data_channels_; |
388 std::vector<rtc::scoped_refptr<DataChannel>> sctp_data_channels_; | 395 std::vector<rtc::scoped_refptr<DataChannel>> sctp_data_channels_; |
389 std::vector<rtc::scoped_refptr<DataChannel>> sctp_data_channels_to_free_; | 396 std::vector<rtc::scoped_refptr<DataChannel>> sctp_data_channels_to_free_; |
| 397 #ifdef HAVE_QUIC |
| 398 std::unique_ptr<QuicDataTransport> quic_data_transport_; |
| 399 #endif // HAVE_QUIC |
390 | 400 |
391 bool remote_peer_supports_msid_ = false; | 401 bool remote_peer_supports_msid_ = false; |
392 | 402 |
393 std::vector<rtc::scoped_refptr<RtpSenderInterface>> senders_; | 403 std::vector<rtc::scoped_refptr<RtpSenderInterface>> senders_; |
394 std::vector<rtc::scoped_refptr<RtpReceiverInterface>> receivers_; | 404 std::vector<rtc::scoped_refptr<RtpReceiverInterface>> receivers_; |
395 | 405 |
396 // The session_ unique_ptr is declared at the bottom of PeerConnection | 406 // The session_ unique_ptr is declared at the bottom of PeerConnection |
397 // because its destruction fires signals (such as VoiceChannelDestroyed) | 407 // because its destruction fires signals (such as VoiceChannelDestroyed) |
398 // which will trigger some final actions in PeerConnection... | 408 // which will trigger some final actions in PeerConnection... |
399 std::unique_ptr<WebRtcSession> session_; | 409 std::unique_ptr<WebRtcSession> session_; |
400 // ... But stats_ depends on session_ so it should be destroyed even earlier. | 410 // ... But stats_ depends on session_ so it should be destroyed even earlier. |
401 std::unique_ptr<StatsCollector> stats_; | 411 std::unique_ptr<StatsCollector> stats_; |
402 }; | 412 }; |
403 | 413 |
404 } // namespace webrtc | 414 } // namespace webrtc |
405 | 415 |
406 #endif // WEBRTC_API_PEERCONNECTION_H_ | 416 #endif // WEBRTC_API_PEERCONNECTION_H_ |
OLD | NEW |