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

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 PS7 Created 7 years, 1 month 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/base/android/media_decoder_job.cc ('k') | media/base/android/media_source_player.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c718464408fd749e81e45752a30fdd044e496849 100644
--- a/media/base/android/media_source_player.h
+++ b/media/base/android/media_source_player.h
@@ -154,6 +154,17 @@ 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.
+ // This callback state is cleared when it is next run.
+ // Prevent usage creep by only calling this from the
+ // ReleaseWithOnPrefetchDoneAlreadyPosted MediaSourcePlayerTest.
+ 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 +268,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);
};
« no previous file with comments | « media/base/android/media_decoder_job.cc ('k') | media/base/android/media_source_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698