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

Unified Diff: media/base/android/media_source_player.h

Issue 51613002: Abort MSP::OnPrefetchDone() if just after MSP::Release(). Let seek and config change survive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments and nits from PS6 Created 7 years, 2 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/android/media_source_player.h
diff --git a/media/base/android/media_source_player.h b/media/base/android/media_source_player.h
index 3c16689f7ddd43869f244fde0207e24c693ca3fd..e9ea9245fddfcd95c7c0445dc23d5520b5fef5ef 100644
--- a/media/base/android/media_source_player.h
+++ b/media/base/android/media_source_player.h
@@ -154,6 +154,14 @@ class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid,
// resync with audio and starts decoding.
void OnPrefetchDone();
+ // Test-only method to setup hook for the completion of the next decode cycle.
acolwell GONE FROM CHROMIUM 2013/10/31 17:54:00 nit: You should add that this callback state is cl
wolenetz 2013/11/01 20:45:28 Done.
+ void set_decode_callback_for_testing(const base::Closure& test_decode_cb) {
+ decode_callback_for_testing_ = test_decode_cb;
+ }
+
+ // TODO(qinmin/wolenetz): Reorder these based on their priority from
+ // ProcessPendingEvents(). Release() and other routines are dependent upon
+ // priority consistency.
enum PendingEventFlags {
NO_EVENT_PENDING = 0,
SEEK_EVENT_PENDING = 1 << 0,
@@ -257,6 +265,9 @@ class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid,
// try to start playback again.
bool is_waiting_for_key_;
+ // Test-only callback for hooking the completion of the next decode cycle.
+ base::Closure decode_callback_for_testing_;
+
friend class MediaSourcePlayerTest;
DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayer);
};

Powered by Google App Engine
This is Rietveld 408576698