| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/files/file.h" | 11 #include "base/files/file.h" |
| 12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/public/renderer/render_process_observer.h" | 14 #include "content/public/renderer/render_process_observer.h" |
| 15 #include "content/renderer/media/aec_dump_message_filter.h" | 15 #include "content/renderer/media/aec_dump_message_filter.h" |
| 16 #include "content/renderer/p2p/socket_dispatcher.h" | 16 #include "content/renderer/p2p/socket_dispatcher.h" |
| 17 #include "ipc/ipc_platform_file.h" | 17 #include "ipc/ipc_platform_file.h" |
| 18 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h
" | 18 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h
" |
| 19 #include "third_party/libjingle/source/talk/app/webrtc/videosourceinterface.h" | 19 #include "third_party/libjingle/source/talk/app/webrtc/videosourceinterface.h" |
| 20 | 20 |
| 21 namespace base { | 21 namespace base { |
| 22 class WaitableEvent; | 22 class WaitableEvent; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace talk_base { | 25 namespace rtc { |
| 26 class NetworkManager; | 26 class NetworkManager; |
| 27 class PacketSocketFactory; | 27 class PacketSocketFactory; |
| 28 class Thread; | 28 class Thread; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 class WebFrame; | 32 class WebFrame; |
| 33 class WebMediaConstraints; | 33 class WebMediaConstraints; |
| 34 class WebMediaStream; | 34 class WebMediaStream; |
| 35 class WebMediaStreamSource; | 35 class WebMediaStreamSource; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 // Adds the audio device as a sink to the audio track and starts the local | 172 // Adds the audio device as a sink to the audio track and starts the local |
| 173 // audio track. This is virtual for test purposes since no real audio device | 173 // audio track. This is virtual for test purposes since no real audio device |
| 174 // exist in unit tests. | 174 // exist in unit tests. |
| 175 virtual void StartLocalAudioTrack(WebRtcLocalAudioTrack* audio_track); | 175 virtual void StartLocalAudioTrack(WebRtcLocalAudioTrack* audio_track); |
| 176 | 176 |
| 177 private: | 177 private: |
| 178 // Creates |pc_factory_|, which in turn is used for | 178 // Creates |pc_factory_|, which in turn is used for |
| 179 // creating PeerConnection objects. | 179 // creating PeerConnection objects. |
| 180 void CreatePeerConnectionFactory(); | 180 void CreatePeerConnectionFactory(); |
| 181 | 181 |
| 182 void InitializeWorkerThread(talk_base::Thread** thread, | 182 void InitializeWorkerThread(rtc::Thread** thread, |
| 183 base::WaitableEvent* event); | 183 base::WaitableEvent* event); |
| 184 | 184 |
| 185 void CreateIpcNetworkManagerOnWorkerThread(base::WaitableEvent* event); | 185 void CreateIpcNetworkManagerOnWorkerThread(base::WaitableEvent* event); |
| 186 void DeleteIpcNetworkManager(); | 186 void DeleteIpcNetworkManager(); |
| 187 void CleanupPeerConnectionFactory(); | 187 void CleanupPeerConnectionFactory(); |
| 188 | 188 |
| 189 // Helper method to create a WebRtcAudioDeviceImpl. | 189 // Helper method to create a WebRtcAudioDeviceImpl. |
| 190 void EnsureWebRtcAudioDeviceImpl(); | 190 void EnsureWebRtcAudioDeviceImpl(); |
| 191 | 191 |
| 192 // We own network_manager_, must be deleted on the worker thread. | 192 // We own network_manager_, must be deleted on the worker thread. |
| 193 // The network manager uses |p2p_socket_dispatcher_|. | 193 // The network manager uses |p2p_socket_dispatcher_|. |
| 194 IpcNetworkManager* network_manager_; | 194 IpcNetworkManager* network_manager_; |
| 195 scoped_ptr<IpcPacketSocketFactory> socket_factory_; | 195 scoped_ptr<IpcPacketSocketFactory> socket_factory_; |
| 196 | 196 |
| 197 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_; | 197 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_; |
| 198 | 198 |
| 199 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; | 199 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; |
| 200 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; | 200 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; |
| 201 | 201 |
| 202 // This is only used if audio track processing is disabled. | 202 // This is only used if audio track processing is disabled. |
| 203 // TODO(xians): Remove when option to disable audio track processing is | 203 // TODO(xians): Remove when option to disable audio track processing is |
| 204 // removed. | 204 // removed. |
| 205 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; | 205 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; |
| 206 | 206 |
| 207 // PeerConnection threads. signaling_thread_ is created from the | 207 // PeerConnection threads. signaling_thread_ is created from the |
| 208 // "current" chrome thread. | 208 // "current" chrome thread. |
| 209 talk_base::Thread* signaling_thread_; | 209 rtc::Thread* signaling_thread_; |
| 210 talk_base::Thread* worker_thread_; | 210 rtc::Thread* worker_thread_; |
| 211 base::Thread chrome_worker_thread_; | 211 base::Thread chrome_worker_thread_; |
| 212 | 212 |
| 213 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory); | 213 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory); |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 } // namespace content | 216 } // namespace content |
| 217 | 217 |
| 218 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ | 218 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ |
| OLD | NEW |