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 #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> |
(...skipping 23 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 // TODO(xhwang): Add unit tests for MediaDrmBridge. |
ddorwin
2014/03/05 22:11:29
Would we be better off just filing a bug?
xhwang
2014/03/06 18:09:57
Done.
| |
45 static bool IsSecurityLevelSupported(const std::string& key_system, | |
45 SecurityLevel security_level); | 46 SecurityLevel security_level); |
46 | 47 |
47 static bool IsCryptoSchemeSupported(const std::vector<uint8>& scheme_uuid, | 48 static bool IsKeySystemSupported(const std::string& key_system, |
ddorwin
2014/03/05 22:11:29
...WithType?
xhwang
2014/03/06 18:09:57
Done.
| |
48 const std::string& container_mime_type); | 49 const std::string& container_mime_type); |
49 | 50 |
50 static bool IsSecureDecoderRequired(SecurityLevel security_level); | 51 static bool IsSecureDecoderRequired(SecurityLevel security_level); |
51 | 52 |
52 static bool RegisterMediaDrmBridge(JNIEnv* env); | 53 static bool RegisterMediaDrmBridge(JNIEnv* env); |
53 | 54 |
54 // Returns a MediaDrmBridge instance if |scheme_uuid| is supported, or a NULL | 55 // Returns a MediaDrmBridge instance if |key_system| is supported, or a NULL |
55 // pointer otherwise. | 56 // pointer otherwise. |
56 static scoped_ptr<MediaDrmBridge> Create( | 57 static scoped_ptr<MediaDrmBridge> Create( |
57 int cdm_id, | 58 int cdm_id, |
58 const std::vector<uint8>& scheme_uuid, | 59 const std::string& key_system, |
59 const GURL& frame_url, | 60 const GURL& frame_url, |
60 MediaPlayerManager* manager); | 61 MediaPlayerManager* manager); |
61 | 62 |
62 // Returns true if |security_level| is successfully set, or false otherwise. | 63 // Returns true if |security_level| is successfully set, or false otherwise. |
63 // Call this function right after Create() and before any other calls. | 64 // Call this function right after Create() and before any other calls. |
64 // Note: | 65 // Note: |
65 // - If this function is not called, the default security level of the device | 66 // - If this function is not called, the default security level of the device |
66 // will be used. | 67 // will be used. |
67 // - It's recommended to call this function only once on a MediaDrmBridge | 68 // - It's recommended to call this function only once on a MediaDrmBridge |
68 // object. Calling this function multiples times may cause errors. | 69 // 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_; | 147 base::Closure media_crypto_ready_cb_; |
147 | 148 |
148 ResetCredentialsCB reset_credentials_cb_; | 149 ResetCredentialsCB reset_credentials_cb_; |
149 | 150 |
150 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); | 151 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); |
151 }; | 152 }; |
152 | 153 |
153 } // namespace media | 154 } // namespace media |
154 | 155 |
155 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ | 156 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ |
OLD | NEW |