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

Unified Diff: examples/media_test/media_test.cc

Issue 1986303002: Motown: Use new TimelineTransform and related definitions (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fixes per feedback. Created 4 years, 7 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 | « examples/media_test/media_test.h ('k') | mojo/dart/packages/mojo_services/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/media_test/media_test.cc
diff --git a/examples/media_test/media_test.cc b/examples/media_test/media_test.cc
index 3e78fe4170d9219f56f0bfe30ecf5c8c60974f60..c1f0d19122e4ff1dabbe3b010ff5e9ec0e87670e 100644
--- a/examples/media_test/media_test.cc
+++ b/examples/media_test/media_test.cc
@@ -4,8 +4,8 @@
#include "examples/media_test/media_test.h"
#include "mojo/public/cpp/application/connect.h"
-#include "mojo/services/media/common/cpp/linear_transform.h"
-#include "mojo/services/media/common/cpp/local_time.h"
+#include "mojo/services/media/common/cpp/timeline.h"
+#include "mojo/services/media/common/cpp/timeline_function.h"
#include "mojo/services/media/control/interfaces/media_factory.mojom.h"
namespace mojo {
@@ -35,10 +35,8 @@ MediaTest::MediaTest(mojo::ApplicationImpl* app,
MediaTest::~MediaTest() {}
int64_t MediaTest::position_ns() const {
- // Apply the transform to the current time.
- int64_t position;
- transform_.DoForwardTransform(LocalClock::now().time_since_epoch().count(),
- &position);
+ // Apply the timeline function to the current time.
+ int64_t position = timeline_function_(Timeline::local_now());
if (position < 0) {
position = 0;
@@ -62,15 +60,8 @@ void MediaTest::HandleStatusUpdates(uint64_t version,
previous_state_ = state_;
state_ = status->state;
- // Create a linear transform that translates local time to presentation
- // time. Note that 'reference' here refers to the presentation time, and
- // 'target' refers to the local time.
if (status->timeline_transform) {
- transform_ =
- LinearTransform(status->timeline_transform->quad->target_offset,
- status->timeline_transform->quad->reference_delta,
- status->timeline_transform->quad->target_delta,
- status->timeline_transform->quad->reference_offset);
+ timeline_function_ = status->timeline_transform.To<TimelineFunction>();
}
metadata_ = status->metadata.Pass();
« no previous file with comments | « examples/media_test/media_test.h ('k') | mojo/dart/packages/mojo_services/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698