OLD | NEW |
---|---|
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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 return std::string(session_id_vector.begin(), session_id_vector.end()); | 49 return std::string(session_id_vector.begin(), session_id_vector.end()); |
50 } | 50 } |
51 | 51 |
52 const uint8 kWidevineUuid[16] = { | 52 const uint8 kWidevineUuid[16] = { |
53 0xED, 0xEF, 0x8B, 0xA9, 0x79, 0xD6, 0x4A, 0xCE, | 53 0xED, 0xEF, 0x8B, 0xA9, 0x79, 0xD6, 0x4A, 0xCE, |
54 0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED }; | 54 0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED }; |
55 | 55 |
56 // Convert |init_data_type| to a string supported by MediaDRM. | 56 // Convert |init_data_type| to a string supported by MediaDRM. |
57 // "audio"/"video" does not matter, so use "video". | 57 // "audio"/"video" does not matter, so use "video". |
58 std::string ConvertInitDataType(media::EmeInitDataType init_data_type) { | 58 std::string ConvertInitDataType(media::EmeInitDataType init_data_type) { |
59 // TODO(jrummell): API level >=20 supports "webm" and "cenc", so switch | 59 // TODO(jrummell/xhwang): EME init data types like "webm" and "cenc" are |
60 // to those strings. | 60 // supported in API level >=21 for Widevine key system. Switch to use those |
61 // strings when they are officially supported in Android for all key systems. | |
61 switch (init_data_type) { | 62 switch (init_data_type) { |
62 case media::EmeInitDataType::WEBM: | 63 case media::EmeInitDataType::WEBM: |
63 return "video/webm"; | 64 return "video/webm"; |
64 case media::EmeInitDataType::CENC: | 65 case media::EmeInitDataType::CENC: |
65 return "video/mp4"; | 66 return "video/mp4"; |
66 default: | 67 default: |
ddorwin
2015/05/19 21:35:24
Should we do the conversion for KEYIDS so we can e
xhwang
2015/05/19 21:44:24
Done.
| |
67 NOTREACHED(); | 68 NOTREACHED(); |
68 return "video/unknown"; | 69 return "video/unknown"; |
69 } | 70 } |
70 } | 71 } |
71 | 72 |
72 class KeySystemManager { | 73 class KeySystemManager { |
73 public: | 74 public: |
74 KeySystemManager(); | 75 KeySystemManager(); |
75 UUID GetUUID(const std::string& key_system); | 76 UUID GetUUID(const std::string& key_system); |
76 std::vector<std::string> GetPlatformKeySystemNames(); | 77 std::vector<std::string> GetPlatformKeySystemNames(); |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
536 JNIEnv* env = AttachCurrentThread(); | 537 JNIEnv* env = AttachCurrentThread(); |
537 Java_MediaDrmBridge_resetDeviceCredentials(env, j_media_drm_.obj()); | 538 Java_MediaDrmBridge_resetDeviceCredentials(env, j_media_drm_.obj()); |
538 } | 539 } |
539 | 540 |
540 void MediaDrmBridge::OnResetDeviceCredentialsCompleted( | 541 void MediaDrmBridge::OnResetDeviceCredentialsCompleted( |
541 JNIEnv* env, jobject, bool success) { | 542 JNIEnv* env, jobject, bool success) { |
542 base::ResetAndReturn(&reset_credentials_cb_).Run(success); | 543 base::ResetAndReturn(&reset_credentials_cb_).Run(success); |
543 } | 544 } |
544 | 545 |
545 } // namespace media | 546 } // namespace media |
OLD | NEW |