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/atomic_ref_count.h" | 8 #include "base/atomic_ref_count.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // Changing the output device causes the controller to go through | 142 // Changing the output device causes the controller to go through |
143 // the same state transition back to the current state as a call to | 143 // the same state transition back to the current state as a call to |
144 // OnDeviceChange (unless it is currently diverting, see | 144 // OnDeviceChange (unless it is currently diverting, see |
145 // Start/StopDiverting below, in which case the state transition | 145 // Start/StopDiverting below, in which case the state transition |
146 // will happen when StopDiverting is called). | 146 // will happen when StopDiverting is called). |
147 void SwitchOutputDevice(const std::string& output_device_id, | 147 void SwitchOutputDevice(const std::string& output_device_id, |
148 const base::Closure& callback); | 148 const base::Closure& callback); |
149 | 149 |
150 // AudioSourceCallback implementation. | 150 // AudioSourceCallback implementation. |
151 virtual int OnMoreData(AudioBus* dest, | 151 virtual int OnMoreData(AudioBus* dest, |
152 int total_bytes_delay) OVERRIDE; | 152 AudioBuffersState buffers_state) OVERRIDE; |
153 virtual void OnError(AudioOutputStream* stream) OVERRIDE; | 153 virtual void OnError(AudioOutputStream* stream) OVERRIDE; |
154 | 154 |
155 // AudioDeviceListener implementation. When called AudioOutputController will | 155 // AudioDeviceListener implementation. When called AudioOutputController will |
156 // shutdown the existing |stream_|, transition to the kRecreating state, | 156 // shutdown the existing |stream_|, transition to the kRecreating state, |
157 // create a new stream, and then transition back to an equivalent state prior | 157 // create a new stream, and then transition back to an equivalent state prior |
158 // to being called. | 158 // to being called. |
159 virtual void OnDeviceChange() OVERRIDE; | 159 virtual void OnDeviceChange() OVERRIDE; |
160 | 160 |
161 // AudioSourceDiverter implementation. | 161 // AudioSourceDiverter implementation. |
162 virtual const AudioParameters& GetAudioParameters() OVERRIDE; | 162 virtual const AudioParameters& GetAudioParameters() OVERRIDE; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // Flags when we've asked for a stream to start but it never did. | 243 // Flags when we've asked for a stream to start but it never did. |
244 base::AtomicRefCount on_more_io_data_called_; | 244 base::AtomicRefCount on_more_io_data_called_; |
245 scoped_ptr<base::OneShotTimer<AudioOutputController> > wedge_timer_; | 245 scoped_ptr<base::OneShotTimer<AudioOutputController> > wedge_timer_; |
246 | 246 |
247 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); | 247 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
248 }; | 248 }; |
249 | 249 |
250 } // namespace media | 250 } // namespace media |
251 | 251 |
252 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 252 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
OLD | NEW |