| OLD | NEW |
| 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 CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 25 | 25 |
| 26 namespace media { | 26 namespace media { |
| 27 class DemuxerAndroid; | 27 class DemuxerAndroid; |
| 28 } | 28 } |
| 29 | 29 |
| 30 struct MediaPlayerHostMsg_Initialize_Params; | 30 struct MediaPlayerHostMsg_Initialize_Params; |
| 31 | 31 |
| 32 namespace content { | 32 namespace content { |
| 33 class BrowserDemuxerAndroid; | 33 class BrowserDemuxerAndroid; |
| 34 class BrowserMediaSessionManager; |
| 34 #if !defined(USE_AURA) | 35 #if !defined(USE_AURA) |
| 35 class ContentViewCore; | 36 class ContentViewCore; |
| 36 #endif | 37 #endif |
| 37 class ExternalVideoSurfaceContainer; | 38 class ExternalVideoSurfaceContainer; |
| 38 class RenderFrameHost; | 39 class RenderFrameHost; |
| 39 class WebContents; | 40 class WebContents; |
| 40 | 41 |
| 41 // This class manages all the MediaPlayerAndroid objects. | 42 // This class manages all the MediaPlayerAndroid objects. |
| 42 // It receives control operations from the the render process, and forwards | 43 // It receives control operations from the the render process, and forwards |
| 43 // them to corresponding MediaPlayerAndroid object. Callbacks from | 44 // them to corresponding MediaPlayerAndroid object. Callbacks from |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 194 |
| 194 // Helper method to start playback. | 195 // Helper method to start playback. |
| 195 void StartInternal(int player_id); | 196 void StartInternal(int player_id); |
| 196 | 197 |
| 197 #if defined(VIDEO_HOLE) | 198 #if defined(VIDEO_HOLE) |
| 198 void ReleasePlayerOfExternalVideoSurfaceIfNeeded(int future_player); | 199 void ReleasePlayerOfExternalVideoSurfaceIfNeeded(int future_player); |
| 199 void OnRequestExternalSurface(int player_id, const gfx::RectF& rect); | 200 void OnRequestExternalSurface(int player_id, const gfx::RectF& rect); |
| 200 void ReleaseExternalSurface(int player_id); | 201 void ReleaseExternalSurface(int player_id); |
| 201 #endif // defined(VIDEO_HOLE) | 202 #endif // defined(VIDEO_HOLE) |
| 202 | 203 |
| 204 BrowserMediaSessionManager* GetMediaSessionManager(); |
| 205 |
| 203 RenderFrameHost* const render_frame_host_; | 206 RenderFrameHost* const render_frame_host_; |
| 204 | 207 |
| 205 // An array of managed players. | 208 // An array of managed players. |
| 206 ScopedVector<media::MediaPlayerAndroid> players_; | 209 ScopedVector<media::MediaPlayerAndroid> players_; |
| 207 | 210 |
| 208 typedef std::map<int, bool> ActivePlayerMap; | 211 typedef std::map<int, bool> ActivePlayerMap; |
| 209 // Players that have requested decoding resources. Even though resource is | 212 // Players that have requested decoding resources. Even though resource is |
| 210 // requested, a player may be in a paused or error state and the manager | 213 // requested, a player may be in a paused or error state and the manager |
| 211 // will release its resources later. | 214 // will release its resources later. |
| 212 ActivePlayerMap active_players_; | 215 ActivePlayerMap active_players_; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 232 | 235 |
| 233 // NOTE: Weak pointers must be invalidated before all other member variables. | 236 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 234 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; | 237 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; |
| 235 | 238 |
| 236 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); | 239 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); |
| 237 }; | 240 }; |
| 238 | 241 |
| 239 } // namespace content | 242 } // namespace content |
| 240 | 243 |
| 241 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 244 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
| OLD | NEW |