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

Unified Diff: content/renderer/media/renderer_webaudiodevice_impl.cc

Issue 2060833002: Implementation of 'AudioContext.getOutputTimestamp' method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 'global-interface-listing-expected' layout test results Created 4 years, 1 month 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: content/renderer/media/renderer_webaudiodevice_impl.cc
diff --git a/content/renderer/media/renderer_webaudiodevice_impl.cc b/content/renderer/media/renderer_webaudiodevice_impl.cc
index 4924cc68fc2afddce8aa90a0347f34edf74d9e89..46806cfd253286fb72781602fad523bd57a38ff2 100644
--- a/content/renderer/media/renderer_webaudiodevice_impl.cc
+++ b/content/renderer/media/renderer_webaudiodevice_impl.cc
@@ -110,11 +110,18 @@ int RendererWebAudioDeviceImpl::Render(base::TimeDelta delay,
for (int i = 0; i < dest->channels(); ++i)
web_audio_dest_data[i] = dest->channel(i);
+ // Substruct the bus duration to get hardware delay.
+ delay -= media::AudioTimestampHelper::FramesToTime(dest->frames(),
miu 2016/11/04 21:29:40 Is this correct? I thought |delay| already did not
Mikhail 2016/11/07 18:28:03 that comes from https://codereview.chromium.org/24
miu 2016/11/07 23:49:40 Right, but isn't the output position correct witho
Mikhail 2016/11/28 15:15:59 You are right, this will be an estimation of the n
miu 2016/11/29 20:51:04 Seems right. I went through and re-read the spec a
+ params_.sample_rate());
+
// TODO(xians): Remove the following |web_audio_source_data| after
// changing the blink interface.
WebVector<float*> web_audio_source_data(static_cast<size_t>(0));
client_callback_->render(web_audio_source_data, web_audio_dest_data,
- dest->frames());
+ dest->frames(), delay.InSecondsF(),
+ (delay_timestamp - base::TimeTicks()).InSecondsF(),
+ prior_frames_skipped);
+
return dest->frames();
}

Powered by Google App Engine
This is Rietveld 408576698