| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // AudioInputRendererHost serves audio related requests from audio capturer | 5 // AudioInputRendererHost serves audio related requests from audio capturer |
| 6 // which lives inside the render process and provide access to audio hardware. | 6 // which lives inside the render process and provide access to audio hardware. |
| 7 // | 7 // |
| 8 // Create stream sequence (AudioInputController = AIC): | 8 // Create stream sequence (AudioInputController = AIC): |
| 9 // | 9 // |
| 10 // AudioInputHostMsg_CreateStream -> OnCreateStream -> AIC::CreateLowLatency -> | 10 // AudioInputHostMsg_CreateStream -> OnCreateStream -> AIC::CreateLowLatency -> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Unable to prepare the foreign socket handle. | 80 // Unable to prepare the foreign socket handle. |
| 81 SYNC_SOCKET_ERROR, // = 8, | 81 SYNC_SOCKET_ERROR, // = 8, |
| 82 | 82 |
| 83 // This error message comes from the AudioInputController instance. | 83 // This error message comes from the AudioInputController instance. |
| 84 AUDIO_INPUT_CONTROLLER_ERROR, // = 9, | 84 AUDIO_INPUT_CONTROLLER_ERROR, // = 9, |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 // Called from UI thread from the owner of this object. | 87 // Called from UI thread from the owner of this object. |
| 88 // |user_input_monitor| is used for typing detection and can be NULL. | 88 // |user_input_monitor| is used for typing detection and can be NULL. |
| 89 AudioInputRendererHost(int render_process_id, | 89 AudioInputRendererHost(int render_process_id, |
| 90 int32_t renderer_pid, | |
| 91 media::AudioManager* audio_manager, | 90 media::AudioManager* audio_manager, |
| 92 MediaStreamManager* media_stream_manager, | 91 MediaStreamManager* media_stream_manager, |
| 93 AudioMirroringManager* audio_mirroring_manager, | 92 AudioMirroringManager* audio_mirroring_manager, |
| 94 media::UserInputMonitor* user_input_monitor); | 93 media::UserInputMonitor* user_input_monitor); |
| 95 | 94 |
| 96 #if BUILDFLAG(ENABLE_WEBRTC) | 95 #if BUILDFLAG(ENABLE_WEBRTC) |
| 97 // Enable and disable debug recording of input on all audio entries. | 96 // Enable and disable debug recording of input on all audio entries. |
| 98 void EnableDebugRecording(const base::FilePath& file); | 97 void EnableDebugRecording(const base::FilePath& file); |
| 99 void DisableDebugRecording(); | 98 void DisableDebugRecording(); |
| 100 #endif | 99 #endif |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // This method is used to look up an AudioEntry after a controller | 195 // This method is used to look up an AudioEntry after a controller |
| 197 // event is received. | 196 // event is received. |
| 198 AudioEntry* LookupByController(media::AudioInputController* controller); | 197 AudioEntry* LookupByController(media::AudioInputController* controller); |
| 199 | 198 |
| 200 // If ChromeOS and |config|'s layout has keyboard mic, unregister in | 199 // If ChromeOS and |config|'s layout has keyboard mic, unregister in |
| 201 // AudioInputDeviceManager. | 200 // AudioInputDeviceManager. |
| 202 void MaybeUnregisterKeyboardMicStream( | 201 void MaybeUnregisterKeyboardMicStream( |
| 203 const AudioInputHostMsg_CreateStream_Config& config); | 202 const AudioInputHostMsg_CreateStream_Config& config); |
| 204 | 203 |
| 205 #if BUILDFLAG(ENABLE_WEBRTC) | 204 #if BUILDFLAG(ENABLE_WEBRTC) |
| 205 // TODO(grunell): Move debug recording handling to AudioManager. |
| 206 void MaybeEnableDebugRecordingForId(int stream_id); | 206 void MaybeEnableDebugRecordingForId(int stream_id); |
| 207 | 207 |
| 208 base::FilePath GetDebugRecordingFilePathWithExtensions( | 208 base::FilePath GetDebugRecordingFilePathWithExtensions( |
| 209 const base::FilePath& file); | 209 const base::FilePath& file); |
| 210 | 210 |
| 211 void EnableDebugRecordingForId(const base::FilePath& file, int stream_id); | 211 void EnableDebugRecordingForId(const base::FilePath& file, int stream_id); |
| 212 | 212 |
| 213 // Calls GetDebugRecordingFilePathWithExtensions() and |
| 214 // EnableDebugRecordingForId(). |
| 215 void AddExtensionsToPathAndEnableDebugRecordingForId( |
| 216 const base::FilePath& file, |
| 217 int stream_id); |
| 218 |
| 213 void DoEnableDebugRecording(int stream_id, base::File file); | 219 void DoEnableDebugRecording(int stream_id, base::File file); |
| 214 void DoDisableDebugRecording(int stream_id); | 220 void DoDisableDebugRecording(int stream_id); |
| 215 | 221 |
| 216 // Delete the debug writer used for debug recordings for |stream_id|. | 222 // Delete the debug writer used for debug recordings for |stream_id|. |
| 217 void DeleteDebugWriter(int stream_id); | 223 void DeleteDebugWriter(int stream_id); |
| 218 #endif | 224 #endif |
| 219 | 225 |
| 220 // ID of the RenderProcessHost that owns this instance. | 226 // ID of the RenderProcessHost that owns this instance. |
| 221 const int render_process_id_; | 227 const int render_process_id_; |
| 222 | 228 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 239 media::UserInputMonitor* const user_input_monitor_; | 245 media::UserInputMonitor* const user_input_monitor_; |
| 240 | 246 |
| 241 std::unique_ptr<media::AudioLog> audio_log_; | 247 std::unique_ptr<media::AudioLog> audio_log_; |
| 242 | 248 |
| 243 DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost); | 249 DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost); |
| 244 }; | 250 }; |
| 245 | 251 |
| 246 } // namespace content | 252 } // namespace content |
| 247 | 253 |
| 248 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_RENDERER_HOST_H_ | 254 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_RENDERER_HOST_H_ |
| OLD | NEW |