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" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 class WebRtcAudioCapturer; | 48 class WebRtcAudioCapturer; |
49 class WebRtcAudioDeviceImpl; | 49 class WebRtcAudioDeviceImpl; |
50 class WebRtcLocalAudioTrack; | 50 class WebRtcLocalAudioTrack; |
51 class WebRtcLoggingHandlerImpl; | 51 class WebRtcLoggingHandlerImpl; |
52 class WebRtcLoggingMessageFilter; | 52 class WebRtcLoggingMessageFilter; |
53 class WebRtcVideoCapturerAdapter; | 53 class WebRtcVideoCapturerAdapter; |
54 struct StreamDeviceInfo; | 54 struct StreamDeviceInfo; |
55 | 55 |
56 // Object factory for RTC PeerConnections. | 56 // Object factory for RTC PeerConnections. |
57 class CONTENT_EXPORT PeerConnectionDependencyFactory | 57 class CONTENT_EXPORT PeerConnectionDependencyFactory |
58 : NON_EXPORTED_BASE(public base::NonThreadSafe), | 58 : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
59 NON_EXPORTED_BASE(public AecDumpMessageFilter::AecDumpDelegate) { | |
60 public: | 59 public: |
61 PeerConnectionDependencyFactory( | 60 PeerConnectionDependencyFactory( |
62 P2PSocketDispatcher* p2p_socket_dispatcher); | 61 P2PSocketDispatcher* p2p_socket_dispatcher); |
63 virtual ~PeerConnectionDependencyFactory(); | 62 virtual ~PeerConnectionDependencyFactory(); |
64 | 63 |
65 // Create a RTCPeerConnectionHandler object that implements the | 64 // Create a RTCPeerConnectionHandler object that implements the |
66 // WebKit WebRTCPeerConnectionHandler interface. | 65 // WebKit WebRTCPeerConnectionHandler interface. |
67 blink::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler( | 66 blink::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler( |
68 blink::WebRTCPeerConnectionHandlerClient* client); | 67 blink::WebRTCPeerConnectionHandlerClient* client); |
69 | 68 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 122 |
124 WebRtcAudioDeviceImpl* GetWebRtcAudioDevice(); | 123 WebRtcAudioDeviceImpl* GetWebRtcAudioDevice(); |
125 | 124 |
126 static void AddNativeAudioTrackToBlinkTrack( | 125 static void AddNativeAudioTrackToBlinkTrack( |
127 webrtc::MediaStreamTrackInterface* native_track, | 126 webrtc::MediaStreamTrackInterface* native_track, |
128 const blink::WebMediaStreamTrack& webkit_track, | 127 const blink::WebMediaStreamTrack& webkit_track, |
129 bool is_local_track); | 128 bool is_local_track); |
130 | 129 |
131 scoped_refptr<base::MessageLoopProxy> GetWebRtcWorkerThread() const; | 130 scoped_refptr<base::MessageLoopProxy> GetWebRtcWorkerThread() const; |
132 | 131 |
133 // AecDumpMessageFilter::AecDumpDelegate implementation. | |
134 // TODO(xians): Remove when option to disable audio track processing is | |
135 // removed. | |
136 void OnAecDumpFile(const IPC::PlatformFileForTransit& file_handle) override; | |
137 void OnDisableAecDump() override; | |
138 void OnIpcClosing() override; | |
139 | |
140 protected: | 132 protected: |
141 // Asks the PeerConnection factory to create a Local Audio Source. | 133 // Asks the PeerConnection factory to create a Local Audio Source. |
142 virtual scoped_refptr<webrtc::AudioSourceInterface> | 134 virtual scoped_refptr<webrtc::AudioSourceInterface> |
143 CreateLocalAudioSource( | 135 CreateLocalAudioSource( |
144 const webrtc::MediaConstraintsInterface* constraints); | 136 const webrtc::MediaConstraintsInterface* constraints); |
145 | 137 |
146 // Creates a media::AudioCapturerSource with an implementation that is | 138 // Creates a media::AudioCapturerSource with an implementation that is |
147 // specific for a WebAudio source. The created WebAudioCapturerSource | 139 // specific for a WebAudio source. The created WebAudioCapturerSource |
148 // instance will function as audio source instead of the default | 140 // instance will function as audio source instead of the default |
149 // WebRtcAudioCapturer. | 141 // WebRtcAudioCapturer. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // We own network_manager_, must be deleted on the worker thread. | 183 // We own network_manager_, must be deleted on the worker thread. |
192 // The network manager uses |p2p_socket_dispatcher_|. | 184 // The network manager uses |p2p_socket_dispatcher_|. |
193 IpcNetworkManager* network_manager_; | 185 IpcNetworkManager* network_manager_; |
194 scoped_ptr<IpcPacketSocketFactory> socket_factory_; | 186 scoped_ptr<IpcPacketSocketFactory> socket_factory_; |
195 | 187 |
196 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_; | 188 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_; |
197 | 189 |
198 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; | 190 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; |
199 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; | 191 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; |
200 | 192 |
201 // This is only used if audio track processing is disabled. | |
202 // TODO(xians): Remove when option to disable audio track processing is | |
203 // removed. | |
204 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; | |
205 | |
206 // PeerConnection threads. signaling_thread_ is created from the | 193 // PeerConnection threads. signaling_thread_ is created from the |
207 // "current" chrome thread. | 194 // "current" chrome thread. |
208 rtc::Thread* signaling_thread_; | 195 rtc::Thread* signaling_thread_; |
209 rtc::Thread* worker_thread_; | 196 rtc::Thread* worker_thread_; |
210 base::Thread chrome_worker_thread_; | 197 base::Thread chrome_worker_thread_; |
211 | 198 |
212 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory); | 199 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory); |
213 }; | 200 }; |
214 | 201 |
215 } // namespace content | 202 } // namespace content |
216 | 203 |
217 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ | 204 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ |
OLD | NEW |