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

Unified Diff: media/audio/simple_sources.cc

Issue 2101303004: Pass delay and timestamp to AudioSourceCallback::OnMoreData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: media/audio/simple_sources.cc
diff --git a/media/audio/simple_sources.cc b/media/audio/simple_sources.cc
index fde0509d979f0dc24aa45a062620d7583425738b..157e9bc0f3c30c45cd22ec410f82a12bb2c555c8 100644
--- a/media/audio/simple_sources.cc
+++ b/media/audio/simple_sources.cc
@@ -14,6 +14,7 @@
#include "base/files/file.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/time/time.h"
#include "media/audio/sounds/wav_audio_handler.h"
#include "media/base/audio_bus.h"
@@ -117,6 +118,7 @@ SineWaveAudioSource::~SineWaveAudioSource() {
// but it is efficient enough for our simple needs.
int SineWaveAudioSource::OnMoreData(AudioBus* audio_bus,
uint32_t total_bytes_delay,
+ base::TimeDelta delay_timestamp,
uint32_t frames_skipped) {
base::AutoLock auto_lock(time_lock_);
callbacks_++;
@@ -203,6 +205,7 @@ void FileSource::LoadWavFile(const base::FilePath& path_to_wav_file) {
int FileSource::OnMoreData(AudioBus* audio_bus,
uint32_t total_bytes_delay,
+ base::TimeDelta delay_timestamp,
uint32_t frames_skipped) {
// Load the file if we haven't already. This load needs to happen on the
// audio thread, otherwise we'll run on the UI thread on Mac for instance.
@@ -260,6 +263,7 @@ BeepingSource::~BeepingSource() {
int BeepingSource::OnMoreData(AudioBus* audio_bus,
uint32_t total_bytes_delay,
+ base::TimeDelta delay_timestamp,
uint32_t frames_skipped) {
// Accumulate the time from the last beep.
interval_from_last_beep_ += base::TimeTicks::Now() - last_callback_time_;

Powered by Google App Engine
This is Rietveld 408576698