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

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: Implementation of 'AudioContext.getOutputTimestamp' method 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/audio_output_device.cc
diff --git a/media/audio/audio_output_device.cc b/media/audio/audio_output_device.cc
index a3effebfb43af118500197a6eed9a48093563f7d..5d1389accc7dd38243d9c7dcc2c3d22b0a6aa09a 100644
--- a/media/audio/audio_output_device.cc
+++ b/media/audio/audio_output_device.cc
@@ -37,7 +37,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;
private:
AudioRendererSink::RenderCallback* render_callback_;
@@ -417,7 +417,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_;
@@ -447,7 +449,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);
}
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698