Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: content/renderer/media/webrtc/peer_connection_dependency_factory.h

Issue 334743006: Support multiple files for AEC dump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review (sky). Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/p2p/socket_dispatcher.h" 16 #include "content/renderer/p2p/socket_dispatcher.h"
16 #include "ipc/ipc_platform_file.h" 17 #include "ipc/ipc_platform_file.h"
17 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h " 18 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h "
18 #include "third_party/libjingle/source/talk/app/webrtc/videosourceinterface.h" 19 #include "third_party/libjingle/source/talk/app/webrtc/videosourceinterface.h"
19 20
20 namespace base { 21 namespace base {
21 class WaitableEvent; 22 class WaitableEvent;
22 } 23 }
23 24
24 namespace talk_base { 25 namespace talk_base {
(...skipping 23 matching lines...) Expand all
48 class WebRtcAudioDeviceImpl; 49 class WebRtcAudioDeviceImpl;
49 class WebRtcLocalAudioTrack; 50 class WebRtcLocalAudioTrack;
50 class WebRtcLoggingHandlerImpl; 51 class WebRtcLoggingHandlerImpl;
51 class WebRtcLoggingMessageFilter; 52 class WebRtcLoggingMessageFilter;
52 class WebRtcVideoCapturerAdapter; 53 class WebRtcVideoCapturerAdapter;
53 struct StreamDeviceInfo; 54 struct StreamDeviceInfo;
54 55
55 // Object factory for RTC PeerConnections. 56 // Object factory for RTC PeerConnections.
56 class CONTENT_EXPORT PeerConnectionDependencyFactory 57 class CONTENT_EXPORT PeerConnectionDependencyFactory
57 : NON_EXPORTED_BASE(public base::NonThreadSafe), 58 : NON_EXPORTED_BASE(public base::NonThreadSafe),
58 public RenderProcessObserver { 59 NON_EXPORTED_BASE(public AecDumpMessageFilter::AecDumpObserver) {
59 public: 60 public:
60 PeerConnectionDependencyFactory( 61 PeerConnectionDependencyFactory(
61 P2PSocketDispatcher* p2p_socket_dispatcher); 62 P2PSocketDispatcher* p2p_socket_dispatcher);
62 virtual ~PeerConnectionDependencyFactory(); 63 virtual ~PeerConnectionDependencyFactory();
63 64
64 // Create a RTCPeerConnectionHandler object that implements the 65 // Create a RTCPeerConnectionHandler object that implements the
65 // WebKit WebRTCPeerConnectionHandler interface. 66 // WebKit WebRTCPeerConnectionHandler interface.
66 blink::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler( 67 blink::WebRTCPeerConnectionHandler* CreateRTCPeerConnectionHandler(
67 blink::WebRTCPeerConnectionHandlerClient* client); 68 blink::WebRTCPeerConnectionHandlerClient* client);
68 69
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 123
123 WebRtcAudioDeviceImpl* GetWebRtcAudioDevice(); 124 WebRtcAudioDeviceImpl* GetWebRtcAudioDevice();
124 125
125 static void AddNativeAudioTrackToBlinkTrack( 126 static void AddNativeAudioTrackToBlinkTrack(
126 webrtc::MediaStreamTrackInterface* native_track, 127 webrtc::MediaStreamTrackInterface* native_track,
127 const blink::WebMediaStreamTrack& webkit_track, 128 const blink::WebMediaStreamTrack& webkit_track,
128 bool is_local_track); 129 bool is_local_track);
129 130
130 scoped_refptr<base::MessageLoopProxy> GetWebRtcWorkerThread() const; 131 scoped_refptr<base::MessageLoopProxy> GetWebRtcWorkerThread() const;
131 132
133 // AecDumpMessageFilter::AecDumpObserver implementation.
134 // TODO(xians): Remove when option to disable audio track processing is
135 // removed.
136 virtual void OnAecDumpFile(
137 int id,
138 const IPC::PlatformFileForTransit& file_handle) OVERRIDE;
139 virtual void OnDisableAecDump() OVERRIDE;
140 virtual void OnIpcClosed() OVERRIDE;
141
132 protected: 142 protected:
133 // Asks the PeerConnection factory to create a Local Audio Source. 143 // Asks the PeerConnection factory to create a Local Audio Source.
134 virtual scoped_refptr<webrtc::AudioSourceInterface> 144 virtual scoped_refptr<webrtc::AudioSourceInterface>
135 CreateLocalAudioSource( 145 CreateLocalAudioSource(
136 const webrtc::MediaConstraintsInterface* constraints); 146 const webrtc::MediaConstraintsInterface* constraints);
137 147
138 // Creates a media::AudioCapturerSource with an implementation that is 148 // Creates a media::AudioCapturerSource with an implementation that is
139 // specific for a WebAudio source. The created WebAudioCapturerSource 149 // specific for a WebAudio source. The created WebAudioCapturerSource
140 // instance will function as audio source instead of the default 150 // instance will function as audio source instead of the default
141 // WebRtcAudioCapturer. 151 // WebRtcAudioCapturer.
(...skipping 28 matching lines...) Expand all
170 // creating PeerConnection objects. 180 // creating PeerConnection objects.
171 void CreatePeerConnectionFactory(); 181 void CreatePeerConnectionFactory();
172 182
173 void InitializeWorkerThread(talk_base::Thread** thread, 183 void InitializeWorkerThread(talk_base::Thread** thread,
174 base::WaitableEvent* event); 184 base::WaitableEvent* event);
175 185
176 void CreateIpcNetworkManagerOnWorkerThread(base::WaitableEvent* event); 186 void CreateIpcNetworkManagerOnWorkerThread(base::WaitableEvent* event);
177 void DeleteIpcNetworkManager(); 187 void DeleteIpcNetworkManager();
178 void CleanupPeerConnectionFactory(); 188 void CleanupPeerConnectionFactory();
179 189
180 // RenderProcessObserver implementation.
181 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
182
183 void OnAecDumpFile(IPC::PlatformFileForTransit file_handle);
184 void OnDisableAecDump();
185
186 void StartAecDump(base::File aec_dump_file);
187
188 // Helper method to create a WebRtcAudioDeviceImpl. 190 // Helper method to create a WebRtcAudioDeviceImpl.
189 void EnsureWebRtcAudioDeviceImpl(); 191 void EnsureWebRtcAudioDeviceImpl();
190 192
191 // We own network_manager_, must be deleted on the worker thread. 193 // We own network_manager_, must be deleted on the worker thread.
192 // The network manager uses |p2p_socket_dispatcher_|. 194 // The network manager uses |p2p_socket_dispatcher_|.
193 IpcNetworkManager* network_manager_; 195 IpcNetworkManager* network_manager_;
194 scoped_ptr<IpcPacketSocketFactory> socket_factory_; 196 scoped_ptr<IpcPacketSocketFactory> socket_factory_;
195 197
196 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_; 198 scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_;
197 199
198 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; 200 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_;
199 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; 201 scoped_refptr<WebRtcAudioDeviceImpl> audio_device_;
200 202
203 // This is only used if audio track processing is disabled.
204 // TODO(xians): Remove when option to disable audio track processing is
205 // removed.
206 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_;
207
201 // PeerConnection threads. signaling_thread_ is created from the 208 // PeerConnection threads. signaling_thread_ is created from the
202 // "current" chrome thread. 209 // "current" chrome thread.
203 talk_base::Thread* signaling_thread_; 210 talk_base::Thread* signaling_thread_;
204 talk_base::Thread* worker_thread_; 211 talk_base::Thread* worker_thread_;
205 base::Thread chrome_worker_thread_; 212 base::Thread chrome_worker_thread_;
206 213
207 base::File aec_dump_file_;
208
209 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory); 214 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory);
210 }; 215 };
211 216
212 } // namespace content 217 } // namespace content
213 218
214 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ 219 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698