| 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 // AudioRendererHost serves audio related requests from AudioRenderer which | 5 // AudioRendererHost serves audio related requests from AudioRenderer which |
| 6 // lives inside the render process and provide access to audio hardware. | 6 // lives inside the render process and provide access to audio hardware. |
| 7 // | 7 // |
| 8 // This class is owned by BrowserRenderProcessHost, and instantiated on UI | 8 // This class is owned by BrowserRenderProcessHost, and instantiated on UI |
| 9 // thread, but all other operations and method calls happen on IO thread, so we | 9 // thread, but all other operations and method calls happen on IO thread, so we |
| 10 // need to be extra careful about the lifetime of this object. AudioManager is a | 10 // need to be extra careful about the lifetime of this object. AudioManager is a |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 void OnCloseStream(int stream_id); | 118 void OnCloseStream(int stream_id); |
| 119 | 119 |
| 120 // Set the volume of the audio stream referenced by |stream_id|. | 120 // Set the volume of the audio stream referenced by |stream_id|. |
| 121 void OnSetVolume(int stream_id, double volume); | 121 void OnSetVolume(int stream_id, double volume); |
| 122 | 122 |
| 123 // Complete the process of creating an audio stream. This will set up the | 123 // Complete the process of creating an audio stream. This will set up the |
| 124 // shared memory or shared socket in low latency mode and send the | 124 // shared memory or shared socket in low latency mode and send the |
| 125 // NotifyStreamCreated message to the peer. | 125 // NotifyStreamCreated message to the peer. |
| 126 void DoCompleteCreation(AudioEntry* entry); | 126 void DoCompleteCreation(AudioEntry* entry); |
| 127 | 127 |
| 128 // Propagate audible signal to MediaObserver. | 128 // Propagate measured power level of the audio signal to MediaObserver. |
| 129 void DoNotifyAudibleState(AudioEntry* entry, bool is_audible); | 129 void DoNotifyAudioPowerLevel(AudioEntry* entry, |
| 130 float power_dbfs, bool clipped); |
| 130 | 131 |
| 131 // Send an error message to the renderer. | 132 // Send an error message to the renderer. |
| 132 void SendErrorMessage(int stream_id); | 133 void SendErrorMessage(int stream_id); |
| 133 | 134 |
| 134 // Delete an audio entry, notifying observers first. This is called by | 135 // Delete an audio entry, notifying observers first. This is called by |
| 135 // AudioOutputController after it has closed. | 136 // AudioOutputController after it has closed. |
| 136 void DeleteEntry(scoped_ptr<AudioEntry> entry); | 137 void DeleteEntry(scoped_ptr<AudioEntry> entry); |
| 137 | 138 |
| 138 // Send an error message to the renderer, then close the stream. | 139 // Send an error message to the renderer, then close the stream. |
| 139 void ReportErrorAndClose(int stream_id); | 140 void ReportErrorAndClose(int stream_id); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 154 | 155 |
| 155 // A map of stream IDs to audio sources. | 156 // A map of stream IDs to audio sources. |
| 156 AudioEntryMap audio_entries_; | 157 AudioEntryMap audio_entries_; |
| 157 | 158 |
| 158 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); | 159 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); |
| 159 }; | 160 }; |
| 160 | 161 |
| 161 } // namespace content | 162 } // namespace content |
| 162 | 163 |
| 163 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ | 164 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ |
| OLD | NEW |