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/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // | 140 // |
141 // It is safe to call this method more than once. Calls after the first one | 141 // It is safe to call this method more than once. Calls after the first one |
142 // will have no effect. | 142 // will have no effect. |
143 void Close(const base::Closure& closed_task); | 143 void Close(const base::Closure& closed_task); |
144 | 144 |
145 // Sets the volume of the audio output stream. | 145 // Sets the volume of the audio output stream. |
146 void SetVolume(double volume); | 146 void SetVolume(double volume); |
147 | 147 |
148 /////////////////////////////////////////////////////////////////////////// | 148 /////////////////////////////////////////////////////////////////////////// |
149 // AudioSourceCallback methods. | 149 // AudioSourceCallback methods. |
150 virtual uint32 OnMoreData(AudioOutputStream* stream, | 150 virtual uint32 OnMoreData(uint8* dest, |
151 uint8* dest, | |
152 uint32 max_size, | 151 uint32 max_size, |
153 AudioBuffersState buffers_state) OVERRIDE; | 152 AudioBuffersState buffers_state) OVERRIDE; |
154 virtual void OnError(AudioOutputStream* stream, int code) OVERRIDE; | 153 virtual void OnError(AudioOutputStream* stream, int code) OVERRIDE; |
155 virtual void WaitTillDataReady() OVERRIDE; | 154 virtual void WaitTillDataReady() OVERRIDE; |
156 | 155 |
157 protected: | 156 protected: |
158 // Internal state of the source. | 157 // Internal state of the source. |
159 enum State { | 158 enum State { |
160 kEmpty, | 159 kEmpty, |
161 kCreated, | 160 kCreated, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 // shutdown and force it to wait for the most delayed task. | 225 // shutdown and force it to wait for the most delayed task. |
227 // Also, if we're shutting down, we do not want to poll for more data. | 226 // Also, if we're shutting down, we do not want to poll for more data. |
228 base::WeakPtrFactory<AudioOutputController> weak_this_; | 227 base::WeakPtrFactory<AudioOutputController> weak_this_; |
229 | 228 |
230 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); | 229 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
231 }; | 230 }; |
232 | 231 |
233 } // namespace media | 232 } // namespace media |
234 | 233 |
235 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 234 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
OLD | NEW |