Chromium Code Reviews| 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 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 | 18 |
| 19 class MediaDrmBridge; | 19 class MediaKeys; |
| 20 class MediaPlayerAndroid; | 20 class MediaPlayerAndroid; |
| 21 class MediaResourceGetter; | 21 class MediaResourceGetter; |
| 22 | 22 |
| 23 // This class is responsible for managing active MediaPlayerAndroid objects. | 23 // This class is responsible for managing active MediaPlayerAndroid objects. |
| 24 class MEDIA_EXPORT MediaPlayerManager { | 24 class MEDIA_EXPORT MediaPlayerManager { |
| 25 public: | 25 public: |
| 26 virtual ~MediaPlayerManager() {} | 26 virtual ~MediaPlayerManager() {} |
| 27 | 27 |
| 28 // Return a pointer to the MediaResourceGetter object. | 28 // Return a pointer to the MediaResourceGetter object. |
| 29 virtual MediaResourceGetter* GetMediaResourceGetter() = 0; | 29 virtual MediaResourceGetter* GetMediaResourceGetter() = 0; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 | 64 |
| 65 // Returns the player that's in the fullscreen mode currently. | 65 // Returns the player that's in the fullscreen mode currently. |
| 66 virtual MediaPlayerAndroid* GetFullscreenPlayer() = 0; | 66 virtual MediaPlayerAndroid* GetFullscreenPlayer() = 0; |
| 67 | 67 |
| 68 // Returns the player with the specified id. | 68 // Returns the player with the specified id. |
| 69 virtual MediaPlayerAndroid* GetPlayer(int player_id) = 0; | 69 virtual MediaPlayerAndroid* GetPlayer(int player_id) = 0; |
| 70 | 70 |
| 71 // Release all the players managed by this object. | 71 // Release all the players managed by this object. |
| 72 virtual void DestroyAllMediaPlayers() = 0; | 72 virtual void DestroyAllMediaPlayers() = 0; |
| 73 | 73 |
| 74 // Get the MediaDrmBridge object for the given media key Id. | 74 // Get the CDM for the given CDM ID. |
| 75 virtual media::MediaDrmBridge* GetDrmBridge(int cdm_id) = 0; | 75 virtual MediaKeys* GetCdm(int cdm_id) = 0; |
| 76 | 76 |
| 77 // Called by the player to get a hardware protected surface. | 77 // Called by the player to get a hardware protected surface. |
| 78 virtual void RequestFullScreen(int player_id) = 0; | 78 virtual void RequestFullScreen(int player_id) = 0; |
| 79 | 79 |
| 80 // The following five methods are related to EME. | 80 // The following five methods are related to EME. |
| 81 // TODO(xhwang): These methods needs to be decoupled from MediaPlayerManager | 81 // TODO(xhwang): These methods needs to be decoupled from MediaPlayerManager |
| 82 // to support the W3C Working Draft version of the EME spec. | 82 // to support the W3C Working Draft version of the EME spec. |
| 83 // http://crbug.com/315312 | 83 // http://crbug.com/315312 |
| 84 | 84 |
| 85 // Called when MediaDrmBridge determines a SessionId. | 85 // Called when CDM determines a SessionId. |
| 86 virtual void OnSessionCreated(int cdm_id, | 86 virtual void OnSessionCreated(int cdm_id, |
| 87 uint32 session_id, | 87 uint32 session_id, |
| 88 const std::string& web_session_id) = 0; | 88 const std::string& web_session_id) = 0; |
| 89 | 89 |
| 90 // Called when MediaDrmBridge wants to send a Message event. | 90 // Called when CDM wants to send a Message event. |
| 91 virtual void OnSessionMessage(int cdm_id, | 91 virtual void OnSessionMessage(int cdm_id, |
| 92 uint32 session_id, | 92 uint32 session_id, |
| 93 const std::vector<uint8>& message, | 93 const std::vector<uint8>& message, |
| 94 const GURL& destination_url) = 0; | 94 const std::string& destination_url) = 0; |
|
xhwang
2014/05/09 23:40:37
This is changed because media::SessionMessageCB us
| |
| 95 | 95 |
| 96 // Called when MediaDrmBridge wants to send a Ready event. | 96 // Called when CDM wants to send a Ready event. |
| 97 virtual void OnSessionReady(int cdm_id, uint32 session_id) = 0; | 97 virtual void OnSessionReady(int cdm_id, uint32 session_id) = 0; |
| 98 | 98 |
| 99 // Called when MediaDrmBridge wants to send a Closed event. | 99 // Called when CDM wants to send a Closed event. |
| 100 virtual void OnSessionClosed(int cdm_id, uint32 session_id) = 0; | 100 virtual void OnSessionClosed(int cdm_id, uint32 session_id) = 0; |
| 101 | 101 |
| 102 // Called when MediaDrmBridge wants to send an Error event. | 102 // Called when CDM wants to send an Error event. |
| 103 virtual void OnSessionError(int cdm_id, | 103 virtual void OnSessionError(int cdm_id, |
| 104 uint32 session_id, | 104 uint32 session_id, |
| 105 media::MediaKeys::KeyError error_code, | 105 media::MediaKeys::KeyError error_code, |
| 106 uint32 system_code) = 0; | 106 uint32 system_code) = 0; |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 } // namespace media | 109 } // namespace media |
| 110 | 110 |
| 111 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_MANAGER_H_ | 111 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_MANAGER_H_ |
| OLD | NEW |