| 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" |
| 40 | 41 |
| 41 namespace webrtc { | 42 namespace webrtc { |
| 42 class MediaStreamHandlerContainer; | 43 class MediaStreamHandlerContainer; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 54 public IceObserver, | 55 public IceObserver, |
| 55 public rtc::MessageHandler, | 56 public rtc::MessageHandler, |
| 56 public sigslot::has_slots<> { | 57 public sigslot::has_slots<> { |
| 57 public: | 58 public: |
| 58 explicit PeerConnection(PeerConnectionFactory* factory); | 59 explicit PeerConnection(PeerConnectionFactory* factory); |
| 59 | 60 |
| 60 bool Initialize( | 61 bool Initialize( |
| 61 const PeerConnectionInterface::RTCConfiguration& configuration, | 62 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 62 const MediaConstraintsInterface* constraints, | 63 const MediaConstraintsInterface* constraints, |
| 63 PortAllocatorFactoryInterface* allocator_factory, | 64 PortAllocatorFactoryInterface* allocator_factory, |
| 64 DTLSIdentityServiceInterface* dtls_identity_service, | 65 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
| 65 PeerConnectionObserver* observer); | 66 PeerConnectionObserver* observer); |
| 66 virtual rtc::scoped_refptr<StreamCollectionInterface> local_streams(); | 67 virtual rtc::scoped_refptr<StreamCollectionInterface> local_streams(); |
| 67 virtual rtc::scoped_refptr<StreamCollectionInterface> remote_streams(); | 68 virtual rtc::scoped_refptr<StreamCollectionInterface> remote_streams(); |
| 68 virtual bool AddStream(MediaStreamInterface* local_stream); | 69 virtual bool AddStream(MediaStreamInterface* local_stream); |
| 69 virtual void RemoveStream(MediaStreamInterface* local_stream); | 70 virtual void RemoveStream(MediaStreamInterface* local_stream); |
| 70 | 71 |
| 71 virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( | 72 virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( |
| 72 AudioTrackInterface* track); | 73 AudioTrackInterface* track); |
| 73 | 74 |
| 74 virtual rtc::scoped_refptr<DataChannelInterface> CreateDataChannel( | 75 virtual rtc::scoped_refptr<DataChannelInterface> CreateDataChannel( |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 void OnIceGatheringChange(IceGatheringState new_state) override; | 151 void OnIceGatheringChange(IceGatheringState new_state) override; |
| 151 void OnIceCandidate(const IceCandidateInterface* candidate) override; | 152 void OnIceCandidate(const IceCandidateInterface* candidate) override; |
| 152 void OnIceComplete() override; | 153 void OnIceComplete() override; |
| 153 void OnIceConnectionReceivingChange(bool receiving) override; | 154 void OnIceConnectionReceivingChange(bool receiving) override; |
| 154 | 155 |
| 155 // Signals from WebRtcSession. | 156 // Signals from WebRtcSession. |
| 156 void OnSessionStateChange(cricket::BaseSession* session, | 157 void OnSessionStateChange(cricket::BaseSession* session, |
| 157 cricket::BaseSession::State state); | 158 cricket::BaseSession::State state); |
| 158 void ChangeSignalingState(SignalingState signaling_state); | 159 void ChangeSignalingState(SignalingState signaling_state); |
| 159 | 160 |
| 160 bool DoInitialize(IceTransportsType type, | |
| 161 const StunConfigurations& stun_config, | |
| 162 const TurnConfigurations& turn_config, | |
| 163 const MediaConstraintsInterface* constraints, | |
| 164 PortAllocatorFactoryInterface* allocator_factory, | |
| 165 DTLSIdentityServiceInterface* dtls_identity_service, | |
| 166 PeerConnectionObserver* observer); | |
| 167 | |
| 168 rtc::Thread* signaling_thread() const { | 161 rtc::Thread* signaling_thread() const { |
| 169 return factory_->signaling_thread(); | 162 return factory_->signaling_thread(); |
| 170 } | 163 } |
| 171 | 164 |
| 172 void PostSetSessionDescriptionFailure(SetSessionDescriptionObserver* observer, | 165 void PostSetSessionDescriptionFailure(SetSessionDescriptionObserver* observer, |
| 173 const std::string& error); | 166 const std::string& error); |
| 174 | 167 |
| 175 bool IsClosed() const { | 168 bool IsClosed() const { |
| 176 return signaling_state_ == PeerConnectionInterface::kClosed; | 169 return signaling_state_ == PeerConnectionInterface::kClosed; |
| 177 } | 170 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 194 rtc::scoped_ptr<cricket::PortAllocator> port_allocator_; | 187 rtc::scoped_ptr<cricket::PortAllocator> port_allocator_; |
| 195 rtc::scoped_ptr<WebRtcSession> session_; | 188 rtc::scoped_ptr<WebRtcSession> session_; |
| 196 rtc::scoped_ptr<MediaStreamSignaling> mediastream_signaling_; | 189 rtc::scoped_ptr<MediaStreamSignaling> mediastream_signaling_; |
| 197 rtc::scoped_ptr<MediaStreamHandlerContainer> stream_handler_container_; | 190 rtc::scoped_ptr<MediaStreamHandlerContainer> stream_handler_container_; |
| 198 rtc::scoped_ptr<StatsCollector> stats_; | 191 rtc::scoped_ptr<StatsCollector> stats_; |
| 199 }; | 192 }; |
| 200 | 193 |
| 201 } // namespace webrtc | 194 } // namespace webrtc |
| 202 | 195 |
| 203 #endif // TALK_APP_WEBRTC_PEERCONNECTION_H_ | 196 #endif // TALK_APP_WEBRTC_PEERCONNECTION_H_ |
| OLD | NEW |