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

Side by Side Diff: chrome/browser/media/android/remote/remote_media_player_manager.h

Issue 1570043002: Implement MediaSession on top of the WebMediaPlayerDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media_session
Patch Set: Rebase yet again. Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_MANAGER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_MANAGER_H_
6 #define CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_MANAGER_H_ 6 #define CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_MANAGER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 // Swap which player is currently in use (local or remote). 48 // Swap which player is currently in use (local or remote).
49 void SwitchToRemotePlayer(int player_id, const std::string& casting_message); 49 void SwitchToRemotePlayer(int player_id, const std::string& casting_message);
50 void SwitchToLocalPlayer(int player_id); 50 void SwitchToLocalPlayer(int player_id);
51 51
52 protected: 52 protected:
53 void OnSetPoster(int player_id, const GURL& url) override; 53 void OnSetPoster(int player_id, const GURL& url) override;
54 54
55 void ReleaseResources(int player_id) override; 55 void ReleaseResources(int player_id) override;
56 56
57 bool IsPlayingRemotely(int player_id) override;
58
57 private: 59 private:
58 // Returns a MediaPlayerAndroid implementation for playing the media remotely. 60 // Returns a MediaPlayerAndroid implementation for playing the media remotely.
59 RemoteMediaPlayerBridge* CreateRemoteMediaPlayer( 61 RemoteMediaPlayerBridge* CreateRemoteMediaPlayer(
60 media::MediaPlayerAndroid* local_player); 62 media::MediaPlayerAndroid* local_player);
61 63
62 // Replaces the remote player with the local player this class is holding. 64 // Replaces the remote player with the local player this class is holding.
63 // Does nothing if there is no remote player. 65 // Does nothing if there is no remote player.
64 void ReplaceRemotePlayerWithLocal(int player_id); 66 void ReplaceRemotePlayerWithLocal(int player_id);
65 67
66 // content::BrowserMediaPlayerManager overrides. 68 // content::BrowserMediaPlayerManager overrides.
67 void OnStart(int player_id) override; 69 void OnStart(int player_id) override;
68 void OnInitialize( 70 void OnInitialize(
69 const MediaPlayerHostMsg_Initialize_Params& media_player_params) override; 71 const MediaPlayerHostMsg_Initialize_Params& media_player_params) override;
70 void OnDestroyPlayer(int player_id) override; 72 void OnDestroyPlayer(int player_id) override;
71 void OnSuspendAndReleaseResources(int player_id) override; 73 void OnSuspendAndReleaseResources(int player_id) override;
72 void OnSuspend(int player_id) override;
73 void OnResume(int player_id) override;
74 void OnRequestRemotePlayback(int player_id) override; 74 void OnRequestRemotePlayback(int player_id) override;
75 void OnRequestRemotePlaybackControl(int player_id) override; 75 void OnRequestRemotePlaybackControl(int player_id) override;
76 76
77 void ReleaseFullscreenPlayer(media::MediaPlayerAndroid* player) override; 77 void ReleaseFullscreenPlayer(media::MediaPlayerAndroid* player) override;
78 78
79 // Callback for when the download of poster image is done. 79 // Callback for when the download of poster image is done.
80 void DidDownloadPoster( 80 void DidDownloadPoster(
81 int player_id, 81 int player_id,
82 int id, 82 int id,
83 int http_status_code, 83 int http_status_code,
(...skipping 17 matching lines...) Expand all
101 // playing locally. 101 // playing locally.
102 media::MediaPlayerAndroid* GetLocalPlayer(int player_id); 102 media::MediaPlayerAndroid* GetLocalPlayer(int player_id);
103 103
104 void SwapCurrentPlayer(int player_id); 104 void SwapCurrentPlayer(int player_id);
105 105
106 // Contains the alternative players that are not currently in use, i.e. the 106 // Contains the alternative players that are not currently in use, i.e. the
107 // remote players for videos that are playing locally, and the local players 107 // remote players for videos that are playing locally, and the local players
108 // for videos that are playing remotely. 108 // for videos that are playing remotely.
109 ScopedVector<media::MediaPlayerAndroid> alternative_players_; 109 ScopedVector<media::MediaPlayerAndroid> alternative_players_;
110 110
111 bool IsPlayingRemotely(int player_id);
112
113 std::set<int> players_playing_remotely_; 111 std::set<int> players_playing_remotely_;
114 112
115 base::WeakPtrFactory<RemoteMediaPlayerManager> weak_ptr_factory_; 113 base::WeakPtrFactory<RemoteMediaPlayerManager> weak_ptr_factory_;
116 114
117 DISALLOW_COPY_AND_ASSIGN(RemoteMediaPlayerManager); 115 DISALLOW_COPY_AND_ASSIGN(RemoteMediaPlayerManager);
118 }; 116 };
119 117
120 } // namespace remote_media 118 } // namespace remote_media
121 119
122 #endif // CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_MANAGER_H_ 120 #endif // CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698