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