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 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
6 #define MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
7 | 7 |
8 #include "base/atomic_ref_count.h" | 8 #include "base/atomic_ref_count.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // OnMoreIOData() method, and only when it is valid to do so. This is for | 254 // OnMoreIOData() method, and only when it is valid to do so. This is for |
255 // sanity-checking the behavior of platform implementations of | 255 // sanity-checking the behavior of platform implementations of |
256 // AudioOutputStream. In other words, multiple contention is not expected, | 256 // AudioOutputStream. In other words, multiple contention is not expected, |
257 // nor in the design here. | 257 // nor in the design here. |
258 base::AtomicRefCount num_allowed_io_; | 258 base::AtomicRefCount num_allowed_io_; |
259 | 259 |
260 // SyncReader is used only in low latency mode for synchronous reading. | 260 // SyncReader is used only in low latency mode for synchronous reading. |
261 SyncReader* const sync_reader_; | 261 SyncReader* const sync_reader_; |
262 | 262 |
263 // The message loop of audio manager thread that this object runs on. | 263 // The message loop of audio manager thread that this object runs on. |
264 const scoped_refptr<base::MessageLoopProxy> message_loop_; | 264 const scoped_refptr<base::SingleThreadTaskRunner> message_loop_; |
265 | 265 |
266 #if defined(AUDIO_POWER_MONITORING) | 266 #if defined(AUDIO_POWER_MONITORING) |
267 // Scans audio samples from OnMoreIOData() as input to compute power levels. | 267 // Scans audio samples from OnMoreIOData() as input to compute power levels. |
268 AudioPowerMonitor power_monitor_; | 268 AudioPowerMonitor power_monitor_; |
269 | 269 |
270 // Periodic callback to report power levels during playback. | 270 // Periodic callback to report power levels during playback. |
271 base::CancelableClosure power_poll_callback_; | 271 base::CancelableClosure power_poll_callback_; |
272 #endif | 272 #endif |
273 | 273 |
274 // Flags when we've asked for a stream to start but it never did. | 274 // Flags when we've asked for a stream to start but it never did. |
275 base::AtomicRefCount on_more_io_data_called_; | 275 base::AtomicRefCount on_more_io_data_called_; |
276 scoped_ptr<base::OneShotTimer<AudioOutputController> > wedge_timer_; | 276 scoped_ptr<base::OneShotTimer<AudioOutputController> > wedge_timer_; |
277 | 277 |
278 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); | 278 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
279 }; | 279 }; |
280 | 280 |
281 } // namespace media | 281 } // namespace media |
282 | 282 |
283 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 283 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
OLD | NEW |