| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 112 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 113 | 113 |
| 114 // AudioInputController::EventHandler implementation. | 114 // AudioInputController::EventHandler implementation. |
| 115 virtual void OnCreated(media::AudioInputController* controller) OVERRIDE; | 115 virtual void OnCreated(media::AudioInputController* controller) OVERRIDE; |
| 116 virtual void OnRecording(media::AudioInputController* controller) OVERRIDE; | 116 virtual void OnRecording(media::AudioInputController* controller) OVERRIDE; |
| 117 virtual void OnError(media::AudioInputController* controller, | 117 virtual void OnError(media::AudioInputController* controller, |
| 118 media::AudioInputController::ErrorCode error_code) OVERRIDE; | 118 media::AudioInputController::ErrorCode error_code) OVERRIDE; |
| 119 virtual void OnData(media::AudioInputController* controller, | 119 virtual void OnData(media::AudioInputController* controller, |
| 120 const uint8* data, | 120 const uint8* data, |
| 121 uint32 size) OVERRIDE; | 121 uint32 size) OVERRIDE; |
| 122 virtual void OnLog(media::AudioInputController* controller, |
| 123 const std::string& message) OVERRIDE; |
| 122 | 124 |
| 123 private: | 125 private: |
| 124 // TODO(henrika): extend test suite (compare AudioRenderHost) | 126 // TODO(henrika): extend test suite (compare AudioRenderHost) |
| 125 friend class BrowserThread; | 127 friend class BrowserThread; |
| 126 friend class TestAudioInputRendererHost; | 128 friend class TestAudioInputRendererHost; |
| 127 friend class base::DeleteHelper<AudioInputRendererHost>; | 129 friend class base::DeleteHelper<AudioInputRendererHost>; |
| 128 | 130 |
| 129 struct AudioEntry; | 131 struct AudioEntry; |
| 130 typedef std::map<int, AudioEntry*> AudioEntryMap; | 132 typedef std::map<int, AudioEntry*> AudioEntryMap; |
| 131 | 133 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 159 // NotifyStreamCreated message to the peer. | 161 // NotifyStreamCreated message to the peer. |
| 160 void DoCompleteCreation(media::AudioInputController* controller); | 162 void DoCompleteCreation(media::AudioInputController* controller); |
| 161 | 163 |
| 162 // Send a state change message to the renderer. | 164 // Send a state change message to the renderer. |
| 163 void DoSendRecordingMessage(media::AudioInputController* controller); | 165 void DoSendRecordingMessage(media::AudioInputController* controller); |
| 164 | 166 |
| 165 // Handle error coming from audio stream. | 167 // Handle error coming from audio stream. |
| 166 void DoHandleError(media::AudioInputController* controller, | 168 void DoHandleError(media::AudioInputController* controller, |
| 167 media::AudioInputController::ErrorCode error_code); | 169 media::AudioInputController::ErrorCode error_code); |
| 168 | 170 |
| 171 // Log audio level of captured audio stream. |
| 172 void DoLog(media::AudioInputController* controller, |
| 173 const std::string& message); |
| 174 |
| 169 // Send an error message to the renderer. | 175 // Send an error message to the renderer. |
| 170 void SendErrorMessage(int stream_id, ErrorCode error_code); | 176 void SendErrorMessage(int stream_id, ErrorCode error_code); |
| 171 | 177 |
| 172 // Delete all audio entry and all audio streams | 178 // Delete all audio entry and all audio streams |
| 173 void DeleteEntries(); | 179 void DeleteEntries(); |
| 174 | 180 |
| 175 // Closes the stream. The stream is then deleted in DeleteEntry() after it | 181 // Closes the stream. The stream is then deleted in DeleteEntry() after it |
| 176 // is closed. | 182 // is closed. |
| 177 void CloseAndDeleteStream(AudioEntry* entry); | 183 void CloseAndDeleteStream(AudioEntry* entry); |
| 178 | 184 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 206 media::UserInputMonitor* user_input_monitor_; | 212 media::UserInputMonitor* user_input_monitor_; |
| 207 | 213 |
| 208 scoped_ptr<media::AudioLog> audio_log_; | 214 scoped_ptr<media::AudioLog> audio_log_; |
| 209 | 215 |
| 210 DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost); | 216 DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost); |
| 211 }; | 217 }; |
| 212 | 218 |
| 213 } // namespace content | 219 } // namespace content |
| 214 | 220 |
| 215 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_RENDERER_HOST_H_ | 221 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_RENDERER_HOST_H_ |
| OLD | NEW |