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 <stdint.h> | 8 #include <stdint.h> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 // SyncReader is used only in low latency mode for synchronous reading. | 251 // SyncReader is used only in low latency mode for synchronous reading. |
252 SyncReader* const sync_reader_; | 252 SyncReader* const sync_reader_; |
253 | 253 |
254 // The message loop of audio manager thread that this object runs on. | 254 // The message loop of audio manager thread that this object runs on. |
255 const scoped_refptr<base::SingleThreadTaskRunner> message_loop_; | 255 const scoped_refptr<base::SingleThreadTaskRunner> message_loop_; |
256 | 256 |
257 // Scans audio samples from OnMoreData() as input to compute power levels. | 257 // Scans audio samples from OnMoreData() as input to compute power levels. |
258 AudioPowerMonitor power_monitor_; | 258 AudioPowerMonitor power_monitor_; |
259 | 259 |
| 260 // Updated each time a power measurement is logged. |
| 261 base::TimeTicks last_audio_level_log_time_; |
| 262 |
260 // Flags when we've asked for a stream to start but it never did. | 263 // Flags when we've asked for a stream to start but it never did. |
261 base::AtomicRefCount on_more_io_data_called_; | 264 base::AtomicRefCount on_more_io_data_called_; |
262 std::unique_ptr<base::OneShotTimer> wedge_timer_; | 265 std::unique_ptr<base::OneShotTimer> wedge_timer_; |
263 | 266 |
264 // Flag which indicates errors received during Stop/Close should be ignored. | 267 // Flag which indicates errors received during Stop/Close should be ignored. |
265 // These errors are generally harmless since a fresh stream is about to be | 268 // These errors are generally harmless since a fresh stream is about to be |
266 // recreated, but if forwarded, renderer side clients may consider them | 269 // recreated, but if forwarded, renderer side clients may consider them |
267 // catastrophic and abort their operations. | 270 // catastrophic and abort their operations. |
268 // | 271 // |
269 // If |stream_| is started then |ignore_errors_during_stop_close_| must only | 272 // If |stream_| is started then |ignore_errors_during_stop_close_| must only |
270 // be accessed while |error_lock_| is held. | 273 // be accessed while |error_lock_| is held. |
271 bool ignore_errors_during_stop_close_; | 274 bool ignore_errors_during_stop_close_; |
272 base::Lock error_lock_; | 275 base::Lock error_lock_; |
273 | 276 |
274 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); | 277 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
275 }; | 278 }; |
276 | 279 |
277 } // namespace media | 280 } // namespace media |
278 | 281 |
279 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 282 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
OLD | NEW |