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 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "content/browser/android/content_video_view.h" | 18 #include "content/browser/android/content_video_view.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/common/media/cdm_messages_enums.h" | 20 #include "content/common/media/cdm_messages_enums.h" |
21 #include "content/common/media/media_player_messages_enums_android.h" | 21 #include "content/common/media/media_player_messages_enums_android.h" |
22 #include "ipc/ipc_message.h" | 22 #include "ipc/ipc_message.h" |
23 #include "media/base/android/media_player_android.h" | 23 #include "media/base/android/media_player_android.h" |
24 #include "media/base/android/media_player_manager.h" | 24 #include "media/base/android/media_player_manager.h" |
25 #include "media/base/media_keys.h" | |
25 #include "ui/gfx/rect_f.h" | 26 #include "ui/gfx/rect_f.h" |
26 #include "url/gurl.h" | 27 #include "url/gurl.h" |
27 | 28 |
28 namespace media { | 29 namespace media { |
29 class DemuxerAndroid; | 30 class DemuxerAndroid; |
30 class MediaKeys; | 31 class MediaDrmBridge; |
ddorwin
2014/05/30 18:43:56
This basically reverts a previous CL. :(
We might
xhwang
2014/06/02 21:59:21
Yeah, this will be BrowserCdm, which can be not a
| |
31 } | 32 } |
32 | 33 |
33 namespace content { | 34 namespace content { |
34 class BrowserDemuxerAndroid; | 35 class BrowserDemuxerAndroid; |
35 class ContentViewCoreImpl; | 36 class ContentViewCoreImpl; |
36 class ExternalVideoSurfaceContainer; | 37 class ExternalVideoSurfaceContainer; |
37 class RenderFrameHost; | 38 class RenderFrameHost; |
38 class WebContents; | 39 class WebContents; |
39 | 40 |
40 // This class manages all the MediaPlayerAndroid and CDM objects. | 41 // This class manages all the MediaPlayerAndroid and CDM objects. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 virtual void OnBufferingUpdate(int player_id, int percentage) OVERRIDE; | 85 virtual void OnBufferingUpdate(int player_id, int percentage) OVERRIDE; |
85 virtual void OnSeekComplete( | 86 virtual void OnSeekComplete( |
86 int player_id, | 87 int player_id, |
87 const base::TimeDelta& current_time) OVERRIDE; | 88 const base::TimeDelta& current_time) OVERRIDE; |
88 virtual void OnError(int player_id, int error) OVERRIDE; | 89 virtual void OnError(int player_id, int error) OVERRIDE; |
89 virtual void OnVideoSizeChanged( | 90 virtual void OnVideoSizeChanged( |
90 int player_id, int width, int height) OVERRIDE; | 91 int player_id, int width, int height) OVERRIDE; |
91 virtual media::MediaResourceGetter* GetMediaResourceGetter() OVERRIDE; | 92 virtual media::MediaResourceGetter* GetMediaResourceGetter() OVERRIDE; |
92 virtual media::MediaPlayerAndroid* GetFullscreenPlayer() OVERRIDE; | 93 virtual media::MediaPlayerAndroid* GetFullscreenPlayer() OVERRIDE; |
93 virtual media::MediaPlayerAndroid* GetPlayer(int player_id) OVERRIDE; | 94 virtual media::MediaPlayerAndroid* GetPlayer(int player_id) OVERRIDE; |
94 virtual media::MediaKeys* GetCdm(int cdm_id) OVERRIDE; | 95 virtual media::MediaDrmBridge* GetCdm(int cdm_id) OVERRIDE; |
95 virtual void DestroyAllMediaPlayers() OVERRIDE; | 96 virtual void DestroyAllMediaPlayers() OVERRIDE; |
96 virtual void RequestFullScreen(int player_id) OVERRIDE; | 97 virtual void RequestFullScreen(int player_id) OVERRIDE; |
97 virtual void OnSessionCreated(int cdm_id, | 98 virtual void OnSessionCreated(int cdm_id, |
98 uint32 session_id, | 99 uint32 session_id, |
99 const std::string& web_session_id) OVERRIDE; | 100 const std::string& web_session_id) OVERRIDE; |
100 virtual void OnSessionMessage(int cdm_id, | 101 virtual void OnSessionMessage(int cdm_id, |
101 uint32 session_id, | 102 uint32 session_id, |
102 const std::vector<uint8>& message, | 103 const std::vector<uint8>& message, |
103 const GURL& destination_url) OVERRIDE; | 104 const GURL& destination_url) OVERRIDE; |
104 virtual void OnSessionReady(int cdm_id, uint32 session_id) OVERRIDE; | 105 virtual void OnSessionReady(int cdm_id, uint32 session_id) OVERRIDE; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 #if defined(VIDEO_HOLE) | 223 #if defined(VIDEO_HOLE) |
223 void OnRequestExternalSurface(int player_id, const gfx::RectF& rect); | 224 void OnRequestExternalSurface(int player_id, const gfx::RectF& rect); |
224 #endif // defined(VIDEO_HOLE) | 225 #endif // defined(VIDEO_HOLE) |
225 | 226 |
226 RenderFrameHost* const render_frame_host_; | 227 RenderFrameHost* const render_frame_host_; |
227 | 228 |
228 // An array of managed players. | 229 // An array of managed players. |
229 ScopedVector<media::MediaPlayerAndroid> players_; | 230 ScopedVector<media::MediaPlayerAndroid> players_; |
230 | 231 |
231 // A map from CDM IDs to managed CDMs. | 232 // A map from CDM IDs to managed CDMs. |
232 typedef std::map<int, media::MediaKeys*> CdmMap; | 233 typedef std::map<int, media::MediaDrmBridge*> CdmMap; |
233 CdmMap cdm_map_; | 234 CdmMap cdm_map_; |
234 | 235 |
235 // Map from CDM ID to MediaPlayerAndroid player ID to indicate that | 236 // Map from CDM ID to MediaPlayerAndroid player ID to indicate that |
236 // the CDM is set on the MediaPlayerAndroid object. | 237 // the CDM is set on the MediaPlayerAndroid object. |
237 // TODO(xhwang): Register a callback in the CDM to resume playback so that we | 238 // TODO(xhwang): Register a callback in the CDM to resume playback so that we |
238 // can remove this map. See http://crbug.com/373327 | 239 // can remove this map. See http://crbug.com/373327 |
239 typedef std::map<int, int> CdmToPlayerMap; | 240 typedef std::map<int, int> CdmToPlayerMap; |
240 CdmToPlayerMap cdm_to_player_map_; | 241 CdmToPlayerMap cdm_to_player_map_; |
241 | 242 |
242 // Map from CDM ID to CDM's security origin. | 243 // Map from CDM ID to CDM's security origin. |
(...skipping 20 matching lines...) Expand all Loading... | |
263 | 264 |
264 // NOTE: Weak pointers must be invalidated before all other member variables. | 265 // NOTE: Weak pointers must be invalidated before all other member variables. |
265 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; | 266 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; |
266 | 267 |
267 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); | 268 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); |
268 }; | 269 }; |
269 | 270 |
270 } // namespace content | 271 } // namespace content |
271 | 272 |
272 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 273 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
OLD | NEW |