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

Unified Diff: media/base/silent_sink_suspender.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/base/silent_sink_suspender.h ('k') | media/base/silent_sink_suspender_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/silent_sink_suspender.cc
diff --git a/media/base/silent_sink_suspender.cc b/media/base/silent_sink_suspender.cc
index 70b9266ee8abcbef21e860f73dd1554eb45333df..2f01ed9fcd990cedd797d3a04224e5285bfff27b 100644
--- a/media/base/silent_sink_suspender.cc
+++ b/media/base/silent_sink_suspender.cc
@@ -35,9 +35,10 @@ SilentSinkSuspender::~SilentSinkSuspender() {
fake_sink_.Stop();
}
-int SilentSinkSuspender::Render(AudioBus* dest,
- uint32_t frames_delayed,
- uint32_t frames_skipped) {
+int SilentSinkSuspender::Render(base::TimeDelta delay,
+ base::TimeTicks delay_timestamp,
+ int prior_frames_skipped,
+ AudioBus* dest) {
// Lock required since AudioRendererSink::Pause() is not synchronous, we need
// to discard these calls during the transition to the fake sink.
base::AutoLock al(transition_lock_);
@@ -52,8 +53,8 @@ int SilentSinkSuspender::Render(AudioBus* dest,
// the audio data for a future transition out of silence.
if (!dest) {
DCHECK(is_using_fake_sink_);
- DCHECK_EQ(frames_delayed, 0u);
- DCHECK_EQ(frames_skipped, 0u);
+ DCHECK_EQ(delay, base::TimeDelta());
+ DCHECK_EQ(prior_frames_skipped, 0);
// If we have no buffers or a transition is pending, one or more extra
// Render() calls have occurred in before TransitionSinks() can run, so we
@@ -72,7 +73,7 @@ int SilentSinkSuspender::Render(AudioBus* dest,
}
// Pass-through to client and request rendering.
- callback_->Render(dest, frames_delayed, frames_skipped);
+ callback_->Render(delay, delay_timestamp, prior_frames_skipped, dest);
// Check for silence or real audio data and transition if necessary.
if (!dest->AreFramesZero()) {
@@ -123,7 +124,8 @@ void SilentSinkSuspender::TransitionSinks(bool use_fake_sink) {
}
fake_sink_.Start(
base::Bind(base::IgnoreResult(&SilentSinkSuspender::Render),
- base::Unretained(this), nullptr, 0, 0));
+ base::Unretained(this), base::TimeDelta(),
+ base::TimeTicks::Now(), 0, nullptr));
} else {
fake_sink_.Stop();
« no previous file with comments | « media/base/silent_sink_suspender.h ('k') | media/base/silent_sink_suspender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698