Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: media/audio/audio_output_controller.h

Issue 2101303004: Pass delay and timestamp to AudioSourceCallback::OnMoreData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Fix Mac CQ errors. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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::TimeDelta delay,
167 uint32_t total_bytes_delay, 169 base::TimeTicks delay_timestamp,
168 uint32_t frames_skipped) override; 170 int prior_frames_skipped,
171 AudioBus* dest) override;
169 void OnError(AudioOutputStream* stream) override; 172 void OnError(AudioOutputStream* stream) override;
170 173
171 // AudioDeviceListener implementation. When called AudioOutputController will 174 // AudioDeviceListener implementation. When called AudioOutputController will
172 // shutdown the existing |stream_|, transition to the kRecreating state, 175 // shutdown the existing |stream_|, transition to the kRecreating state,
173 // create a new stream, and then transition back to an equivalent state prior 176 // create a new stream, and then transition back to an equivalent state prior
174 // to being called. 177 // to being called.
175 void OnDeviceChange() override; 178 void OnDeviceChange() override;
176 179
177 // AudioSourceDiverter implementation. 180 // AudioSourceDiverter implementation.
178 const AudioParameters& GetAudioParameters() override; 181 const AudioParameters& GetAudioParameters() override;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // be accessed while |error_lock_| is held. 284 // be accessed while |error_lock_| is held.
282 bool ignore_errors_during_stop_close_; 285 bool ignore_errors_during_stop_close_;
283 base::Lock error_lock_; 286 base::Lock error_lock_;
284 287
285 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); 288 DISALLOW_COPY_AND_ASSIGN(AudioOutputController);
286 }; 289 };
287 290
288 } // namespace media 291 } // namespace media
289 292
290 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ 293 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698