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

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

Issue 333003003: aw: Support the platform specific key-systems. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 60215ea6148437cab339d3e67cb287443f3b2ed8..9e951c3404ec35000f3d6be58b053f0215760609 100644
--- a/media/base/android/media_drm_bridge.cc
+++ b/media/base/android/media_drm_bridge.cc
@@ -16,6 +16,7 @@
#include "base/logging.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/strings/string_util.h"
+#include "base/sys_byteorder.h"
#include "jni/MediaDrmBridge_jni.h"
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
@@ -276,9 +277,18 @@ bool MediaDrmBridge::IsSecurityLevelSupported(const std::string& key_system,
return media_drm_bridge->SetSecurityLevel(security_level);
}
-// static
-void MediaDrmBridge::AddKeySystemUuidMapping(const std::string& key_system,
- const std::vector<uint8>& uuid) {
+static void AddKeySystemUuidMapping(JNIEnv*env, jclass clazz,
+ jstring j_key_system,
+ jlong uuid_msb, jlong uuid_lsb) {
+ std::string key_system = ConvertJavaStringToUTF8(env, j_key_system);
+ // MSB (byte) should be positioned at the first element.
+ uuid_msb = base::HostToNet64(uuid_msb);
+ uuid_lsb = base::HostToNet64(uuid_lsb);
+ std::vector<uint8> uuid;
+ uuid.insert(uuid.end(), reinterpret_cast<uint8*>(&uuid_msb),
+ reinterpret_cast<uint8*>(&uuid_msb + 1));
+ uuid.insert(uuid.end(), reinterpret_cast<uint8*>(&uuid_lsb),
+ reinterpret_cast<uint8*>(&uuid_lsb + 1));
xhwang 2014/06/16 15:58:32 nit: Can you convert the UUID to an array or vecto
ycheo (away) 2014/06/16 21:42:11 In UUID, there is no method to return an array or
xhwang 2014/06/16 21:46:50 Yes, I saw that, so you have to do some kind of co
ycheo (away) 2014/06/16 23:40:36 Done.
g_key_system_uuid_manager.Get().AddMapping(key_system, uuid);
}

Powered by Google App Engine
This is Rietveld 408576698