OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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. It maps | 6 // lives inside the render process and provide access to audio hardware. It maps |
7 // an internal ID to AudioRendererHost::IPCAudioSource in a map, which is the | 7 // an internal ID to AudioRendererHost::IPCAudioSource in a map, which is the |
8 // actual object providing audio packets through IPC. It creates the actual | 8 // actual object providing audio packets through IPC. It creates the actual |
9 // AudioOutputStream object when requested by the renderer provided with | 9 // AudioOutputStream object when requested by the renderer provided with |
10 // render view id and stream id. | 10 // render view id and stream id. |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // to AudioOutputStream::STATE_PAUSED and the state update is sent to | 184 // to AudioOutputStream::STATE_PAUSED and the state update is sent to |
185 // the renderer. | 185 // the renderer. |
186 void Pause(); | 186 void Pause(); |
187 | 187 |
188 // Closes the audio output stream. After calling this method all activities | 188 // Closes the audio output stream. After calling this method all activities |
189 // of the audio output stream are stopped. | 189 // of the audio output stream are stopped. |
190 void Close(); | 190 void Close(); |
191 | 191 |
192 // Sets the volume of the audio output stream. There's no IPC messages | 192 // Sets the volume of the audio output stream. There's no IPC messages |
193 // sent back to the renderer upon success and failure. | 193 // sent back to the renderer upon success and failure. |
194 void SetVolume(double left, double right); | 194 void SetVolume(double volume); |
195 | 195 |
196 // Gets the volume of the audio output stream. | 196 // Gets the volume of the audio output stream. |
197 // ViewMsg_NotifyAudioStreamVolume is sent back to renderer with volume | 197 // ViewMsg_NotifyAudioStreamVolume is sent back to renderer with volume |
198 // information if succeeded. | 198 // information if succeeded. |
199 void GetVolume(); | 199 void GetVolume(); |
200 | 200 |
201 // Notify this source that buffer has been filled and is ready to be | 201 // Notify this source that buffer has been filled and is ready to be |
202 // consumed. | 202 // consumed. |
203 void NotifyPacketReady(size_t packet_size); | 203 void NotifyPacketReady(size_t packet_size); |
204 | 204 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 // Closes the audio output stream, delegates the close method call to the | 292 // Closes the audio output stream, delegates the close method call to the |
293 // corresponding IPCAudioSource::Close(), no returning IPC message to renderer | 293 // corresponding IPCAudioSource::Close(), no returning IPC message to renderer |
294 // upon success and failure. | 294 // upon success and failure. |
295 void OnCloseStream(const IPC::Message& msg, int stream_id); | 295 void OnCloseStream(const IPC::Message& msg, int stream_id); |
296 | 296 |
297 // Set the volume for the stream specified. Delegates the SetVolume() method | 297 // Set the volume for the stream specified. Delegates the SetVolume() method |
298 // call to IPCAudioSource. No returning IPC message to renderer upon success. | 298 // call to IPCAudioSource. No returning IPC message to renderer upon success. |
299 // ViewMsg_NotifyAudioStreamStateChanged with | 299 // ViewMsg_NotifyAudioStreamStateChanged with |
300 // AudioOutputStream::AUDIO_STREAM_ERROR is sent back to renderer if the | 300 // AudioOutputStream::AUDIO_STREAM_ERROR is sent back to renderer if the |
301 // required IPCAudioSource is not found. | 301 // required IPCAudioSource is not found. |
302 void OnSetVolume(const IPC::Message& msg, int stream_id, | 302 void OnSetVolume(const IPC::Message& msg, int stream_id, double volume); |
303 double left_channel, double right_channel); | |
304 | 303 |
305 // Gets the volume of the stream specified, delegates to corresponding | 304 // Gets the volume of the stream specified, delegates to corresponding |
306 // IPCAudioSource::GetVolume(), see the method for more details. | 305 // IPCAudioSource::GetVolume(), see the method for more details. |
307 // ViewMsg_NotifyAudioStreamStateChanged with | 306 // ViewMsg_NotifyAudioStreamStateChanged with |
308 // AudioOutputStream::AUDIO_STREAM_ERROR is sent back to renderer if the | 307 // AudioOutputStream::AUDIO_STREAM_ERROR is sent back to renderer if the |
309 // required IPCAudioSource is not found. | 308 // required IPCAudioSource is not found. |
310 void OnGetVolume(const IPC::Message& msg, int stream_id); | 309 void OnGetVolume(const IPC::Message& msg, int stream_id); |
311 | 310 |
312 // Notify packet has been prepared for stream, delegates to corresponding | 311 // Notify packet has been prepared for stream, delegates to corresponding |
313 // IPCAudioSource::NotifyPacketReady(), see the method for more details. | 312 // IPCAudioSource::NotifyPacketReady(), see the method for more details. |
(...skipping 30 matching lines...) Expand all Loading... |
344 | 343 |
345 // A map of id to audio sources. | 344 // A map of id to audio sources. |
346 typedef std::pair<int32, int32> SourceID; | 345 typedef std::pair<int32, int32> SourceID; |
347 typedef std::map<SourceID, IPCAudioSource*> SourceMap; | 346 typedef std::map<SourceID, IPCAudioSource*> SourceMap; |
348 SourceMap sources_; | 347 SourceMap sources_; |
349 | 348 |
350 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); | 349 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); |
351 }; | 350 }; |
352 | 351 |
353 #endif // CHROME_BROWSER_RENDERER_HOST_AUDIO_RENDERER_HOST_H_ | 352 #endif // CHROME_BROWSER_RENDERER_HOST_AUDIO_RENDERER_HOST_H_ |
OLD | NEW |