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

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: comments 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
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
ddorwin 2013/06/19 23:14:41 See below for com.widevine.alpha.
qinmin 2013/06/20 00:49:26 Done.
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) {
ddorwin 2013/06/19 23:14:41 There are constants for the key systems in key_sys
qinmin 2013/06/20 00:49:26 Done. Changing the MediaDrmBridge ctor back to acc
22 std::vector<uint8> uuid;
23 if (key_system == "com.widevine")
ddorwin 2013/06/19 23:14:41 com.widevine.alpha com.widevine is a parent key sy
qinmin 2013/06/20 00:49:26 Done.
24 uuid.assign(kWideVineUUID, kWideVineUUID + 16);
25 else
26 NOTIMPLEMENTED();
ddorwin 2013/06/19 23:14:41 not necessarily - it's just not recognized. You co
qinmin 2013/06/20 00:49:26 Done.
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 uuid_(ConvertKeySystemToUUID(key_system)) {
ddorwin 2013/06/19 23:14:41 With a Create() method, you can do the conversion
qinmin 2013/06/20 00:49:26 Done.
43 // TODO(qinmin): pass the uuid to DRM engine.
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
« content/browser/android/media_player_manager_impl.cc ('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