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_WEBRTCSESSION_H_ | 11 #ifndef WEBRTC_API_WEBRTCSESSION_H_ |
12 #define WEBRTC_API_WEBRTCSESSION_H_ | 12 #define WEBRTC_API_WEBRTCSESSION_H_ |
13 | 13 |
14 #include <set> | 14 #include <set> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/api/datachannel.h" | 18 #include "webrtc/api/datachannel.h" |
19 #include "webrtc/api/dtmfsender.h" | 19 #include "webrtc/api/dtmfsender.h" |
20 #include "webrtc/api/mediacontroller.h" | 20 #include "webrtc/api/mediacontroller.h" |
21 #include "webrtc/api/mediastreamprovider.h" | 21 #include "webrtc/api/mediastreamprovider.h" |
22 #include "webrtc/api/peerconnectioninterface.h" | 22 #include "webrtc/api/peerconnectioninterface.h" |
23 #include "webrtc/api/statstypes.h" | 23 #include "webrtc/api/statstypes.h" |
24 #include "webrtc/base/sigslot.h" | 24 #include "webrtc/base/sigslot.h" |
25 #include "webrtc/base/sslidentity.h" | 25 #include "webrtc/base/sslidentity.h" |
26 #include "webrtc/base/thread.h" | 26 #include "webrtc/base/thread.h" |
27 #include "webrtc/media/base/mediachannel.h" | 27 #include "webrtc/media/base/mediachannel.h" |
28 #include "webrtc/p2p/base/candidate.h" | |
29 #include "webrtc/p2p/base/transportcontroller.h" | 28 #include "webrtc/p2p/base/transportcontroller.h" |
30 #include "webrtc/pc/mediasession.h" | 29 #include "webrtc/pc/mediasession.h" |
31 | 30 |
32 namespace cricket { | 31 namespace cricket { |
33 | 32 |
34 class ChannelManager; | 33 class ChannelManager; |
35 class DataChannel; | 34 class DataChannel; |
36 class StatsReport; | 35 class StatsReport; |
37 class VideoCapturer; | 36 class VideoCapturer; |
38 class VideoChannel; | 37 class VideoChannel; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // TODO(honghaiz): Change the name to OnIceConnectionStateChange so as to | 74 // TODO(honghaiz): Change the name to OnIceConnectionStateChange so as to |
76 // conform to the w3c standard. | 75 // conform to the w3c standard. |
77 virtual void OnIceConnectionChange( | 76 virtual void OnIceConnectionChange( |
78 PeerConnectionInterface::IceConnectionState new_state) {} | 77 PeerConnectionInterface::IceConnectionState new_state) {} |
79 // Called any time the IceGatheringState changes | 78 // Called any time the IceGatheringState changes |
80 virtual void OnIceGatheringChange( | 79 virtual void OnIceGatheringChange( |
81 PeerConnectionInterface::IceGatheringState new_state) {} | 80 PeerConnectionInterface::IceGatheringState new_state) {} |
82 // New Ice candidate have been found. | 81 // New Ice candidate have been found. |
83 virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0; | 82 virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0; |
84 | 83 |
85 // Some local ICE candidates have been removed. | |
86 virtual void OnIceCandidatesRemoved( | |
87 const std::vector<cricket::Candidate>& candidates) = 0; | |
88 | |
89 // Called whenever the state changes between receiving and not receiving. | 84 // Called whenever the state changes between receiving and not receiving. |
90 virtual void OnIceConnectionReceivingChange(bool receiving) {} | 85 virtual void OnIceConnectionReceivingChange(bool receiving) {} |
91 | 86 |
92 protected: | 87 protected: |
93 ~IceObserver() {} | 88 ~IceObserver() {} |
94 | 89 |
95 private: | 90 private: |
96 RTC_DISALLOW_COPY_AND_ASSIGN(IceObserver); | 91 RTC_DISALLOW_COPY_AND_ASSIGN(IceObserver); |
97 }; | 92 }; |
98 | 93 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 void CreateAnswer(CreateSessionDescriptionObserver* observer, | 198 void CreateAnswer(CreateSessionDescriptionObserver* observer, |
204 const cricket::MediaSessionOptions& session_options); | 199 const cricket::MediaSessionOptions& session_options); |
205 // The ownership of |desc| will be transferred after this call. | 200 // The ownership of |desc| will be transferred after this call. |
206 bool SetLocalDescription(SessionDescriptionInterface* desc, | 201 bool SetLocalDescription(SessionDescriptionInterface* desc, |
207 std::string* err_desc); | 202 std::string* err_desc); |
208 // The ownership of |desc| will be transferred after this call. | 203 // The ownership of |desc| will be transferred after this call. |
209 bool SetRemoteDescription(SessionDescriptionInterface* desc, | 204 bool SetRemoteDescription(SessionDescriptionInterface* desc, |
210 std::string* err_desc); | 205 std::string* err_desc); |
211 bool ProcessIceMessage(const IceCandidateInterface* ice_candidate); | 206 bool ProcessIceMessage(const IceCandidateInterface* ice_candidate); |
212 | 207 |
213 bool RemoveRemoteIceCandidates( | |
214 const std::vector<cricket::Candidate>& candidates); | |
215 | |
216 bool SetIceTransports(PeerConnectionInterface::IceTransportsType type); | 208 bool SetIceTransports(PeerConnectionInterface::IceTransportsType type); |
217 | 209 |
218 cricket::IceConfig ParseIceConfig( | 210 cricket::IceConfig ParseIceConfig( |
219 const PeerConnectionInterface::RTCConfiguration& config) const; | 211 const PeerConnectionInterface::RTCConfiguration& config) const; |
220 | 212 |
221 void SetIceConfig(const cricket::IceConfig& ice_config); | 213 void SetIceConfig(const cricket::IceConfig& ice_config); |
222 | 214 |
223 // Start gathering candidates for any new transports, or transports doing an | 215 // Start gathering candidates for any new transports, or transports doing an |
224 // ICE restart. | 216 // ICE restart. |
225 void MaybeStartGathering(); | 217 void MaybeStartGathering(); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 // index is valid. | 424 // index is valid. |
433 bool ReadyToUseRemoteCandidate(const IceCandidateInterface* candidate, | 425 bool ReadyToUseRemoteCandidate(const IceCandidateInterface* candidate, |
434 const SessionDescriptionInterface* remote_desc, | 426 const SessionDescriptionInterface* remote_desc, |
435 bool* valid); | 427 bool* valid); |
436 | 428 |
437 void OnTransportControllerConnectionState(cricket::IceConnectionState state); | 429 void OnTransportControllerConnectionState(cricket::IceConnectionState state); |
438 void OnTransportControllerReceiving(bool receiving); | 430 void OnTransportControllerReceiving(bool receiving); |
439 void OnTransportControllerGatheringState(cricket::IceGatheringState state); | 431 void OnTransportControllerGatheringState(cricket::IceGatheringState state); |
440 void OnTransportControllerCandidatesGathered( | 432 void OnTransportControllerCandidatesGathered( |
441 const std::string& transport_name, | 433 const std::string& transport_name, |
442 const std::vector<cricket::Candidate>& candidates); | 434 const cricket::Candidates& candidates); |
443 void OnTransportControllerCandidatesRemoved( | |
444 const std::vector<cricket::Candidate>& candidates); | |
445 | 435 |
446 std::string GetSessionErrorMsg(); | 436 std::string GetSessionErrorMsg(); |
447 | 437 |
448 // Invoked when TransportController connection completion is signaled. | 438 // Invoked when TransportController connection completion is signaled. |
449 // Reports stats for all transports in use. | 439 // Reports stats for all transports in use. |
450 void ReportTransportStats(); | 440 void ReportTransportStats(); |
451 | 441 |
452 // Gather the usage of IPv4/IPv6 as best connection. | 442 // Gather the usage of IPv4/IPv6 as best connection. |
453 void ReportBestConnectionState(const cricket::TransportStats& stats); | 443 void ReportBestConnectionState(const cricket::TransportStats& stats); |
454 | 444 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 PeerConnectionInterface::BundlePolicy bundle_policy_; | 495 PeerConnectionInterface::BundlePolicy bundle_policy_; |
506 | 496 |
507 // Declares the RTCP mux policy for the WebRTCSession. | 497 // Declares the RTCP mux policy for the WebRTCSession. |
508 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; | 498 PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_; |
509 | 499 |
510 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession); | 500 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession); |
511 }; | 501 }; |
512 } // namespace webrtc | 502 } // namespace webrtc |
513 | 503 |
514 #endif // WEBRTC_API_WEBRTCSESSION_H_ | 504 #endif // WEBRTC_API_WEBRTCSESSION_H_ |
OLD | NEW |