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

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

Issue 320383005: Add an IPC to return the platform supported key-system names in Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed xhwang's comments. Created 6 years, 6 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
« no previous file with comments | « media/base/android/media_drm_bridge.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_drm_bridge.cc
diff --git a/media/base/android/media_drm_bridge.cc b/media/base/android/media_drm_bridge.cc
index fc0288ab77381376ccbce06caf3035d0f1fe86ca..60215ea6148437cab339d3e67cb287443f3b2ed8 100644
--- a/media/base/android/media_drm_bridge.cc
+++ b/media/base/android/media_drm_bridge.cc
@@ -73,6 +73,7 @@ class KeySystemUuidManager {
KeySystemUuidManager();
UUID GetUUID(const std::string& key_system);
void AddMapping(const std::string& key_system, const UUID& uuid);
+ std::vector<std::string> GetPlatformKeySystemNames();
private:
typedef base::hash_map<std::string, UUID> KeySystemUuidMap;
@@ -105,6 +106,17 @@ void KeySystemUuidManager::AddMapping(const std::string& key_system,
key_system_uuid_map_[key_system] = uuid;
}
+std::vector<std::string> KeySystemUuidManager::GetPlatformKeySystemNames() {
+ std::vector<std::string> key_systems;
+ for (KeySystemUuidMap::iterator it = key_system_uuid_map_.begin();
+ it != key_system_uuid_map_.end(); ++it) {
+ // Rule out the key system handled by Chrome explicitly.
+ if (it->first != kWidevineKeySystem)
+ key_systems.push_back(it->first);
+ }
+ return key_systems;
+}
+
base::LazyInstance<KeySystemUuidManager>::Leaky g_key_system_uuid_manager =
LAZY_INSTANCE_INITIALIZER;
@@ -264,13 +276,18 @@ bool MediaDrmBridge::IsSecurityLevelSupported(const std::string& key_system,
return media_drm_bridge->SetSecurityLevel(security_level);
}
-//static
+// static
void MediaDrmBridge::AddKeySystemUuidMapping(const std::string& key_system,
const std::vector<uint8>& uuid) {
g_key_system_uuid_manager.Get().AddMapping(key_system, uuid);
}
// static
+std::vector<std::string> MediaDrmBridge::GetPlatformKeySystemNames() {
+ return g_key_system_uuid_manager.Get().GetPlatformKeySystemNames();
+}
+
+// static
bool MediaDrmBridge::IsKeySystemSupported(const std::string& key_system) {
DCHECK(!key_system.empty());
return IsKeySystemSupportedWithTypeImpl(key_system, "");
« no previous file with comments | « media/base/android/media_drm_bridge.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698