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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // recv_audio=true, recv_video=true, bundle_enabled=true. | 47 // recv_audio=true, recv_video=true, bundle_enabled=true. |
48 // Other fields will be left with existing values. | 48 // Other fields will be left with existing values. |
49 // | 49 // |
50 // Deprecated. Will be removed once callers that use constraints are gone. | 50 // Deprecated. Will be removed once callers that use constraints are gone. |
51 // TODO(hta): Remove when callers are gone. | 51 // TODO(hta): Remove when callers are gone. |
52 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5617 | 52 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5617 |
53 bool ParseConstraintsForAnswer(const MediaConstraintsInterface* constraints, | 53 bool ParseConstraintsForAnswer(const MediaConstraintsInterface* constraints, |
54 cricket::MediaSessionOptions* session_options); | 54 cricket::MediaSessionOptions* session_options); |
55 | 55 |
56 // Parses the URLs for each server in |servers| to build |stun_servers| and | 56 // Parses the URLs for each server in |servers| to build |stun_servers| and |
57 // |turn_servers|. | 57 // |turn_servers|. Can return SYNTAX_ERROR if the URL is malformed, or |
58 bool ParseIceServers(const PeerConnectionInterface::IceServers& servers, | 58 // INVALID_PARAMETER if a TURN server is missing |username| or |password|. |
59 cricket::ServerAddresses* stun_servers, | 59 RtcError ParseIceServers(const PeerConnectionInterface::IceServers& servers, |
60 std::vector<cricket::RelayServerConfig>* turn_servers); | 60 cricket::ServerAddresses* stun_servers, |
| 61 std::vector<cricket::RelayServerConfig>* turn_servers); |
61 | 62 |
62 // PeerConnection implements the PeerConnectionInterface interface. | 63 // PeerConnection implements the PeerConnectionInterface interface. |
63 // It uses WebRtcSession to implement the PeerConnection functionality. | 64 // It uses WebRtcSession to implement the PeerConnection functionality. |
64 class PeerConnection : public PeerConnectionInterface, | 65 class PeerConnection : public PeerConnectionInterface, |
65 public IceObserver, | 66 public IceObserver, |
66 public rtc::MessageHandler, | 67 public rtc::MessageHandler, |
67 public sigslot::has_slots<> { | 68 public sigslot::has_slots<> { |
68 public: | 69 public: |
69 explicit PeerConnection(PeerConnectionFactory* factory); | 70 explicit PeerConnection(PeerConnectionFactory* factory); |
70 | 71 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 void CreateAnswer(CreateSessionDescriptionObserver* observer, | 125 void CreateAnswer(CreateSessionDescriptionObserver* observer, |
125 const MediaConstraintsInterface* constraints) override; | 126 const MediaConstraintsInterface* constraints) override; |
126 void CreateAnswer(CreateSessionDescriptionObserver* observer, | 127 void CreateAnswer(CreateSessionDescriptionObserver* observer, |
127 const RTCOfferAnswerOptions& options) override; | 128 const RTCOfferAnswerOptions& options) override; |
128 void SetLocalDescription(SetSessionDescriptionObserver* observer, | 129 void SetLocalDescription(SetSessionDescriptionObserver* observer, |
129 SessionDescriptionInterface* desc) override; | 130 SessionDescriptionInterface* desc) override; |
130 void SetRemoteDescription(SetSessionDescriptionObserver* observer, | 131 void SetRemoteDescription(SetSessionDescriptionObserver* observer, |
131 SessionDescriptionInterface* desc) override; | 132 SessionDescriptionInterface* desc) override; |
132 PeerConnectionInterface::RTCConfiguration GetConfiguration() override; | 133 PeerConnectionInterface::RTCConfiguration GetConfiguration() override; |
133 bool SetConfiguration( | 134 bool SetConfiguration( |
134 const PeerConnectionInterface::RTCConfiguration& configuration) override; | 135 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 136 RtcError* error = nullptr) override; |
135 bool AddIceCandidate(const IceCandidateInterface* candidate) override; | 137 bool AddIceCandidate(const IceCandidateInterface* candidate) override; |
136 bool RemoveIceCandidates( | 138 bool RemoveIceCandidates( |
137 const std::vector<cricket::Candidate>& candidates) override; | 139 const std::vector<cricket::Candidate>& candidates) override; |
138 | 140 |
139 void RegisterUMAObserver(UMAObserver* observer) override; | 141 void RegisterUMAObserver(UMAObserver* observer) override; |
140 | 142 |
141 bool StartRtcEventLog(rtc::PlatformFile file, | 143 bool StartRtcEventLog(rtc::PlatformFile file, |
142 int64_t max_size_bytes) override; | 144 int64_t max_size_bytes) override; |
143 void StopRtcEventLog() override; | 145 void StopRtcEventLog() override; |
144 | 146 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 const TrackInfo* FindTrackInfo(const TrackInfos& infos, | 362 const TrackInfo* FindTrackInfo(const TrackInfos& infos, |
361 const std::string& stream_label, | 363 const std::string& stream_label, |
362 const std::string track_id) const; | 364 const std::string track_id) const; |
363 | 365 |
364 // Returns the specified SCTP DataChannel in sctp_data_channels_, | 366 // Returns the specified SCTP DataChannel in sctp_data_channels_, |
365 // or nullptr if not found. | 367 // or nullptr if not found. |
366 DataChannel* FindDataChannelBySid(int sid) const; | 368 DataChannel* FindDataChannelBySid(int sid) const; |
367 | 369 |
368 // Called when first configuring the port allocator. | 370 // Called when first configuring the port allocator. |
369 bool InitializePortAllocator_n(const RTCConfiguration& configuration); | 371 bool InitializePortAllocator_n(const RTCConfiguration& configuration); |
370 // Called when SetConfiguration is called. Only a subset of the configuration | 372 // Called when SetConfiguration is called to apply the supported subset |
371 // is applied. | 373 // of the configuration on the network thread. |
372 bool ReconfigurePortAllocator_n(const RTCConfiguration& configuration); | 374 bool ReconfigurePortAllocator_n( |
| 375 const cricket::ServerAddresses& stun_servers, |
| 376 const std::vector<cricket::RelayServerConfig>& turn_servers, |
| 377 IceTransportsType type, |
| 378 int candidate_pool_size, |
| 379 bool prune_turn_ports); |
373 | 380 |
374 // Starts recording an Rtc EventLog using the supplied platform file. | 381 // Starts recording an Rtc EventLog using the supplied platform file. |
375 // This function should only be called from the worker thread. | 382 // This function should only be called from the worker thread. |
376 bool StartRtcEventLog_w(rtc::PlatformFile file, int64_t max_size_bytes); | 383 bool StartRtcEventLog_w(rtc::PlatformFile file, int64_t max_size_bytes); |
377 // Starts recording an Rtc EventLog using the supplied platform file. | 384 // Starts recording an Rtc EventLog using the supplied platform file. |
378 // This function should only be called from the worker thread. | 385 // This function should only be called from the worker thread. |
379 void StopRtcEventLog_w(); | 386 void StopRtcEventLog_w(); |
380 | 387 |
381 // Storing the factory as a scoped reference pointer ensures that the memory | 388 // Storing the factory as a scoped reference pointer ensures that the memory |
382 // in the PeerConnectionFactoryImpl remains available as long as the | 389 // in the PeerConnectionFactoryImpl remains available as long as the |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>> | 435 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>> |
429 receivers_; | 436 receivers_; |
430 std::unique_ptr<WebRtcSession> session_; | 437 std::unique_ptr<WebRtcSession> session_; |
431 std::unique_ptr<StatsCollector> stats_; | 438 std::unique_ptr<StatsCollector> stats_; |
432 rtc::scoped_refptr<RTCStatsCollector> stats_collector_; | 439 rtc::scoped_refptr<RTCStatsCollector> stats_collector_; |
433 }; | 440 }; |
434 | 441 |
435 } // namespace webrtc | 442 } // namespace webrtc |
436 | 443 |
437 #endif // WEBRTC_API_PEERCONNECTION_H_ | 444 #endif // WEBRTC_API_PEERCONNECTION_H_ |
OLD | NEW |