Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(813)

Unified Diff: media/base/android/media_drm_bridge.h

Issue 1341883003: Prepare MediaDrmBridge to work with MediaCodecPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bug526755
Patch Set: Cleanup of MediaDrmBridge Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/android/media_drm_bridge.h
diff --git a/media/base/android/media_drm_bridge.h b/media/base/android/media_drm_bridge.h
index f6a951f607749a10049441595a7753b374509c4d..1a954139eb4a8e929ca902c69855ef83b863170f 100644
--- a/media/base/android/media_drm_bridge.h
+++ b/media/base/android/media_drm_bridge.h
@@ -43,6 +43,10 @@ class MEDIA_EXPORT MediaDrmBridge : public BrowserCdm {
// to check IsAvailable() explicitly before calling them.
static bool IsAvailable();
+ // Checks whether we can create the DRM for key system and security level.
+ static bool CanCreate(const std::string& key_system,
+ SecurityLevel widevine_security_level);
+
// Checks whether |key_system| is supported.
static bool IsKeySystemSupported(const std::string& key_system);
@@ -61,8 +65,9 @@ class MEDIA_EXPORT MediaDrmBridge : public BrowserCdm {
// Returns a MediaDrmBridge instance if |key_system| is supported, or a NULL
// pointer otherwise.
// TODO(xhwang): Is it okay not to update session expiration info?
- static scoped_ptr<MediaDrmBridge> Create(
+ static scoped_ptr<MediaDrmBridge, BrowserCdmDeleter> Create(
const std::string& key_system,
+ SecurityLevel widevine_security_level,
const SessionMessageCB& session_message_cb,
const SessionClosedCB& session_closed_cb,
const LegacySessionErrorCB& legacy_session_error_cb,
@@ -72,8 +77,8 @@ class MEDIA_EXPORT MediaDrmBridge : public BrowserCdm {
// Returns a MediaDrmBridge instance if |key_system| is supported, or a NULL
// otherwise. No session callbacks are provided. This is used when we need to
// use MediaDrmBridge without creating any sessions.
- static scoped_ptr<MediaDrmBridge> CreateWithoutSessionSupport(
- const std::string& key_system);
+ static scoped_ptr<MediaDrmBridge, BrowserCdmDeleter>
+ CreateWithoutSessionSupport(const std::string& key_system);
// Returns true if |security_level| is successfully set, or false otherwise.
// Call this function right after Create() and before any other calls.
@@ -199,6 +204,8 @@ class MEDIA_EXPORT MediaDrmBridge : public BrowserCdm {
// Get the security level of the media.
SecurityLevel GetSecurityLevel();
+ void InternalKeysAdded(bool has_additional_usable_key);
+
// UUID of the key system.
std::vector<uint8> scheme_uuid_;
@@ -220,6 +227,12 @@ class MEDIA_EXPORT MediaDrmBridge : public BrowserCdm {
CdmPromiseAdapter cdm_promise_adapter_;
+ // Callback for posting Java notifications to Media thread.
+ typedef base::Callback<void(bool)> KeysAddedCallback;
+ KeysAddedCallback internal_keys_added_cb_;
+
+ bool run_on_media_thread_;
+
DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge);
};

Powered by Google App Engine
This is Rietveld 408576698