| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 // BrowserMessageFilter implementation. | 60 // BrowserMessageFilter implementation. |
| 61 virtual void OnChannelClosing() OVERRIDE; | 61 virtual void OnChannelClosing() OVERRIDE; |
| 62 virtual void OnDestruct() const OVERRIDE; | 62 virtual void OnDestruct() const OVERRIDE; |
| 63 virtual bool OnMessageReceived(const IPC::Message& message, | 63 virtual bool OnMessageReceived(const IPC::Message& message, |
| 64 bool* message_was_ok) OVERRIDE; | 64 bool* message_was_ok) OVERRIDE; |
| 65 | 65 |
| 66 // AudioInputController::EventHandler implementation. | 66 // AudioInputController::EventHandler implementation. |
| 67 virtual void OnCreated(media::AudioInputController* controller) OVERRIDE; | 67 virtual void OnCreated(media::AudioInputController* controller) OVERRIDE; |
| 68 virtual void OnRecording(media::AudioInputController* controller) OVERRIDE; | 68 virtual void OnRecording(media::AudioInputController* controller) OVERRIDE; |
| 69 virtual void OnError(media::AudioInputController* controller, | 69 virtual void OnError(media::AudioInputController* controller) OVERRIDE; |
| 70 int error_code) OVERRIDE; | |
| 71 virtual void OnData(media::AudioInputController* controller, | 70 virtual void OnData(media::AudioInputController* controller, |
| 72 const uint8* data, | 71 const uint8* data, |
| 73 uint32 size) OVERRIDE; | 72 uint32 size) OVERRIDE; |
| 74 | 73 |
| 75 private: | 74 private: |
| 76 // TODO(henrika): extend test suite (compare AudioRenderHost) | 75 // TODO(henrika): extend test suite (compare AudioRenderHost) |
| 77 friend class BrowserThread; | 76 friend class BrowserThread; |
| 78 friend class base::DeleteHelper<AudioInputRendererHost>; | 77 friend class base::DeleteHelper<AudioInputRendererHost>; |
| 79 | 78 |
| 80 struct AudioEntry; | 79 struct AudioEntry; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 110 void OnSetVolume(int stream_id, double volume); | 109 void OnSetVolume(int stream_id, double volume); |
| 111 | 110 |
| 112 // Complete the process of creating an audio input stream. This will set up | 111 // Complete the process of creating an audio input stream. This will set up |
| 113 // the shared memory or shared socket in low latency mode. | 112 // the shared memory or shared socket in low latency mode. |
| 114 void DoCompleteCreation(media::AudioInputController* controller); | 113 void DoCompleteCreation(media::AudioInputController* controller); |
| 115 | 114 |
| 116 // Send a state change message to the renderer. | 115 // Send a state change message to the renderer. |
| 117 void DoSendRecordingMessage(media::AudioInputController* controller); | 116 void DoSendRecordingMessage(media::AudioInputController* controller); |
| 118 | 117 |
| 119 // Handle error coming from audio stream. | 118 // Handle error coming from audio stream. |
| 120 void DoHandleError(media::AudioInputController* controller, int error_code); | 119 void DoHandleError(media::AudioInputController* controller); |
| 121 | 120 |
| 122 // Send an error message to the renderer. | 121 // Send an error message to the renderer. |
| 123 void SendErrorMessage(int stream_id); | 122 void SendErrorMessage(int stream_id); |
| 124 | 123 |
| 125 // Delete all audio entry and all audio streams | 124 // Delete all audio entry and all audio streams |
| 126 void DeleteEntries(); | 125 void DeleteEntries(); |
| 127 | 126 |
| 128 // Closes the stream. The stream is then deleted in DeleteEntry() after it | 127 // Closes the stream. The stream is then deleted in DeleteEntry() after it |
| 129 // is closed. | 128 // is closed. |
| 130 void CloseAndDeleteStream(AudioEntry* entry); | 129 void CloseAndDeleteStream(AudioEntry* entry); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 152 | 151 |
| 153 // A map of stream IDs to audio sources. | 152 // A map of stream IDs to audio sources. |
| 154 AudioEntryMap audio_entries_; | 153 AudioEntryMap audio_entries_; |
| 155 | 154 |
| 156 DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost); | 155 DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost); |
| 157 }; | 156 }; |
| 158 | 157 |
| 159 } // namespace content | 158 } // namespace content |
| 160 | 159 |
| 161 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_RENDERER_HOST_H_ | 160 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_RENDERER_HOST_H_ |
| OLD | NEW |