OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 MEDIA_BASE_ANDROID_MEDIA_PLAYER_MANAGER_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_PLAYER_MANAGER_H_ |
6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_MANAGER_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "media/base/android/demuxer_stream_player_params.h" | 13 #include "media/base/android/demuxer_stream_player_params.h" |
14 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
15 #include "media/base/media_keys.h" | 15 #include "media/base/media_keys.h" |
16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
17 | 17 |
18 class GURL; | 18 class GURL; |
19 | 19 |
20 namespace media { | 20 namespace media { |
21 | 21 |
22 class MediaKeys; | 22 class BrowserCdm; |
23 class MediaPlayerAndroid; | 23 class MediaPlayerAndroid; |
24 class MediaResourceGetter; | 24 class MediaResourceGetter; |
25 | 25 |
26 // This class is responsible for managing active MediaPlayerAndroid objects. | 26 // This class is responsible for managing active MediaPlayerAndroid objects. |
27 class MEDIA_EXPORT MediaPlayerManager { | 27 class MEDIA_EXPORT MediaPlayerManager { |
28 public: | 28 public: |
29 virtual ~MediaPlayerManager() {} | 29 virtual ~MediaPlayerManager() {} |
30 | 30 |
31 // Return a pointer to the MediaResourceGetter object. | 31 // Return a pointer to the MediaResourceGetter object. |
32 virtual MediaResourceGetter* GetMediaResourceGetter() = 0; | 32 virtual MediaResourceGetter* GetMediaResourceGetter() = 0; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // Returns the player that's in the fullscreen mode currently. | 68 // Returns the player that's in the fullscreen mode currently. |
69 virtual MediaPlayerAndroid* GetFullscreenPlayer() = 0; | 69 virtual MediaPlayerAndroid* GetFullscreenPlayer() = 0; |
70 | 70 |
71 // Returns the player with the specified id. | 71 // Returns the player with the specified id. |
72 virtual MediaPlayerAndroid* GetPlayer(int player_id) = 0; | 72 virtual MediaPlayerAndroid* GetPlayer(int player_id) = 0; |
73 | 73 |
74 // Release all the players managed by this object. | 74 // Release all the players managed by this object. |
75 virtual void DestroyAllMediaPlayers() = 0; | 75 virtual void DestroyAllMediaPlayers() = 0; |
76 | 76 |
77 // Get the CDM for the given CDM ID. | 77 // Get the CDM for the given CDM ID. |
78 virtual MediaKeys* GetCdm(int cdm_id) = 0; | 78 virtual BrowserCdm* GetCdm(int cdm_id) = 0; |
79 | 79 |
80 // Called by the player to get a hardware protected surface. | 80 // Called by the player to get a hardware protected surface. |
81 virtual void RequestFullScreen(int player_id) = 0; | 81 virtual void RequestFullScreen(int player_id) = 0; |
82 | 82 |
83 // The following five methods are related to EME. | 83 // The following five methods are related to EME. |
84 // TODO(xhwang): These methods needs to be decoupled from MediaPlayerManager | 84 // TODO(xhwang): These methods needs to be decoupled from MediaPlayerManager |
85 // to support the W3C Working Draft version of the EME spec. | 85 // to support the W3C Working Draft version of the EME spec. |
86 // http://crbug.com/315312 | 86 // http://crbug.com/315312 |
87 | 87 |
88 // Called when CDM creates a session. | 88 // Called when CDM creates a session. |
89 virtual void OnSessionCreated(int cdm_id, | 89 virtual void OnSessionCreated(int cdm_id, |
90 uint32 session_id, | 90 uint32 session_id, |
91 const std::string& web_session_id) = 0; | 91 const std::string& web_session_id) = 0; |
92 | 92 |
93 // Called when CDM wants to send a Message event. | 93 // Called when CDM wants to send a Message event. |
94 virtual void OnSessionMessage(int cdm_id, | 94 virtual void OnSessionMessage(int cdm_id, |
95 uint32 session_id, | 95 uint32 session_id, |
96 const std::vector<uint8>& message, | 96 const std::vector<uint8>& message, |
97 const GURL& destination_url) = 0; | 97 const GURL& destination_url) = 0; |
98 | 98 |
99 // Called when CDM wants to send a Ready event. | 99 // Called when CDM wants to send a Ready event. |
100 virtual void OnSessionReady(int cdm_id, uint32 session_id) = 0; | 100 virtual void OnSessionReady(int cdm_id, uint32 session_id) = 0; |
101 | 101 |
102 // Called when CDM wants to send a Closed event. | 102 // Called when CDM wants to send a Closed event. |
103 virtual void OnSessionClosed(int cdm_id, uint32 session_id) = 0; | 103 virtual void OnSessionClosed(int cdm_id, uint32 session_id) = 0; |
104 | 104 |
105 // Called when CDM wants to send an Error event. | 105 // Called when CDM wants to send an Error event. |
106 virtual void OnSessionError(int cdm_id, | 106 virtual void OnSessionError(int cdm_id, |
107 uint32 session_id, | 107 uint32 session_id, |
108 media::MediaKeys::KeyError error_code, | 108 MediaKeys::KeyError error_code, |
109 uint32 system_code) = 0; | 109 uint32 system_code) = 0; |
110 }; | 110 }; |
111 | 111 |
112 } // namespace media | 112 } // namespace media |
113 | 113 |
114 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_MANAGER_H_ | 114 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_MANAGER_H_ |
OLD | NEW |