| 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 RenderProcessHostImpl, and instantiated on UI | 8 // This class is owned by RenderProcessHostImpl, 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // Creates an audio output stream with the specified format. | 152 // Creates an audio output stream with the specified format. |
| 153 // Upon success/failure, the peer is notified via the NotifyStreamCreated | 153 // Upon success/failure, the peer is notified via the NotifyStreamCreated |
| 154 // message. | 154 // message. |
| 155 void OnCreateStream(int stream_id, | 155 void OnCreateStream(int stream_id, |
| 156 int render_frame_id, | 156 int render_frame_id, |
| 157 const media::AudioParameters& params); | 157 const media::AudioParameters& params); |
| 158 | 158 |
| 159 // Play the audio stream referenced by |stream_id|. | 159 // Play the audio stream referenced by |stream_id|. |
| 160 void OnPlayStream(int stream_id); | 160 void OnPlayStream(int stream_id); |
| 161 | 161 |
| 162 // Called via the focus controller after an OnPlayStream() request for a |
| 163 // focusable stream (see AudioParmeters::FOCUSABLE). |
| 164 void OnFocusAvailable(int stream_id, base::TimeTicks play_time); |
| 165 |
| 162 // Pause the audio stream referenced by |stream_id|. | 166 // Pause the audio stream referenced by |stream_id|. |
| 163 void OnPauseStream(int stream_id); | 167 void OnPauseStream(int stream_id); |
| 164 | 168 |
| 165 // Close the audio stream referenced by |stream_id|. | 169 // Close the audio stream referenced by |stream_id|. |
| 166 void OnCloseStream(int stream_id); | 170 void OnCloseStream(int stream_id); |
| 167 | 171 |
| 168 // Set the volume of the audio stream referenced by |stream_id|. | 172 // Set the volume of the audio stream referenced by |stream_id|. |
| 169 void OnSetVolume(int stream_id, double volume); | 173 void OnSetVolume(int stream_id, double volume); |
| 170 | 174 |
| 171 // Helper methods. | 175 // Helper methods. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 // The maximum number of simultaneous streams during the lifetime of this | 270 // The maximum number of simultaneous streams during the lifetime of this |
| 267 // host. Reported as UMA stat at shutdown. | 271 // host. Reported as UMA stat at shutdown. |
| 268 size_t max_simultaneous_streams_; | 272 size_t max_simultaneous_streams_; |
| 269 | 273 |
| 270 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); | 274 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); |
| 271 }; | 275 }; |
| 272 | 276 |
| 273 } // namespace content | 277 } // namespace content |
| 274 | 278 |
| 275 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ | 279 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ |
| OLD | NEW |