OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/lock.h" | |
9 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
10 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "base/synchronization/lock.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 #include "media/audio/audio_buffers_state.h" | 12 #include "media/audio/audio_buffers_state.h" |
13 #include "media/audio/audio_io.h" | 13 #include "media/audio/audio_io.h" |
14 #include "media/audio/audio_manager.h" | 14 #include "media/audio/audio_manager.h" |
15 #include "media/audio/simple_sources.h" | 15 #include "media/audio/simple_sources.h" |
16 | 16 |
17 class MessageLoop; | 17 class MessageLoop; |
18 class Task; | 18 class Task; |
19 | 19 |
20 // An AudioOutputController controls an AudioOutputStream and provides data | 20 // An AudioOutputController controls an AudioOutputStream and provides data |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 double volume_; | 180 double volume_; |
181 | 181 |
182 // |state_| is written on the audio controller thread and is read on the | 182 // |state_| is written on the audio controller thread and is read on the |
183 // hardware audio thread. These operations need to be locked. But lock | 183 // hardware audio thread. These operations need to be locked. But lock |
184 // is not required for reading on the audio controller thread. | 184 // is not required for reading on the audio controller thread. |
185 State state_; | 185 State state_; |
186 | 186 |
187 AudioBuffersState buffers_state_; | 187 AudioBuffersState buffers_state_; |
188 | 188 |
189 // The |lock_| must be acquired whenever we access |buffer_|. | 189 // The |lock_| must be acquired whenever we access |buffer_|. |
190 Lock lock_; | 190 base::Lock lock_; |
191 | 191 |
192 media::SeekableBuffer buffer_; | 192 media::SeekableBuffer buffer_; |
193 | 193 |
194 bool pending_request_; | 194 bool pending_request_; |
195 | 195 |
196 // SyncReader is used only in low latency mode for synchronous reading. | 196 // SyncReader is used only in low latency mode for synchronous reading. |
197 SyncReader* sync_reader_; | 197 SyncReader* sync_reader_; |
198 | 198 |
199 // The message loop of audio thread that this object runs on. | 199 // The message loop of audio thread that this object runs on. |
200 MessageLoop* message_loop_; | 200 MessageLoop* message_loop_; |
201 | 201 |
202 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); | 202 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
203 }; | 203 }; |
204 | 204 |
205 } // namespace media | 205 } // namespace media |
206 | 206 |
207 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 207 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
OLD | NEW |