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

Unified Diff: media/audio/audio_output_device.cc

Issue 2060833002: Implementation of 'AudioContext.getOutputTimestamp' method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added implementation for ALSA. Created 4 years, 5 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/audio_output_device.cc
diff --git a/media/audio/audio_output_device.cc b/media/audio/audio_output_device.cc
index e5e3513a413645ab5eee6fa6c446ae3a6eaeddf1..57fe6d494297f4b2a47d17db8532b41b3db9c8b8 100644
--- a/media/audio/audio_output_device.cc
+++ b/media/audio/audio_output_device.cc
@@ -39,7 +39,7 @@ class AudioOutputDevice::AudioThreadCallback
void MapSharedMemory() override;
// Called whenever we receive notifications about pending data.
- void Process(uint32_t pending_data) override;
+ void Process(uint32_t pending_data, const AudioTimestamp& timestamp) override;
// Returns whether the current thread is the audio device thread or not.
// Will always return true if DCHECKs are not enabled.
@@ -458,7 +458,9 @@ void AudioOutputDevice::AudioThreadCallback::MapSharedMemory() {
}
// Called whenever we receive notifications about pending data.
-void AudioOutputDevice::AudioThreadCallback::Process(uint32_t pending_data) {
+void AudioOutputDevice::AudioThreadCallback::Process(
+ uint32_t pending_data,
+ const AudioTimestamp& timestamp) {
// Convert the number of pending bytes in the render buffer into frames.
double frames_delayed = static_cast<double>(pending_data) / bytes_per_frame_;
@@ -488,7 +490,7 @@ void AudioOutputDevice::AudioThreadCallback::Process(uint32_t pending_data) {
// the shared memory the Render() call is writing directly into the shared
// memory.
render_callback_->Render(output_bus_.get(), std::round(frames_delayed),
- frames_skipped);
+ frames_skipped, timestamp);
}
bool AudioOutputDevice::AudioThreadCallback::

Powered by Google App Engine
This is Rietveld 408576698