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

Unified Diff: examples/media_test/media_test.h

Issue 1844093002: Motown: media_test minor fixes and cleanup. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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 | « no previous file | examples/media_test/media_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/media_test/media_test.h
diff --git a/examples/media_test/media_test.h b/examples/media_test/media_test.h
index 0ae4c8144d5fa6e4230e45d314685ea1e6d392c5..00ce3408ff77f9f6b42f39d6393559831ee809c2 100644
--- a/examples/media_test/media_test.h
+++ b/examples/media_test/media_test.h
@@ -27,19 +27,24 @@ class MediaTest {
~MediaTest();
// Registers a callback signalling that the app should update its view.
- void RegisterUpdateCallback(const UpdateCallback& callback);
+ void RegisterUpdateCallback(const UpdateCallback& callback) {
+ update_callback_ = callback;
+ }
// Starts playback.
- void Play();
+ void Play() { media_player_->Play(); }
// Pauses playback.
- void Pause();
+ void Pause() { media_player_->Pause(); }
// Seeks to the position indicated in nanoseconds from the start of the media.
- void Seek(int64_t position_ns);
+ void Seek(int64_t position_ns) { media_player_->Seek(position_ns); }
+
+ // Returns the previous state of the player.
+ MediaState previous_state() const { return previous_state_; }
// Returns the current state of the player.
- MediaState state() const;
+ MediaState state() const { return state_; }
// Returns the current presentation time in nanoseconds.
int64_t position_ns() const;
@@ -56,7 +61,8 @@ class MediaTest {
MediaPlayerStatusPtr status = nullptr);
MediaPlayerPtr media_player_;
- MediaState state_;
+ MediaState previous_state_ = MediaState::UNPREPARED;
+ MediaState state_ = MediaState::UNPREPARED;
LinearTransform transform_ = LinearTransform(0, 0, 1, 0);
MediaMetadataPtr metadata_;
UpdateCallback update_callback_;
« no previous file with comments | « no previous file | examples/media_test/media_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698