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

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

Issue 1640123004: Propagate media session id into MediaPlayerAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pass-media-session-id-over-ipc
Patch Set: Fix stray kDefaultMediaSessionID 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 | « media/base/android/media_codec_player_unittest.cc ('k') | media/base/android/media_player_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_player_android.h
diff --git a/media/base/android/media_player_android.h b/media/base/android/media_player_android.h
index 16982d69c8cd8f73716f1c6ca76e9d2b12d526d6..d33bb1460611ddf40b3e38bcf6c53802d56d5591 100644
--- a/media/base/android/media_player_android.h
+++ b/media/base/android/media_player_android.h
@@ -23,6 +23,19 @@ namespace media {
class MediaKeys;
class MediaPlayerManager;
+enum {
+ // Id used for players not participating in any media sessions
+ // because of undefined behavior in the specification. When all
+ // media session interactions have been worked out, this id should
+ // no longer be used.
+ kInvalidMediaSessionId = -1,
+
+ // The media session for media elements that don't have an explicit
+ // user created media session set. Must be in-sync with
+ // WebMediaSession::DefaultID in blink.
+ kDefaultMediaSessionId = 0
+};
+
// This class serves as the base class for different media player
// implementations on Android. Subclasses need to provide their own
// MediaPlayerAndroid::Create() implementation.
@@ -108,6 +121,8 @@ class MEDIA_EXPORT MediaPlayerAndroid {
GURL frame_url() { return frame_url_; }
+ int media_session_id() { return media_session_id_; }
+
// Attach/Detaches |listener_| for listening to all the media events. If
// |j_media_player| is NULL, |listener_| only listens to the system media
// events. Otherwise, it also listens to the events from |j_media_player|.
@@ -119,7 +134,8 @@ class MEDIA_EXPORT MediaPlayerAndroid {
int player_id,
MediaPlayerManager* manager,
const OnDecoderResourcesReleasedCB& on_decoder_resources_released_cb,
- const GURL& frame_url);
+ const GURL& frame_url,
+ int media_session_id);
// TODO(qinmin): Simplify the MediaPlayerListener class to only listen to
// media interrupt events. And have a separate child class to listen to all
@@ -173,6 +189,9 @@ class MEDIA_EXPORT MediaPlayerAndroid {
// Listener object that listens to all the media player events.
scoped_ptr<MediaPlayerListener> listener_;
+ // Media session ID assigned to this player.
+ int media_session_id_;
+
// Weak pointer passed to |listener_| for callbacks.
// NOTE: Weak pointers must be invalidated before all other member variables.
base::WeakPtrFactory<MediaPlayerAndroid> weak_factory_;
« no previous file with comments | « media/base/android/media_codec_player_unittest.cc ('k') | media/base/android/media_player_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698