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

Unified Diff: media/base/wall_clock_time_source.cc

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: Fix comment. 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
Index: media/base/wall_clock_time_source.cc
diff --git a/media/base/wall_clock_time_source.cc b/media/base/wall_clock_time_source.cc
index 408de93e05e830867278d3e667bc3ff4ad59abb2..44491da410f7d1c8d91a1c04e6faa4f65fae4795 100644
--- a/media/base/wall_clock_time_source.cc
+++ b/media/base/wall_clock_time_source.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/time/default_tick_clock.h"
+#include "media/base/buffers.h"
xhwang 2015/03/23 22:20:14 not needed? BTW, media/base/buffers.h should be r
DaleCurtis 2015/03/25 00:31:45 Done.
namespace media {
@@ -60,8 +61,15 @@ base::TimeDelta WallClockTimeSource::CurrentMediaTime() {
return CurrentMediaTime_Locked();
}
-base::TimeDelta WallClockTimeSource::CurrentMediaTimeForSyncingVideo() {
- return CurrentMediaTime();
+base::TimeTicks WallClockTimeSource::GetWallclockTimeForMediaTime(
+ base::TimeDelta time) {
+ base::AutoLock auto_lock(lock_);
+ if (!ticking_ || playback_rate_ == 0.0 || time < base_time_)
xhwang 2015/03/23 22:20:14 Can we do DCHECK(time >= base_time_)?
DaleCurtis 2015/03/25 00:31:45 Actually this condition was incorrect, it needs to
xhwang 2015/03/25 04:10:50 Acknowledged.
+ return base::TimeTicks();
+
+ return reference_wall_ticks_ +
+ base::TimeDelta::FromMicroseconds(
+ (time - base_time_).InMicroseconds() * playback_rate_);
}
void WallClockTimeSource::SetTickClockForTesting(

Powered by Google App Engine
This is Rietveld 408576698