OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ |
6 #define CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ | 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... | |
25 // * Abstract key system | 25 // * Abstract key system |
26 // A key system string that cannot be instantiated like a concrete key system | 26 // A key system string that cannot be instantiated like a concrete key system |
27 // but is otherwise useful, such as in discovery using isTypeSupported(). | 27 // but is otherwise useful, such as in discovery using isTypeSupported(). |
28 // * Parent key system | 28 // * Parent key system |
29 // A key system string that is one level up from the child key system. It may | 29 // A key system string that is one level up from the child key system. It may |
30 // be an abstract key system. | 30 // be an abstract key system. |
31 // As an example, "com.example" is the parent of "com.example.foo". | 31 // As an example, "com.example" is the parent of "com.example.foo". |
32 | 32 |
33 namespace content { | 33 namespace content { |
34 | 34 |
35 // Adds a concrete key system along with platform-specific information about how | |
36 // to instantiate it. Must be called before other Add* functions. | |
37 // May only be called once per |key_system|. | |
38 CONTENT_EXPORT void AddConcreteSupportedKeySystem( | |
39 const std::string& key_system, | |
40 #if defined(ENABLE_PEPPER_CDMS) | |
41 const std::string& pepper_type, | |
42 #elif defined(OS_ANDROID) | |
43 const uint8 uuid[16], | |
44 #endif // defined(ENABLE_PEPPER_CDMS) | |
45 bool use_aes_decryptor); | |
scherkus (not reviewing)
2013/08/27 17:20:37
what's this thing for?
ddorwin
2013/08/27 18:02:49
It's used to answer to CanUseAesDecryptor(). We co
| |
46 | |
47 // Adds a mapping from a |parent key system| to a |concrete_key_system|, which | |
48 // can be used for determining supported types. | |
49 CONTENT_EXPORT void AddParentKeySystem(const std::string& parent_key_system, | |
50 const std::string& concrete_key_system); | |
51 | |
52 // Specifies the container and codec combinations supported by |key_system|. | |
53 // Multiple codecs can be listed. In all cases, the container | |
54 // without a codec is also supported. | |
55 // |key_system| must be a concrete supported key system. | |
56 CONTENT_EXPORT void AddSupportedType(const std::string& key_system, | |
57 const std::string& mime_type, | |
58 const std::string& codecs_list); | |
59 | |
35 // Returns whether |key_system| is a real supported key system that can be | 60 // Returns whether |key_system| is a real supported key system that can be |
36 // instantiated. | 61 // instantiated. |
37 // Abstract parent |key_system| strings will return false. | 62 // Abstract parent |key_system| strings will return false. |
38 // Call IsSupportedKeySystemWithMediaMimeType() to determine whether a | 63 // Call IsSupportedKeySystemWithMediaMimeType() to determine whether a |
39 // |key_system| supports a specific type of media or to check parent key | 64 // |key_system| supports a specific type of media or to check parent key |
40 // systems. | 65 // systems. |
41 CONTENT_EXPORT bool IsConcreteSupportedKeySystem( | 66 CONTENT_EXPORT bool IsConcreteSupportedKeySystem( |
42 const WebKit::WebString& key_system); | 67 const WebKit::WebString& key_system); |
43 | 68 |
44 // Returns whether |key_sytem| supports the specified media type and codec(s). | 69 // Returns whether |key_sytem| supports the specified media type and codec(s). |
45 CONTENT_EXPORT bool IsSupportedKeySystemWithMediaMimeType( | 70 CONTENT_EXPORT bool IsSupportedKeySystemWithMediaMimeType( |
46 const std::string& mime_type, | 71 const std::string& mime_type, |
47 const std::vector<std::string>& codecs, | 72 const std::vector<std::string>& codecs, |
48 const std::string& key_system); | 73 const std::string& key_system); |
49 | 74 |
50 // Returns a name for |key_system| suitable to UMA logging. | 75 // Returns a name for |key_system| suitable to UMA logging. |
51 CONTENT_EXPORT std::string KeySystemNameForUMA( | 76 CONTENT_EXPORT std::string KeySystemNameForUMA( |
52 const WebKit::WebString& key_system); | 77 const WebKit::WebString& key_system); |
53 | 78 |
54 // Returns whether AesDecryptor can be used for the given |key_system|. | 79 // Returns whether AesDecryptor can be used for the given |key_system|. |
55 CONTENT_EXPORT bool CanUseAesDecryptor(const std::string& key_system); | 80 CONTENT_EXPORT bool CanUseAesDecryptor(const std::string& concrete_key_system); |
56 | 81 |
57 #if defined(ENABLE_PEPPER_CDMS) | 82 #if defined(ENABLE_PEPPER_CDMS) |
58 // Returns the Pepper MIME type for |concrete_key_system|. | 83 // Returns the Pepper MIME type for |concrete_key_system|. |
59 // Returns empty string if |concrete_key_system| is unknown or not Pepper-based. | 84 // Returns empty string if |concrete_key_system| is unknown or not Pepper-based. |
60 CONTENT_EXPORT std::string GetPepperType( | 85 CONTENT_EXPORT std::string GetPepperType( |
61 const std::string& concrete_key_system); | 86 const std::string& concrete_key_system); |
62 #endif | 87 #endif |
63 | 88 |
64 #if defined(OS_ANDROID) | 89 #if defined(OS_ANDROID) |
65 // Convert |concrete_key_system| to 16-byte Android UUID. | 90 // Convert |concrete_key_system| to 16-byte Android UUID. |
66 CONTENT_EXPORT std::vector<uint8> GetUUID( | 91 CONTENT_EXPORT std::vector<uint8> GetUUID( |
67 const std::string& concrete_key_system); | 92 const std::string& concrete_key_system); |
68 #endif | 93 #endif |
69 | 94 |
70 } // namespace content | 95 } // namespace content |
71 | 96 |
72 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ | 97 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ |
OLD | NEW |