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

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

Issue 17101027: Add a function to convert key system into UUID (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moving the function into MediaDrmBridge Created 7 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 8760900a8879af28953035571011e4d7ce01dec1..b746d392717bc96a6d39ac8e38525990b711c46a 100644
--- a/media/base/android/media_drm_bridge.cc
+++ b/media/base/android/media_drm_bridge.cc
@@ -8,6 +8,27 @@
using base::android::ScopedJavaLocalRef;
+namespace {
+
+// TODO(qinmin): figure out what is the UUID for com.widevine.alpha, and also
+// other key systems.
+const uint8 kWideVineUUID[] = {
+ 0xED, 0xEF, 0x8B, 0xA9, 0x79, 0xD6, 0x4A, 0xCE, // Widevine UUID
+ 0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED,
+};
+
+static std::vector<uint8> ConvertKeySystemToUUID(
+ const std::string& key_system) {
+ std::vector<uint8> uuid;
+ if (0 == key_system.compare("com.widevine"))
xhwang 2013/06/19 21:30:41 Why not just if (key_system == "com.widevine") ? T
qinmin 2013/06/19 21:56:05 Done.
+ uuid.insert(uuid.end(), kWideVineUUID, kWideVineUUID + 16);
xhwang 2013/06/19 21:30:41 uuid.assign(kWideVineUUID, kWideVineUUID + 16) ? W
qinmin 2013/06/19 21:56:05 Done.
+ else
+ NOTIMPLEMENTED();
+ return uuid;
+}
+
+} // namespace
+
namespace media {
// static
@@ -16,8 +37,11 @@ bool MediaDrmBridge::IsAvailable() {
}
MediaDrmBridge::MediaDrmBridge(
- int media_keys_id, const std::vector<uint8>& uuid)
- : media_keys_id_(media_keys_id) {}
+ int media_keys_id, const std::string& key_system)
+ : media_keys_id_(media_keys_id) {
+ // TODO(qinmin): pass the uuid to DRM engine.
+ std::vector<uint8> uuid = ConvertKeySystemToUUID(key_system);
xhwang 2013/06/19 21:30:41 MediaDrmBridge should probably keep a reference to
qinmin 2013/06/19 21:56:05 added a uuid_ member variable. On 2013/06/19 21:3
+}
MediaDrmBridge::~MediaDrmBridge() {}
« 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