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 #include "media/audio/audio_output_controller.h" | 5 #include "media/audio/audio_output_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
11 #include "base/threading/platform_thread.h" | 11 #include "base/threading/platform_thread.h" |
12 #include "base/threading/thread_restrictions.h" | 12 #include "base/threading/thread_restrictions.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "media/audio/shared_memory_util.h" |
14 | 15 |
15 using base::Time; | 16 using base::Time; |
16 using base::TimeDelta; | 17 using base::TimeDelta; |
17 using base::WaitableEvent; | 18 using base::WaitableEvent; |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 // Signal a pause in low-latency mode. | |
22 const int AudioOutputController::kPauseMark = -1; | |
23 | |
24 // Polling-related constants. | 22 // Polling-related constants. |
25 const int AudioOutputController::kPollNumAttempts = 3; | 23 const int AudioOutputController::kPollNumAttempts = 3; |
26 const int AudioOutputController::kPollPauseInMilliseconds = 3; | 24 const int AudioOutputController::kPollPauseInMilliseconds = 3; |
27 | 25 |
28 AudioOutputController::AudioOutputController(EventHandler* handler, | 26 AudioOutputController::AudioOutputController(EventHandler* handler, |
29 SyncReader* sync_reader) | 27 SyncReader* sync_reader) |
30 : handler_(handler), | 28 : handler_(handler), |
31 stream_(NULL), | 29 stream_(NULL), |
32 volume_(1.0), | 30 volume_(1.0), |
33 state_(kEmpty), | 31 state_(kEmpty), |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 stream_ = NULL; | 330 stream_ = NULL; |
333 weak_this_.InvalidateWeakPtrs(); | 331 weak_this_.InvalidateWeakPtrs(); |
334 } | 332 } |
335 | 333 |
336 // Should be last in the method, do not touch "this" from here on. | 334 // Should be last in the method, do not touch "this" from here on. |
337 if (done != NULL) | 335 if (done != NULL) |
338 done->Signal(); | 336 done->Signal(); |
339 } | 337 } |
340 | 338 |
341 } // namespace media | 339 } // namespace media |
OLD | NEW |