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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 // It uses MediaStreamSignaling and WebRtcSession to implement | 51 // It uses MediaStreamSignaling and WebRtcSession to implement |
| 52 // the PeerConnection functionality. | 52 // the PeerConnection functionality. |
| 53 class PeerConnection : public PeerConnectionInterface, | 53 class PeerConnection : public PeerConnectionInterface, |
| 54 public MediaStreamSignalingObserver, | 54 public MediaStreamSignalingObserver, |
| 55 public IceObserver, | 55 public IceObserver, |
| 56 public rtc::MessageHandler, | 56 public rtc::MessageHandler, |
| 57 public sigslot::has_slots<> { | 57 public sigslot::has_slots<> { |
| 58 public: | 58 public: |
| 59 explicit PeerConnection(PeerConnectionFactory* factory); | 59 explicit PeerConnection(PeerConnectionFactory* factory); |
| 60 | 60 |
| 61 // This method takes the ownership of |dtls_identity_service|. | |
| 61 bool Initialize( | 62 bool Initialize( |
| 62 const PeerConnectionInterface::RTCConfiguration& configuration, | 63 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 63 const MediaConstraintsInterface* constraints, | 64 const MediaConstraintsInterface* constraints, |
| 64 PortAllocatorFactoryInterface* allocator_factory, | 65 PortAllocatorFactoryInterface* allocator_factory, |
| 65 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 66 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
| 66 PeerConnectionObserver* observer); | 67 PeerConnectionObserver* observer); |
| 68 bool Initialize( | |
| 69 const PeerConnectionInterface::RTCConfiguration& configuration, | |
| 70 const MediaConstraintsInterface* constraints, | |
| 71 PortAllocatorFactoryInterface* allocator_factory, | |
| 72 const rtc::scoped_refptr<DtlsCertificate>& certificate, | |
| 73 PeerConnectionObserver* observer); | |
| 67 virtual rtc::scoped_refptr<StreamCollectionInterface> local_streams(); | 74 virtual rtc::scoped_refptr<StreamCollectionInterface> local_streams(); |
| 68 virtual rtc::scoped_refptr<StreamCollectionInterface> remote_streams(); | 75 virtual rtc::scoped_refptr<StreamCollectionInterface> remote_streams(); |
| 69 virtual bool AddStream(MediaStreamInterface* local_stream); | 76 virtual bool AddStream(MediaStreamInterface* local_stream); |
| 70 virtual void RemoveStream(MediaStreamInterface* local_stream); | 77 virtual void RemoveStream(MediaStreamInterface* local_stream); |
| 71 | 78 |
| 72 virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( | 79 virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( |
| 73 AudioTrackInterface* track); | 80 AudioTrackInterface* track); |
| 74 | 81 |
| 75 virtual rtc::scoped_refptr<DataChannelInterface> CreateDataChannel( | 82 virtual rtc::scoped_refptr<DataChannelInterface> CreateDataChannel( |
| 76 const std::string& label, | 83 const std::string& label, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 virtual bool AddIceCandidate(const IceCandidateInterface* candidate); | 116 virtual bool AddIceCandidate(const IceCandidateInterface* candidate); |
| 110 | 117 |
| 111 virtual void RegisterUMAObserver(UMAObserver* observer); | 118 virtual void RegisterUMAObserver(UMAObserver* observer); |
| 112 | 119 |
| 113 virtual void Close(); | 120 virtual void Close(); |
| 114 | 121 |
| 115 protected: | 122 protected: |
| 116 virtual ~PeerConnection(); | 123 virtual ~PeerConnection(); |
| 117 | 124 |
| 118 private: | 125 private: |
| 126 bool InitializeCommon( | |
|
Henrik Grunell WebRTC
2015/08/12 14:46:29
I think these two can have clearer names. Try desc
hbos
2015/08/14 14:09:38
Done. I merged the second helper function into the
| |
| 127 const PeerConnectionInterface::RTCConfiguration& configuration, | |
| 128 const MediaConstraintsInterface* constraints, | |
| 129 PortAllocatorFactoryInterface* allocator_factory, | |
| 130 PeerConnectionObserver* observer); | |
| 131 void InitializeSessionAfterInit(); | |
| 132 | |
| 119 // Implements MessageHandler. | 133 // Implements MessageHandler. |
| 120 virtual void OnMessage(rtc::Message* msg); | 134 virtual void OnMessage(rtc::Message* msg); |
| 121 | 135 |
| 122 // Implements MediaStreamSignalingObserver. | 136 // Implements MediaStreamSignalingObserver. |
| 123 void OnAddRemoteStream(MediaStreamInterface* stream) override; | 137 void OnAddRemoteStream(MediaStreamInterface* stream) override; |
| 124 void OnRemoveRemoteStream(MediaStreamInterface* stream) override; | 138 void OnRemoveRemoteStream(MediaStreamInterface* stream) override; |
| 125 void OnAddDataChannel(DataChannelInterface* data_channel) override; | 139 void OnAddDataChannel(DataChannelInterface* data_channel) override; |
| 126 void OnAddRemoteAudioTrack(MediaStreamInterface* stream, | 140 void OnAddRemoteAudioTrack(MediaStreamInterface* stream, |
| 127 AudioTrackInterface* audio_track, | 141 AudioTrackInterface* audio_track, |
| 128 uint32 ssrc) override; | 142 uint32 ssrc) override; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 rtc::scoped_ptr<cricket::PortAllocator> port_allocator_; | 201 rtc::scoped_ptr<cricket::PortAllocator> port_allocator_; |
| 188 rtc::scoped_ptr<WebRtcSession> session_; | 202 rtc::scoped_ptr<WebRtcSession> session_; |
| 189 rtc::scoped_ptr<MediaStreamSignaling> mediastream_signaling_; | 203 rtc::scoped_ptr<MediaStreamSignaling> mediastream_signaling_; |
| 190 rtc::scoped_ptr<MediaStreamHandlerContainer> stream_handler_container_; | 204 rtc::scoped_ptr<MediaStreamHandlerContainer> stream_handler_container_; |
| 191 rtc::scoped_ptr<StatsCollector> stats_; | 205 rtc::scoped_ptr<StatsCollector> stats_; |
| 192 }; | 206 }; |
| 193 | 207 |
| 194 } // namespace webrtc | 208 } // namespace webrtc |
| 195 | 209 |
| 196 #endif // TALK_APP_WEBRTC_PEERCONNECTION_H_ | 210 #endif // TALK_APP_WEBRTC_PEERCONNECTION_H_ |
| OLD | NEW |