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

Unified Diff: media/renderers/audio_renderer_impl.cc

Issue 2437863004: Make more media APIs aware of |delay| and |delay_timestamp| (Closed)
Patch Set: Removed unneeded logging also from audio_device_thread.cc 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: media/renderers/audio_renderer_impl.cc
diff --git a/media/renderers/audio_renderer_impl.cc b/media/renderers/audio_renderer_impl.cc
index 66fe2b79609856ac85bd7896754f36f3920aa48c..bd8414d12ad8deb00cc690c687d5959fe13bf574 100644
--- a/media/renderers/audio_renderer_impl.cc
+++ b/media/renderers/audio_renderer_impl.cc
@@ -769,12 +769,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;
@@ -782,6 +783,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);

Powered by Google App Engine
This is Rietveld 408576698