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

Unified Diff: media/mojo/services/mojo_renderer_service.cc

Issue 2240213003: Update media mojom files to use TimeDelta instead of int64 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@OnDurationChanged_CL
Patch Set: Created 4 years, 4 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/mojo/services/mojo_renderer_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_renderer_service.cc
diff --git a/media/mojo/services/mojo_renderer_service.cc b/media/mojo/services/mojo_renderer_service.cc
index 7282f8e2c964ebd9faa32b33a661f354c1dd7891..f2079ea8bb429f6e47437f2cc4e34912a5e82832 100644
--- a/media/mojo/services/mojo_renderer_service.cc
+++ b/media/mojo/services/mojo_renderer_service.cc
@@ -25,7 +25,6 @@ MojoRendererService::MojoRendererService(
: binding_(this, std::move(request)),
mojo_cdm_service_context_(mojo_cdm_service_context),
state_(STATE_UNINITIALIZED),
- last_media_time_usec_(0),
renderer_(std::move(renderer)),
weak_factory_(this) {
DVLOG(1) << __FUNCTION__;
@@ -73,10 +72,9 @@ void MojoRendererService::Flush(const FlushCallback& callback) {
base::Bind(&MojoRendererService::OnFlushCompleted, weak_this_, callback));
}
-void MojoRendererService::StartPlayingFrom(int64_t time_delta_usec) {
- DVLOG(2) << __FUNCTION__ << ": " << time_delta_usec;
- renderer_->StartPlayingFrom(
- base::TimeDelta::FromMicroseconds(time_delta_usec));
+void MojoRendererService::StartPlayingFrom(base::TimeDelta time_delta) {
+ DVLOG(2) << __FUNCTION__ << ": " << time_delta;
+ renderer_->StartPlayingFrom(time_delta);
SchedulePeriodicMediaTimeUpdates();
}
@@ -149,7 +147,7 @@ void MojoRendererService::OnVideoNaturalSizeChange(const gfx::Size& size) {
}
void MojoRendererService::OnDurationChange(base::TimeDelta duration) {
- client_->OnDurationChange(duration.InMicroseconds());
+ client_->OnDurationChange(duration);
}
void MojoRendererService::OnVideoOpacityChange(bool opaque) {
@@ -184,12 +182,12 @@ void MojoRendererService::OnRendererInitializeDone(
}
void MojoRendererService::UpdateMediaTime(bool force) {
- const int64_t media_time = renderer_->GetMediaTime().InMicroseconds();
- if (!force && media_time == last_media_time_usec_)
+ base::TimeDelta media_time = renderer_->GetMediaTime();
+ if (!force && media_time == last_media_time_)
return;
client_->OnTimeUpdate(media_time, media_time);
- last_media_time_usec_ = media_time;
+ last_media_time_ = media_time;
}
void MojoRendererService::CancelPeriodicMediaTimeUpdates() {
« no previous file with comments | « media/mojo/services/mojo_renderer_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698