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

Unified Diff: media/filters/video_renderer_impl.h

Issue 390733002: Revert of Remove media::VideoRenderer::SetPlaybackRate(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « media/base/video_renderer.h ('k') | media/filters/video_renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_impl.h
diff --git a/media/filters/video_renderer_impl.h b/media/filters/video_renderer_impl.h
index 0f142be3520509a1e7b3ac200ea601b5f4f6701a..bcba124b5200efa97bd22d6971f9b17779e4afe7 100644
--- a/media/filters/video_renderer_impl.h
+++ b/media/filters/video_renderer_impl.h
@@ -69,6 +69,7 @@
virtual void Flush(const base::Closure& callback) OVERRIDE;
virtual void StartPlayingFrom(base::TimeDelta timestamp) OVERRIDE;
virtual void Stop(const base::Closure& callback) OVERRIDE;
+ virtual void SetPlaybackRate(float playback_rate) OVERRIDE;
// PlatformThread::Delegate implementation.
virtual void ThreadMain() OVERRIDE;
@@ -93,6 +94,14 @@
// Called when VideoFrameStream::Reset() completes.
void OnVideoFrameStreamResetDone();
+
+ // Calculates the duration to sleep for based on |last_timestamp_|,
+ // the next frame timestamp (may be NULL), and the provided playback rate.
+ //
+ // We don't use |playback_rate_| to avoid locking.
+ base::TimeDelta CalculateSleepDuration(
+ const scoped_refptr<VideoFrame>& next_frame,
+ float playback_rate);
// Helper function that flushes the buffers when a Stop() or error occurs.
void DoStopOrError_Locked();
@@ -177,6 +186,8 @@
bool drop_frames_;
+ float playback_rate_;
+
BufferingState buffering_state_;
// Playback operation callbacks.
« no previous file with comments | « media/base/video_renderer.h ('k') | media/filters/video_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698