| 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 RTCErrorType ParseIceServers( |
| 60 std::vector<cricket::RelayServerConfig>* turn_servers); | 60 const PeerConnectionInterface::IceServers& servers, |
| 61 cricket::ServerAddresses* stun_servers, |
| 62 std::vector<cricket::RelayServerConfig>* turn_servers); |
| 61 | 63 |
| 62 // PeerConnection implements the PeerConnectionInterface interface. | 64 // PeerConnection implements the PeerConnectionInterface interface. |
| 63 // It uses WebRtcSession to implement the PeerConnection functionality. | 65 // It uses WebRtcSession to implement the PeerConnection functionality. |
| 64 class PeerConnection : public PeerConnectionInterface, | 66 class PeerConnection : public PeerConnectionInterface, |
| 65 public IceObserver, | 67 public IceObserver, |
| 66 public rtc::MessageHandler, | 68 public rtc::MessageHandler, |
| 67 public sigslot::has_slots<> { | 69 public sigslot::has_slots<> { |
| 68 public: | 70 public: |
| 69 explicit PeerConnection(PeerConnectionFactory* factory); | 71 explicit PeerConnection(PeerConnectionFactory* factory); |
| 70 | 72 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 void CreateAnswer(CreateSessionDescriptionObserver* observer, | 132 void CreateAnswer(CreateSessionDescriptionObserver* observer, |
| 131 const MediaConstraintsInterface* constraints) override; | 133 const MediaConstraintsInterface* constraints) override; |
| 132 void CreateAnswer(CreateSessionDescriptionObserver* observer, | 134 void CreateAnswer(CreateSessionDescriptionObserver* observer, |
| 133 const RTCOfferAnswerOptions& options) override; | 135 const RTCOfferAnswerOptions& options) override; |
| 134 void SetLocalDescription(SetSessionDescriptionObserver* observer, | 136 void SetLocalDescription(SetSessionDescriptionObserver* observer, |
| 135 SessionDescriptionInterface* desc) override; | 137 SessionDescriptionInterface* desc) override; |
| 136 void SetRemoteDescription(SetSessionDescriptionObserver* observer, | 138 void SetRemoteDescription(SetSessionDescriptionObserver* observer, |
| 137 SessionDescriptionInterface* desc) override; | 139 SessionDescriptionInterface* desc) override; |
| 138 PeerConnectionInterface::RTCConfiguration GetConfiguration() override; | 140 PeerConnectionInterface::RTCConfiguration GetConfiguration() override; |
| 139 bool SetConfiguration( | 141 bool SetConfiguration( |
| 140 const PeerConnectionInterface::RTCConfiguration& configuration) override; | 142 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 143 RTCError* error) override; |
| 144 bool SetConfiguration( |
| 145 const PeerConnectionInterface::RTCConfiguration& configuration) override { |
| 146 return SetConfiguration(configuration, nullptr); |
| 147 } |
| 141 bool AddIceCandidate(const IceCandidateInterface* candidate) override; | 148 bool AddIceCandidate(const IceCandidateInterface* candidate) override; |
| 142 bool RemoveIceCandidates( | 149 bool RemoveIceCandidates( |
| 143 const std::vector<cricket::Candidate>& candidates) override; | 150 const std::vector<cricket::Candidate>& candidates) override; |
| 144 | 151 |
| 145 void RegisterUMAObserver(UMAObserver* observer) override; | 152 void RegisterUMAObserver(UMAObserver* observer) override; |
| 146 | 153 |
| 147 bool StartRtcEventLog(rtc::PlatformFile file, | 154 bool StartRtcEventLog(rtc::PlatformFile file, |
| 148 int64_t max_size_bytes) override; | 155 int64_t max_size_bytes) override; |
| 149 void StopRtcEventLog() override; | 156 void StopRtcEventLog() override; |
| 150 | 157 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 const TrackInfo* FindTrackInfo(const TrackInfos& infos, | 373 const TrackInfo* FindTrackInfo(const TrackInfos& infos, |
| 367 const std::string& stream_label, | 374 const std::string& stream_label, |
| 368 const std::string track_id) const; | 375 const std::string track_id) const; |
| 369 | 376 |
| 370 // Returns the specified SCTP DataChannel in sctp_data_channels_, | 377 // Returns the specified SCTP DataChannel in sctp_data_channels_, |
| 371 // or nullptr if not found. | 378 // or nullptr if not found. |
| 372 DataChannel* FindDataChannelBySid(int sid) const; | 379 DataChannel* FindDataChannelBySid(int sid) const; |
| 373 | 380 |
| 374 // Called when first configuring the port allocator. | 381 // Called when first configuring the port allocator. |
| 375 bool InitializePortAllocator_n(const RTCConfiguration& configuration); | 382 bool InitializePortAllocator_n(const RTCConfiguration& configuration); |
| 376 // Called when SetConfiguration is called. Only a subset of the configuration | 383 // Called when SetConfiguration is called to apply the supported subset |
| 377 // is applied. | 384 // of the configuration on the network thread. |
| 378 bool ReconfigurePortAllocator_n(const RTCConfiguration& configuration); | 385 bool ReconfigurePortAllocator_n( |
| 386 const cricket::ServerAddresses& stun_servers, |
| 387 const std::vector<cricket::RelayServerConfig>& turn_servers, |
| 388 IceTransportsType type, |
| 389 int candidate_pool_size, |
| 390 bool prune_turn_ports); |
| 379 | 391 |
| 380 // Starts recording an Rtc EventLog using the supplied platform file. | 392 // Starts recording an Rtc EventLog using the supplied platform file. |
| 381 // This function should only be called from the worker thread. | 393 // This function should only be called from the worker thread. |
| 382 bool StartRtcEventLog_w(rtc::PlatformFile file, int64_t max_size_bytes); | 394 bool StartRtcEventLog_w(rtc::PlatformFile file, int64_t max_size_bytes); |
| 383 // Starts recording an Rtc EventLog using the supplied platform file. | 395 // Starts recording an Rtc EventLog using the supplied platform file. |
| 384 // This function should only be called from the worker thread. | 396 // This function should only be called from the worker thread. |
| 385 void StopRtcEventLog_w(); | 397 void StopRtcEventLog_w(); |
| 386 | 398 |
| 387 // Storing the factory as a scoped reference pointer ensures that the memory | 399 // Storing the factory as a scoped reference pointer ensures that the memory |
| 388 // in the PeerConnectionFactoryImpl remains available as long as the | 400 // in the PeerConnectionFactoryImpl remains available as long as the |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>> | 446 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>> |
| 435 receivers_; | 447 receivers_; |
| 436 std::unique_ptr<WebRtcSession> session_; | 448 std::unique_ptr<WebRtcSession> session_; |
| 437 std::unique_ptr<StatsCollector> stats_; | 449 std::unique_ptr<StatsCollector> stats_; |
| 438 rtc::scoped_refptr<RTCStatsCollector> stats_collector_; | 450 rtc::scoped_refptr<RTCStatsCollector> stats_collector_; |
| 439 }; | 451 }; |
| 440 | 452 |
| 441 } // namespace webrtc | 453 } // namespace webrtc |
| 442 | 454 |
| 443 #endif // WEBRTC_API_PEERCONNECTION_H_ | 455 #endif // WEBRTC_API_PEERCONNECTION_H_ |
| OLD | NEW |