| 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 // Audio rendering unit utilizing audio output stream provided by browser | 5 // Audio rendering unit utilizing audio output stream provided by browser |
| 6 // process through IPC. | 6 // process through IPC. |
| 7 // | 7 // |
| 8 // Relationship of classes. | 8 // Relationship of classes. |
| 9 // | 9 // |
| 10 // AudioOutputController AudioOutputDevice | 10 // AudioOutputController AudioOutputDevice |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // If |device_id_| is empty and |session_id_| is not, |matched_device_id_| is | 192 // If |device_id_| is empty and |session_id_| is not, |matched_device_id_| is |
| 193 // received in OnDeviceAuthorized(). | 193 // received in OnDeviceAuthorized(). |
| 194 std::string matched_device_id_; | 194 std::string matched_device_id_; |
| 195 | 195 |
| 196 // Our audio thread callback class. See source file for details. | 196 // Our audio thread callback class. See source file for details. |
| 197 class AudioThreadCallback; | 197 class AudioThreadCallback; |
| 198 | 198 |
| 199 // In order to avoid a race between OnStreamCreated and Stop(), we use this | 199 // In order to avoid a race between OnStreamCreated and Stop(), we use this |
| 200 // guard to control stopping and starting the audio thread. | 200 // guard to control stopping and starting the audio thread. |
| 201 base::Lock audio_thread_lock_; | 201 base::Lock audio_thread_lock_; |
| 202 AudioDeviceThread audio_thread_; | |
| 203 std::unique_ptr<AudioOutputDevice::AudioThreadCallback> audio_callback_; | 202 std::unique_ptr<AudioOutputDevice::AudioThreadCallback> audio_callback_; |
| 203 std::unique_ptr<AudioDeviceThread> audio_thread_; |
| 204 | 204 |
| 205 // Temporary hack to ignore OnStreamCreated() due to the user calling Stop() | 205 // Temporary hack to ignore OnStreamCreated() due to the user calling Stop() |
| 206 // so we don't start the audio thread pointing to a potentially freed | 206 // so we don't start the audio thread pointing to a potentially freed |
| 207 // |callback_|. | 207 // |callback_|. |
| 208 // | 208 // |
| 209 // TODO(scherkus): Replace this by changing AudioRendererSink to either accept | 209 // TODO(scherkus): Replace this by changing AudioRendererSink to either accept |
| 210 // the callback via Start(). See http://crbug.com/151051 for details. | 210 // the callback via Start(). See http://crbug.com/151051 for details. |
| 211 bool stopping_hack_; | 211 bool stopping_hack_; |
| 212 | 212 |
| 213 base::WaitableEvent did_receive_auth_; | 213 base::WaitableEvent did_receive_auth_; |
| 214 AudioParameters output_params_; | 214 AudioParameters output_params_; |
| 215 OutputDeviceStatus device_status_; | 215 OutputDeviceStatus device_status_; |
| 216 | 216 |
| 217 const base::TimeDelta auth_timeout_; | 217 const base::TimeDelta auth_timeout_; |
| 218 std::unique_ptr<base::OneShotTimer> auth_timeout_action_; | 218 std::unique_ptr<base::OneShotTimer> auth_timeout_action_; |
| 219 | 219 |
| 220 DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice); | 220 DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice); |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 } // namespace media | 223 } // namespace media |
| 224 | 224 |
| 225 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_ | 225 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_ |
| OLD | NEW |