Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
|
ddorwin
2014/03/04 20:00:56
There are no tests for this class. :(
Now that it
xhwang
2014/03/05 21:52:33
I'll add tests (mainly for the static methods) in
| |
| 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 #ifndef MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ |
| 6 #define MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <queue> | 10 #include <queue> |
| 11 #include <string> | 11 #include <string> |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 34 SECURITY_LEVEL_3 = 3, | 34 SECURITY_LEVEL_3 = 3, |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 typedef base::Callback<void(bool)> ResetCredentialsCB; | 37 typedef base::Callback<void(bool)> ResetCredentialsCB; |
| 38 | 38 |
| 39 virtual ~MediaDrmBridge(); | 39 virtual ~MediaDrmBridge(); |
| 40 | 40 |
| 41 // Checks whether MediaDRM is available. | 41 // Checks whether MediaDRM is available. |
| 42 static bool IsAvailable(); | 42 static bool IsAvailable(); |
| 43 | 43 |
| 44 static bool IsSecurityLevelSupported(const std::vector<uint8>& scheme_uuid, | 44 static bool IsSecurityLevelSupported(const std::string& key_system, |
| 45 SecurityLevel security_level); | 45 SecurityLevel security_level); |
| 46 | 46 |
| 47 static bool IsCryptoSchemeSupported(const std::vector<uint8>& scheme_uuid, | 47 static bool IsCryptoSchemeSupported(const std::string& key_system, |
|
ddorwin
2014/03/04 20:00:56
This function name no longer makes sense. I assume
xhwang
2014/03/05 21:52:33
Done.
| |
| 48 const std::string& container_mime_type); | 48 const std::string& container_mime_type); |
| 49 | 49 |
| 50 static bool IsSecureDecoderRequired(SecurityLevel security_level); | 50 static bool IsSecureDecoderRequired(SecurityLevel security_level); |
| 51 | 51 |
| 52 static bool RegisterMediaDrmBridge(JNIEnv* env); | 52 static bool RegisterMediaDrmBridge(JNIEnv* env); |
| 53 | 53 |
| 54 // Returns a MediaDrmBridge instance if |scheme_uuid| is supported, or a NULL | 54 // Returns a MediaDrmBridge instance if |key_system| is supported, or a NULL |
| 55 // pointer otherwise. | 55 // pointer otherwise. |
| 56 static scoped_ptr<MediaDrmBridge> Create( | 56 static scoped_ptr<MediaDrmBridge> Create( |
| 57 int cdm_id, | 57 int cdm_id, |
| 58 const std::vector<uint8>& scheme_uuid, | 58 const std::string& key_system, |
| 59 const GURL& frame_url, | 59 const GURL& frame_url, |
| 60 MediaPlayerManager* manager); | 60 MediaPlayerManager* manager); |
| 61 | 61 |
| 62 // Returns true if |security_level| is successfully set, or false otherwise. | 62 // Returns true if |security_level| is successfully set, or false otherwise. |
| 63 // Call this function right after Create() and before any other calls. | 63 // Call this function right after Create() and before any other calls. |
| 64 // Note: | 64 // Note: |
| 65 // - If this function is not called, the default security level of the device | 65 // - If this function is not called, the default security level of the device |
| 66 // will be used. | 66 // will be used. |
| 67 // - It's recommended to call this function only once on a MediaDrmBridge | 67 // - It's recommended to call this function only once on a MediaDrmBridge |
| 68 // object. Calling this function multiples times may cause errors. | 68 // object. Calling this function multiples times may cause errors. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 base::Closure media_crypto_ready_cb_; | 146 base::Closure media_crypto_ready_cb_; |
| 147 | 147 |
| 148 ResetCredentialsCB reset_credentials_cb_; | 148 ResetCredentialsCB reset_credentials_cb_; |
| 149 | 149 |
| 150 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); | 150 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace media | 153 } // namespace media |
| 154 | 154 |
| 155 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ | 155 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ |
| OLD | NEW |