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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/android/scoped_java_ref.h" | 12 #include "base/android/scoped_java_ref.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/memory/scoped_ptr.h" |
14 #include "media/base/media_export.h" | 15 #include "media/base/media_export.h" |
15 #include "media/base/media_keys.h" | 16 #include "media/base/media_keys.h" |
16 | 17 |
17 namespace media { | 18 namespace media { |
18 | 19 |
19 class MediaPlayerManager; | 20 class MediaPlayerManager; |
20 | 21 |
21 // This class provides DRM services for android EME implementation. | 22 // This class provides DRM services for android EME implementation. |
22 // TODO(qinmin): implement all the functions in this class. | 23 // TODO(qinmin): implement all the functions in this class. |
23 class MEDIA_EXPORT MediaDrmBridge : public MediaKeys { | 24 class MEDIA_EXPORT MediaDrmBridge : public MediaKeys { |
24 public: | 25 public: |
25 enum SecurityLevel { | 26 enum SecurityLevel { |
26 SECURITY_LEVEL_NONE = 0, | 27 SECURITY_LEVEL_NONE = 0, |
27 SECURITY_LEVEL_1 = 1, | 28 SECURITY_LEVEL_1 = 1, |
28 SECURITY_LEVEL_3 = 3, | 29 SECURITY_LEVEL_3 = 3, |
29 }; | 30 }; |
30 | 31 |
31 virtual ~MediaDrmBridge(); | 32 virtual ~MediaDrmBridge(); |
32 | 33 |
33 // Returns a MediaDrmBridge instance if |scheme_uuid| is supported, or a NULL | 34 // Returns a MediaDrmBridge instance if |scheme_uuid| is supported, or a NULL |
34 // pointer otherwise. | 35 // pointer otherwise. |
35 static MediaDrmBridge* Create(int media_keys_id, | 36 static scoped_ptr<MediaDrmBridge> Create( |
36 const std::vector<uint8>& scheme_uuid, | 37 int media_keys_id, |
37 const std::string& security_level, | 38 const std::vector<uint8>& scheme_uuid, |
38 MediaPlayerManager* manager); | 39 const std::string& security_level, |
| 40 MediaPlayerManager* manager); |
39 | 41 |
40 // Checks whether MediaDRM is available. | 42 // Checks whether MediaDRM is available. |
41 static bool IsAvailable(); | 43 static bool IsAvailable(); |
42 | 44 |
43 static bool IsCryptoSchemeSupported(const std::vector<uint8>& scheme_uuid, | 45 static bool IsCryptoSchemeSupported(const std::vector<uint8>& scheme_uuid, |
44 const std::string& container_mime_type); | 46 const std::string& container_mime_type); |
45 | 47 |
46 static bool IsSecureDecoderRequired(const std::string& security_level_str); | 48 static bool IsSecureDecoderRequired(const std::string& security_level_str); |
47 | 49 |
48 static bool RegisterMediaDrmBridge(JNIEnv* env); | 50 static bool RegisterMediaDrmBridge(JNIEnv* env); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 MediaPlayerManager* manager_; | 109 MediaPlayerManager* manager_; |
108 | 110 |
109 base::Closure media_crypto_ready_cb_; | 111 base::Closure media_crypto_ready_cb_; |
110 | 112 |
111 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); | 113 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridge); |
112 }; | 114 }; |
113 | 115 |
114 } // namespace media | 116 } // namespace media |
115 | 117 |
116 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ | 118 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_H_ |
OLD | NEW |