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 <stdint.h> | 8 #include <stdint.h> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
| 11 #include <string> |
| 12 #include <utility> |
11 | 13 |
12 #include "base/atomic_ref_count.h" | 14 #include "base/atomic_ref_count.h" |
13 #include "base/callback.h" | 15 #include "base/callback.h" |
14 #include "base/macros.h" | 16 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
16 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
17 #include "base/timer/timer.h" | 19 #include "base/timer/timer.h" |
18 #include "build/build_config.h" | 20 #include "build/build_config.h" |
19 #include "media/audio/audio_io.h" | 21 #include "media/audio/audio_io.h" |
20 #include "media/audio/audio_manager.h" | 22 #include "media/audio/audio_manager.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // | 158 // |
157 // Changing the output device causes the controller to go through | 159 // Changing the output device causes the controller to go through |
158 // the same state transition back to the current state as a call to | 160 // the same state transition back to the current state as a call to |
159 // OnDeviceChange (unless it is currently diverting, see | 161 // OnDeviceChange (unless it is currently diverting, see |
160 // Start/StopDiverting below, in which case the state transition | 162 // Start/StopDiverting below, in which case the state transition |
161 // will happen when StopDiverting is called). | 163 // will happen when StopDiverting is called). |
162 void SwitchOutputDevice(const std::string& output_device_id, | 164 void SwitchOutputDevice(const std::string& output_device_id, |
163 const base::Closure& callback); | 165 const base::Closure& callback); |
164 | 166 |
165 // AudioSourceCallback implementation. | 167 // AudioSourceCallback implementation. |
166 int OnMoreData(AudioBus* dest, | 168 int OnMoreData(base::TimeTicks target_playout_time, |
167 uint32_t total_bytes_delay, | 169 int prior_frames_skipped, |
168 uint32_t frames_skipped) override; | 170 AudioBus* dest) override; |
169 void OnError(AudioOutputStream* stream) override; | 171 void OnError(AudioOutputStream* stream) override; |
170 | 172 |
171 // AudioDeviceListener implementation. When called AudioOutputController will | 173 // AudioDeviceListener implementation. When called AudioOutputController will |
172 // shutdown the existing |stream_|, transition to the kRecreating state, | 174 // shutdown the existing |stream_|, transition to the kRecreating state, |
173 // create a new stream, and then transition back to an equivalent state prior | 175 // create a new stream, and then transition back to an equivalent state prior |
174 // to being called. | 176 // to being called. |
175 void OnDeviceChange() override; | 177 void OnDeviceChange() override; |
176 | 178 |
177 // AudioSourceDiverter implementation. | 179 // AudioSourceDiverter implementation. |
178 const AudioParameters& GetAudioParameters() override; | 180 const AudioParameters& GetAudioParameters() override; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 // be accessed while |error_lock_| is held. | 283 // be accessed while |error_lock_| is held. |
282 bool ignore_errors_during_stop_close_; | 284 bool ignore_errors_during_stop_close_; |
283 base::Lock error_lock_; | 285 base::Lock error_lock_; |
284 | 286 |
285 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); | 287 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
286 }; | 288 }; |
287 | 289 |
288 } // namespace media | 290 } // namespace media |
289 | 291 |
290 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 292 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
OLD | NEW |