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

Unified Diff: media/renderers/video_renderer_impl.h

Issue 1027553002: Change the TimeSource interface to return wallclock time for video. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove underflow changes. Created 5 years, 9 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/renderers/renderer_impl.cc ('k') | media/renderers/video_renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/video_renderer_impl.h
diff --git a/media/renderers/video_renderer_impl.h b/media/renderers/video_renderer_impl.h
index eec8b1543cce448ae481d322f38b8b7bfcbaebd5..6f6c027406329927ebcaee029710c59862409668 100644
--- a/media/renderers/video_renderer_impl.h
+++ b/media/renderers/video_renderer_impl.h
@@ -25,6 +25,7 @@
namespace base {
class SingleThreadTaskRunner;
+class TickClock;
}
namespace media {
@@ -60,7 +61,7 @@ class MEDIA_EXPORT VideoRendererImpl
const PaintCB& paint_cb,
const base::Closure& ended_cb,
const PipelineStatusCB& error_cb,
- const TimeDeltaCB& get_time_cb,
+ const WallClockTimeCB& wall_clock_time_cb,
const base::Closure& waiting_for_decryption_key_cb) override;
void Flush(const base::Closure& callback) override;
void StartPlayingFrom(base::TimeDelta timestamp) override;
@@ -68,6 +69,8 @@ class MEDIA_EXPORT VideoRendererImpl
// PlatformThread::Delegate implementation.
void ThreadMain() override;
+ void SetTickClockForTesting(scoped_ptr<base::TickClock> tick_clock);
+
private:
// Creates a dedicated |thread_| for video rendering.
void CreateVideoThread();
@@ -182,21 +185,21 @@ class MEDIA_EXPORT VideoRendererImpl
BufferingStateCB buffering_state_cb_;
base::Closure ended_cb_;
PipelineStatusCB error_cb_;
- TimeDeltaCB get_time_cb_;
+ WallClockTimeCB wall_clock_time_cb_;
base::TimeDelta start_timestamp_;
// Embedder callback for notifying a new frame is available for painting.
PaintCB paint_cb_;
- // The timestamp of the last frame removed from the |ready_frames_| queue,
- // either for calling |paint_cb_| or for dropping. Set to kNoTimestamp()
- // during flushing.
- base::TimeDelta last_timestamp_;
+ // The wallclock times of the last frame removed from the |ready_frames_|
+ // queue, either for calling |paint_cb_| or for dropping. Set to null during
+ // flushing.
+ base::TimeTicks last_media_time_;
- // The timestamp of the last successfully painted frame. Set to kNoTimestamp()
+ // The wallclock time of the last successfully painted frame. Set to null
// during flushing.
- base::TimeDelta last_painted_timestamp_;
+ base::TimeTicks last_painted_time_;
// Keeps track of the number of frames decoded and dropped since the
// last call to |statistics_cb_|. These must be accessed under lock.
@@ -205,6 +208,8 @@ class MEDIA_EXPORT VideoRendererImpl
bool is_shutting_down_;
+ scoped_ptr<base::TickClock> tick_clock_;
+
// NOTE: Weak pointers must be invalidated before all other member variables.
base::WeakPtrFactory<VideoRendererImpl> weak_factory_;
« no previous file with comments | « media/renderers/renderer_impl.cc ('k') | media/renderers/video_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698