Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef TALK_APP_WEBRTC_PEERCONNECTION_H_ | 28 #ifndef TALK_APP_WEBRTC_PEERCONNECTION_H_ |
| 29 #define TALK_APP_WEBRTC_PEERCONNECTION_H_ | 29 #define TALK_APP_WEBRTC_PEERCONNECTION_H_ |
| 30 | 30 |
| 31 #include <string> | 31 #include <string> |
| 32 | 32 |
| 33 #include "talk/app/webrtc/dtlsidentitystore.h" | |
| 33 #include "talk/app/webrtc/mediastreamsignaling.h" | 34 #include "talk/app/webrtc/mediastreamsignaling.h" |
| 34 #include "talk/app/webrtc/peerconnectionfactory.h" | 35 #include "talk/app/webrtc/peerconnectionfactory.h" |
| 35 #include "talk/app/webrtc/peerconnectioninterface.h" | 36 #include "talk/app/webrtc/peerconnectioninterface.h" |
| 36 #include "talk/app/webrtc/statscollector.h" | 37 #include "talk/app/webrtc/statscollector.h" |
| 37 #include "talk/app/webrtc/streamcollection.h" | 38 #include "talk/app/webrtc/streamcollection.h" |
| 38 #include "talk/app/webrtc/webrtcsession.h" | 39 #include "talk/app/webrtc/webrtcsession.h" |
| 39 #include "webrtc/base/scoped_ptr.h" | 40 #include "webrtc/base/scoped_ptr.h" |
| 41 #include "webrtc/base/sslidentity.h" | |
| 40 | 42 |
| 41 namespace webrtc { | 43 namespace webrtc { |
| 42 class MediaStreamHandlerContainer; | 44 class MediaStreamHandlerContainer; |
| 43 | 45 |
| 44 typedef std::vector<PortAllocatorFactoryInterface::StunConfiguration> | 46 typedef std::vector<PortAllocatorFactoryInterface::StunConfiguration> |
| 45 StunConfigurations; | 47 StunConfigurations; |
| 46 typedef std::vector<PortAllocatorFactoryInterface::TurnConfiguration> | 48 typedef std::vector<PortAllocatorFactoryInterface::TurnConfiguration> |
| 47 TurnConfigurations; | 49 TurnConfigurations; |
| 48 | 50 |
| 49 // PeerConnectionImpl implements the PeerConnection interface. | 51 // PeerConnectionImpl implements the PeerConnection interface. |
| 50 // It uses MediaStreamSignaling and WebRtcSession to implement | 52 // It uses MediaStreamSignaling and WebRtcSession to implement |
| 51 // the PeerConnection functionality. | 53 // the PeerConnection functionality. |
| 52 class PeerConnection : public PeerConnectionInterface, | 54 class PeerConnection : public PeerConnectionInterface, |
| 53 public MediaStreamSignalingObserver, | 55 public MediaStreamSignalingObserver, |
| 54 public IceObserver, | 56 public IceObserver, |
| 55 public rtc::MessageHandler, | 57 public rtc::MessageHandler, |
| 56 public sigslot::has_slots<> { | 58 public sigslot::has_slots<> { |
| 57 public: | 59 public: |
| 58 explicit PeerConnection(PeerConnectionFactory* factory); | 60 explicit PeerConnection(PeerConnectionFactory* factory); |
| 59 | 61 |
| 60 bool Initialize( | 62 bool Initialize( |
| 61 const PeerConnectionInterface::RTCConfiguration& configuration, | 63 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 62 const MediaConstraintsInterface* constraints, | 64 const MediaConstraintsInterface* constraints, |
| 63 PortAllocatorFactoryInterface* allocator_factory, | 65 PortAllocatorFactoryInterface* allocator_factory, |
| 64 DTLSIdentityServiceInterface* dtls_identity_service, | 66 PeerConnectionObserver* observer, |
| 65 PeerConnectionObserver* observer); | 67 DtlsIdentityStoreInterface* dtls_identity_store, |
| 68 rtc::KeyType key_type); | |
| 66 virtual rtc::scoped_refptr<StreamCollectionInterface> local_streams(); | 69 virtual rtc::scoped_refptr<StreamCollectionInterface> local_streams(); |
| 67 virtual rtc::scoped_refptr<StreamCollectionInterface> remote_streams(); | 70 virtual rtc::scoped_refptr<StreamCollectionInterface> remote_streams(); |
| 68 virtual bool AddStream(MediaStreamInterface* local_stream); | 71 virtual bool AddStream(MediaStreamInterface* local_stream); |
| 69 virtual void RemoveStream(MediaStreamInterface* local_stream); | 72 virtual void RemoveStream(MediaStreamInterface* local_stream); |
| 70 | 73 |
| 71 virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( | 74 virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( |
| 72 AudioTrackInterface* track); | 75 AudioTrackInterface* track); |
| 73 | 76 |
| 74 virtual rtc::scoped_refptr<DataChannelInterface> CreateDataChannel( | 77 virtual rtc::scoped_refptr<DataChannelInterface> CreateDataChannel( |
| 75 const std::string& label, | 78 const std::string& label, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 virtual void OnIceConnectionChange(IceConnectionState new_state); | 151 virtual void OnIceConnectionChange(IceConnectionState new_state); |
| 149 virtual void OnIceGatheringChange(IceGatheringState new_state); | 152 virtual void OnIceGatheringChange(IceGatheringState new_state); |
| 150 virtual void OnIceCandidate(const IceCandidateInterface* candidate); | 153 virtual void OnIceCandidate(const IceCandidateInterface* candidate); |
| 151 virtual void OnIceComplete(); | 154 virtual void OnIceComplete(); |
| 152 | 155 |
| 153 // Signals from WebRtcSession. | 156 // Signals from WebRtcSession. |
| 154 void OnSessionStateChange(cricket::BaseSession* session, | 157 void OnSessionStateChange(cricket::BaseSession* session, |
| 155 cricket::BaseSession::State state); | 158 cricket::BaseSession::State state); |
| 156 void ChangeSignalingState(SignalingState signaling_state); | 159 void ChangeSignalingState(SignalingState signaling_state); |
| 157 | 160 |
| 158 bool DoInitialize(IceTransportsType type, | |
| 159 const StunConfigurations& stun_config, | |
| 160 const TurnConfigurations& turn_config, | |
| 161 const MediaConstraintsInterface* constraints, | |
| 162 PortAllocatorFactoryInterface* allocator_factory, | |
| 163 DTLSIdentityServiceInterface* dtls_identity_service, | |
| 164 PeerConnectionObserver* observer); | |
|
hbos
2015/06/12 12:46:55
Declared, not defined. Removing.
| |
| 165 | |
| 166 rtc::Thread* signaling_thread() const { | 161 rtc::Thread* signaling_thread() const { |
| 167 return factory_->signaling_thread(); | 162 return factory_->signaling_thread(); |
| 168 } | 163 } |
| 169 | 164 |
| 170 void PostSetSessionDescriptionFailure(SetSessionDescriptionObserver* observer, | 165 void PostSetSessionDescriptionFailure(SetSessionDescriptionObserver* observer, |
| 171 const std::string& error); | 166 const std::string& error); |
| 172 | 167 |
| 173 bool IsClosed() const { | 168 bool IsClosed() const { |
| 174 return signaling_state_ == PeerConnectionInterface::kClosed; | 169 return signaling_state_ == PeerConnectionInterface::kClosed; |
| 175 } | 170 } |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 192 rtc::scoped_ptr<cricket::PortAllocator> port_allocator_; | 187 rtc::scoped_ptr<cricket::PortAllocator> port_allocator_; |
| 193 rtc::scoped_ptr<WebRtcSession> session_; | 188 rtc::scoped_ptr<WebRtcSession> session_; |
| 194 rtc::scoped_ptr<MediaStreamSignaling> mediastream_signaling_; | 189 rtc::scoped_ptr<MediaStreamSignaling> mediastream_signaling_; |
| 195 rtc::scoped_ptr<MediaStreamHandlerContainer> stream_handler_container_; | 190 rtc::scoped_ptr<MediaStreamHandlerContainer> stream_handler_container_; |
| 196 rtc::scoped_ptr<StatsCollector> stats_; | 191 rtc::scoped_ptr<StatsCollector> stats_; |
| 197 }; | 192 }; |
| 198 | 193 |
| 199 } // namespace webrtc | 194 } // namespace webrtc |
| 200 | 195 |
| 201 #endif // TALK_APP_WEBRTC_PEERCONNECTION_H_ | 196 #endif // TALK_APP_WEBRTC_PEERCONNECTION_H_ |
| OLD | NEW |