| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 void OnCloseStream(int stream_id); | 112 void OnCloseStream(int stream_id); |
| 113 | 113 |
| 114 // Set the volume of the audio stream referenced by |stream_id|. | 114 // Set the volume of the audio stream referenced by |stream_id|. |
| 115 void OnSetVolume(int stream_id, double volume); | 115 void OnSetVolume(int stream_id, double volume); |
| 116 | 116 |
| 117 // Complete the process of creating an audio stream. This will set up the | 117 // Complete the process of creating an audio stream. This will set up the |
| 118 // shared memory or shared socket in low latency mode and send the | 118 // shared memory or shared socket in low latency mode and send the |
| 119 // NotifyStreamCreated message to the peer. | 119 // NotifyStreamCreated message to the peer. |
| 120 void DoCompleteCreation(AudioEntry* entry); | 120 void DoCompleteCreation(AudioEntry* entry); |
| 121 | 121 |
| 122 // Propagate audible signal to MediaObserver. | 122 // Propagate measured power level of the audio signal to MediaObserver. |
| 123 void DoNotifyAudibleState(AudioEntry* entry, bool is_audible); | 123 void DoNotifyAudioPowerLevel(AudioEntry* entry, float power_in_dbfs); |
| 124 | 124 |
| 125 // Send an error message to the renderer. | 125 // Send an error message to the renderer. |
| 126 void SendErrorMessage(int stream_id); | 126 void SendErrorMessage(int stream_id); |
| 127 | 127 |
| 128 // Delete an audio entry, notifying observers first. This is called by | 128 // Delete an audio entry, notifying observers first. This is called by |
| 129 // AudioOutputController after it has closed. | 129 // AudioOutputController after it has closed. |
| 130 void DeleteEntry(scoped_ptr<AudioEntry> entry); | 130 void DeleteEntry(scoped_ptr<AudioEntry> entry); |
| 131 | 131 |
| 132 // Send an error message to the renderer, then close the stream. | 132 // Send an error message to the renderer, then close the stream. |
| 133 void ReportErrorAndClose(int stream_id); | 133 void ReportErrorAndClose(int stream_id); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 145 | 145 |
| 146 // A map of stream IDs to audio sources. | 146 // A map of stream IDs to audio sources. |
| 147 AudioEntryMap audio_entries_; | 147 AudioEntryMap audio_entries_; |
| 148 | 148 |
| 149 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); | 149 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 } // namespace content | 152 } // namespace content |
| 153 | 153 |
| 154 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ | 154 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ |
| OLD | NEW |