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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/android/media_drm_bridge.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/android/media_drm_bridge.h" 5 #include "media/base/android/media_drm_bridge.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 using base::android::ScopedJavaLocalRef; 9 using base::android::ScopedJavaLocalRef;
10 10
11 namespace {
12
13 // TODO(qinmin): figure out what is the UUID for com.widevine.alpha, and also
14 // other key systems.
15 const uint8 kWideVineUUID[] = {
16 0xED, 0xEF, 0x8B, 0xA9, 0x79, 0xD6, 0x4A, 0xCE, // Widevine UUID
17 0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED,
18 };
19
20 static std::vector<uint8> ConvertKeySystemToUUID(
21 const std::string& key_system) {
22 std::vector<uint8> uuid;
23 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.
24 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.
25 else
26 NOTIMPLEMENTED();
27 return uuid;
28 }
29
30 } // namespace
31
11 namespace media { 32 namespace media {
12 33
13 // static 34 // static
14 bool MediaDrmBridge::IsAvailable() { 35 bool MediaDrmBridge::IsAvailable() {
15 return false; 36 return false;
16 } 37 }
17 38
18 MediaDrmBridge::MediaDrmBridge( 39 MediaDrmBridge::MediaDrmBridge(
19 int media_keys_id, const std::vector<uint8>& uuid) 40 int media_keys_id, const std::string& key_system)
20 : media_keys_id_(media_keys_id) {} 41 : media_keys_id_(media_keys_id) {
42 // TODO(qinmin): pass the uuid to DRM engine.
43 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
44 }
21 45
22 MediaDrmBridge::~MediaDrmBridge() {} 46 MediaDrmBridge::~MediaDrmBridge() {}
23 47
24 bool MediaDrmBridge::GenerateKeyRequest(const std::string& type, 48 bool MediaDrmBridge::GenerateKeyRequest(const std::string& type,
25 const uint8* init_data, 49 const uint8* init_data,
26 int init_data_length) { 50 int init_data_length) {
27 NOTIMPLEMENTED(); 51 NOTIMPLEMENTED();
28 return false; 52 return false;
29 } 53 }
30 54
(...skipping 23 matching lines...) Expand all
54 NOTIMPLEMENTED(); 78 NOTIMPLEMENTED();
55 } 79 }
56 80
57 void MediaDrmBridge::OnDrmEvent( 81 void MediaDrmBridge::OnDrmEvent(
58 JNIEnv* env, jobject j_media_drm, jstring session_id, jint event, 82 JNIEnv* env, jobject j_media_drm, jstring session_id, jint event,
59 jint extra, jstring data) { 83 jint extra, jstring data) {
60 NOTIMPLEMENTED(); 84 NOTIMPLEMENTED();
61 } 85 }
62 86
63 } // namespace media 87 } // namespace media
OLDNEW
« 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