| 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 "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
| 8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 bool MediaDrmBridge::IsSecurityLevelSupported( | 185 bool MediaDrmBridge::IsSecurityLevelSupported( |
| 186 const std::vector<uint8>& scheme_uuid, | 186 const std::vector<uint8>& scheme_uuid, |
| 187 const std::string& security_level) { | 187 const std::string& security_level) { |
| 188 // Pass 0 as |media_keys_id| and NULL as |manager| as they are not used in | 188 // Pass 0 as |media_keys_id| and NULL as |manager| as they are not used in |
| 189 // creation time of MediaDrmBridge. | 189 // creation time of MediaDrmBridge. |
| 190 return MediaDrmBridge::Create(0, scheme_uuid, security_level, NULL) != NULL; | 190 return MediaDrmBridge::Create(0, scheme_uuid, security_level, NULL) != NULL; |
| 191 } | 191 } |
| 192 | 192 |
| 193 bool MediaDrmBridge::IsCryptoSchemeSupported( | 193 bool MediaDrmBridge::IsCryptoSchemeSupported( |
| 194 const std::vector<uint8>& scheme_uuid, | 194 const std::vector<uint8>& scheme_uuid) { |
| 195 const std::string& container_mime_type) { | |
| 196 JNIEnv* env = AttachCurrentThread(); | 195 JNIEnv* env = AttachCurrentThread(); |
| 197 ScopedJavaLocalRef<jbyteArray> j_scheme_uuid = | 196 ScopedJavaLocalRef<jbyteArray> j_scheme_uuid = |
| 198 base::android::ToJavaByteArray(env, &scheme_uuid[0], scheme_uuid.size()); | 197 base::android::ToJavaByteArray(env, &scheme_uuid[0], scheme_uuid.size()); |
| 199 ScopedJavaLocalRef<jstring> j_container_mime_type = | 198 return Java_MediaDrmBridge_isCryptoSchemeSupported(env, j_scheme_uuid.obj()); |
| 200 ConvertUTF8ToJavaString(env, container_mime_type); | |
| 201 return Java_MediaDrmBridge_isCryptoSchemeSupported( | |
| 202 env, j_scheme_uuid.obj(), j_container_mime_type.obj()); | |
| 203 } | 199 } |
| 204 | 200 |
| 205 bool MediaDrmBridge::RegisterMediaDrmBridge(JNIEnv* env) { | 201 bool MediaDrmBridge::RegisterMediaDrmBridge(JNIEnv* env) { |
| 206 return RegisterNativesImpl(env); | 202 return RegisterNativesImpl(env); |
| 207 } | 203 } |
| 208 | 204 |
| 209 MediaDrmBridge::MediaDrmBridge(int media_keys_id, | 205 MediaDrmBridge::MediaDrmBridge(int media_keys_id, |
| 210 const std::vector<uint8>& scheme_uuid, | 206 const std::vector<uint8>& scheme_uuid, |
| 211 const std::string& security_level, | 207 const std::string& security_level, |
| 212 MediaPlayerManager* manager) | 208 MediaPlayerManager* manager) |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 std::string security_level_str = | 327 std::string security_level_str = |
| 332 ConvertJavaStringToUTF8(env, j_security_level.obj()); | 328 ConvertJavaStringToUTF8(env, j_security_level.obj()); |
| 333 return GetSecurityLevelFromString(security_level_str); | 329 return GetSecurityLevelFromString(security_level_str); |
| 334 } | 330 } |
| 335 | 331 |
| 336 bool MediaDrmBridge::IsProtectedSurfaceRequired() { | 332 bool MediaDrmBridge::IsProtectedSurfaceRequired() { |
| 337 return IsSecureDecoderRequired(GetSecurityLevel()); | 333 return IsSecureDecoderRequired(GetSecurityLevel()); |
| 338 } | 334 } |
| 339 | 335 |
| 340 } // namespace media | 336 } // namespace media |
| OLD | NEW |