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

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: Fix nits. 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
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..c5536b18cbe123e1a6632f86e79225b0900f4df8 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,16 @@ 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) {
+ if (it->first.compare(kWidevineKeySystem) != 0)
ddorwin 2014/06/11 01:54:02 This should be commented.
ycheo (away) 2014/06/11 07:43:43 Done.
+ key_systems.push_back(it->first);
+ }
+ return key_systems;
+}
+
base::LazyInstance<KeySystemUuidManager>::Leaky g_key_system_uuid_manager =
LAZY_INSTANCE_INITIALIZER;
@@ -264,13 +275,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();
ddorwin 2014/06/11 01:54:01 This indirection makes an extra copy. :(
ycheo (away) 2014/06/11 07:43:43 As I tested, GCC does the return value optimizatio
+}
+
+// static
bool MediaDrmBridge::IsKeySystemSupported(const std::string& key_system) {
DCHECK(!key_system.empty());
return IsKeySystemSupportedWithTypeImpl(key_system, "");
« media/base/android/media_drm_bridge.h ('K') | « 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