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

Unified Diff: media/renderers/audio_renderer_impl.cc

Issue 2517503003: Reland: Make more media APIs aware of |delay| and |delay_timestamp| (Closed)
Patch Set: Comments from chcunningham@ and Dale Created 4 years 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
« no previous file with comments | « media/renderers/audio_renderer_impl.h ('k') | media/renderers/audio_renderer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/audio_renderer_impl.cc
diff --git a/media/renderers/audio_renderer_impl.cc b/media/renderers/audio_renderer_impl.cc
index e5891c894695fb6538446992a49b4e6ea6164df1..38ee08a01fded7ca655b87616b0d0a9e2d521334 100644
--- a/media/renderers/audio_renderer_impl.cc
+++ b/media/renderers/audio_renderer_impl.cc
@@ -738,12 +738,13 @@ bool AudioRendererImpl::IsBeforeStartTime(
(buffer->timestamp() + buffer->duration()) < start_timestamp_;
}
-int AudioRendererImpl::Render(AudioBus* audio_bus,
- uint32_t frames_delayed,
- uint32_t frames_skipped) {
+int AudioRendererImpl::Render(base::TimeDelta delay,
+ base::TimeTicks delay_timestamp,
+ int prior_frames_skipped,
+ AudioBus* audio_bus) {
const int frames_requested = audio_bus->frames();
- DVLOG(4) << __func__ << " frames_delayed:" << frames_delayed
- << " frames_skipped:" << frames_skipped
+ DVLOG(4) << __func__ << " delay:" << delay
+ << " prior_frames_skipped:" << prior_frames_skipped
<< " frames_requested:" << frames_requested;
int frames_written = 0;
@@ -751,6 +752,9 @@ int AudioRendererImpl::Render(AudioBus* audio_bus,
base::AutoLock auto_lock(lock_);
last_render_time_ = tick_clock_->NowTicks();
+ int64_t frames_delayed = AudioTimestampHelper::TimeToFrames(
+ delay, audio_parameters_.sample_rate());
+
if (!stop_rendering_time_.is_null()) {
audio_clock_->CompensateForSuspendedWrites(
last_render_time_ - stop_rendering_time_, frames_delayed);
« no previous file with comments | « media/renderers/audio_renderer_impl.h ('k') | media/renderers/audio_renderer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698