OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/message_loop.h" | 7 #include "base/message_loop.h" |
8 | 8 |
9 namespace media { | 9 namespace media { |
10 | 10 |
11 // Signal a pause in low-latency mode. | 11 // Signal a pause in low-latency mode. |
12 static const int kPauseMark = -1; | 12 const int AudioOutputController::kPauseMark = -1; |
13 | 13 |
14 AudioOutputController::AudioOutputController(EventHandler* handler, | 14 AudioOutputController::AudioOutputController(EventHandler* handler, |
15 uint32 capacity, | 15 uint32 capacity, |
16 SyncReader* sync_reader) | 16 SyncReader* sync_reader) |
17 : handler_(handler), | 17 : handler_(handler), |
18 stream_(NULL), | 18 stream_(NULL), |
19 volume_(1.0), | 19 volume_(1.0), |
20 state_(kEmpty), | 20 state_(kEmpty), |
21 buffer_(0, capacity), | 21 buffer_(0, capacity), |
22 pending_request_(false), | 22 pending_request_(false), |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 buffers_state.pending_bytes += buffer_.forward_bytes(); | 313 buffers_state.pending_bytes += buffer_.forward_bytes(); |
314 | 314 |
315 // If we need more data then call the event handler to ask for more data. | 315 // If we need more data then call the event handler to ask for more data. |
316 // It is okay that we don't lock in this block because the parameters are | 316 // It is okay that we don't lock in this block because the parameters are |
317 // correct and in the worst case we are just asking more data than needed. | 317 // correct and in the worst case we are just asking more data than needed. |
318 base::AutoUnlock auto_unlock(lock_); | 318 base::AutoUnlock auto_unlock(lock_); |
319 handler_->OnMoreData(this, buffers_state); | 319 handler_->OnMoreData(this, buffers_state); |
320 } | 320 } |
321 | 321 |
322 } // namespace media | 322 } // namespace media |
OLD | NEW |