| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 // Set the volume of the audio stream referenced by |stream_id|. | 168 // Set the volume of the audio stream referenced by |stream_id|. |
| 169 void OnSetVolume(int stream_id, double volume); | 169 void OnSetVolume(int stream_id, double volume); |
| 170 | 170 |
| 171 // Helper methods. | 171 // Helper methods. |
| 172 | 172 |
| 173 // Proceed with device authorization after checking permissions. | 173 // Proceed with device authorization after checking permissions. |
| 174 void OnDeviceAuthorized(int stream_id, | 174 void OnDeviceAuthorized(int stream_id, |
| 175 const std::string& device_id, | 175 const std::string& device_id, |
| 176 const url::Origin& security_origin, | 176 const url::Origin& security_origin, |
| 177 base::TimeTicks auth_start_time, |
| 177 bool have_access); | 178 bool have_access); |
| 178 | 179 |
| 179 // Proceed with device authorization after translating device ID. | 180 // Proceed with device authorization after translating device ID. |
| 180 void OnDeviceIDTranslated(int stream_id, | 181 void OnDeviceIDTranslated(int stream_id, |
| 182 base::TimeTicks auth_start_time, |
| 181 bool device_found, | 183 bool device_found, |
| 182 const AudioOutputDeviceInfo& device_info); | 184 const AudioOutputDeviceInfo& device_info); |
| 183 | 185 |
| 184 // Start the actual creation of an audio stream, after the device | 186 // Start the actual creation of an audio stream, after the device |
| 185 // authorization process is complete. | 187 // authorization process is complete. |
| 186 void DoCreateStream(int stream_id, | 188 void DoCreateStream(int stream_id, |
| 187 int render_frame_id, | 189 int render_frame_id, |
| 188 const media::AudioParameters& params, | 190 const media::AudioParameters& params, |
| 189 const std::string& device_unique_id); | 191 const std::string& device_unique_id); |
| 190 | 192 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 // The maximum number of simultaneous streams during the lifetime of this | 268 // The maximum number of simultaneous streams during the lifetime of this |
| 267 // host. Reported as UMA stat at shutdown. | 269 // host. Reported as UMA stat at shutdown. |
| 268 size_t max_simultaneous_streams_; | 270 size_t max_simultaneous_streams_; |
| 269 | 271 |
| 270 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); | 272 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); |
| 271 }; | 273 }; |
| 272 | 274 |
| 273 } // namespace content | 275 } // namespace content |
| 274 | 276 |
| 275 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ | 277 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ |
| OLD | NEW |