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 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 | 13 |
14 namespace WebKit { | 14 namespace WebKit { |
15 class WebString; | 15 class WebString; |
16 } | 16 } |
17 | 17 |
18 // Definitions: | |
19 // * Key system | |
20 // https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypt
ed-media.html#key-system | |
21 // * Concrete key system | |
22 // A key system string that can be instantiated, such as | |
23 // via the MediaKeys constructor. Examples include "org.w3.clearkey" and | |
24 // "com.widevine.alpha". | |
25 // * Abstract 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(). | |
28 // * Parent key system | |
29 // A key system string that is one level up from the child key system. It may | |
30 // be an abstract key system. | |
31 // As an example, "com.example" is the parent of "com.example.foo". | |
32 | |
33 namespace content { | 18 namespace content { |
34 | 19 |
35 // Adds a concrete key system along with platform-specific information about how | |
36 // to instantiate it. Must be called before AddSupportedType(). | |
37 // May only be called once per |concrete_key_system|. | |
38 // When not empty, |parent_key_system| will add a mapping to the | |
39 // |concrete_key_system| that can be used to check supported types. | |
40 // Only one parent key system is currently supported per concrete key system. | |
41 CONTENT_EXPORT void AddConcreteSupportedKeySystem( | |
42 const std::string& concrete_key_system, | |
43 bool use_aes_decryptor, | |
44 #if defined(ENABLE_PEPPER_CDMS) | |
45 const std::string& pepper_type, | |
46 #elif defined(OS_ANDROID) | |
47 const uint8 uuid[16], | |
48 #endif | |
49 const std::string& parent_key_system); | |
50 | |
51 // Specifies the container and codec combinations supported by | |
52 // |concrete_key_system|. | |
53 // Multiple codecs can be listed. In all cases, the container | |
54 // without a codec is also supported. | |
55 // |concrete_key_system| must be a concrete supported key system previously | |
56 // added using AddConcreteSupportedKeySystem(). | |
57 CONTENT_EXPORT void AddSupportedType(const std::string& concrete_key_system, | |
58 const std::string& mime_type, | |
59 const std::string& codecs_list); | |
60 | |
61 // Returns whether |key_system| is a real supported key system that can be | 20 // Returns whether |key_system| is a real supported key system that can be |
62 // instantiated. | 21 // instantiated. |
63 // Abstract parent |key_system| strings will return false. | 22 // Abstract parent |key_system| strings will return false. |
64 // Call IsSupportedKeySystemWithMediaMimeType() to determine whether a | 23 // Call IsSupportedKeySystemWithMediaMimeType() to determine whether a |
65 // |key_system| supports a specific type of media or to check parent key | 24 // |key_system| supports a specific type of media or to check parent key |
66 // systems. | 25 // systems. |
67 CONTENT_EXPORT bool IsConcreteSupportedKeySystem( | 26 CONTENT_EXPORT bool IsConcreteSupportedKeySystem( |
68 const WebKit::WebString& key_system); | 27 const WebKit::WebString& key_system); |
69 | 28 |
70 // Returns whether |key_sytem| supports the specified media type and codec(s). | 29 // Returns whether |key_sytem| supports the specified media type and codec(s). |
(...skipping 16 matching lines...) Expand all Loading... |
87 const std::string& concrete_key_system); | 46 const std::string& concrete_key_system); |
88 #elif defined(OS_ANDROID) | 47 #elif defined(OS_ANDROID) |
89 // Convert |concrete_key_system| to 16-byte Android UUID. | 48 // Convert |concrete_key_system| to 16-byte Android UUID. |
90 CONTENT_EXPORT std::vector<uint8> GetUUID( | 49 CONTENT_EXPORT std::vector<uint8> GetUUID( |
91 const std::string& concrete_key_system); | 50 const std::string& concrete_key_system); |
92 #endif | 51 #endif |
93 | 52 |
94 } // namespace content | 53 } // namespace content |
95 | 54 |
96 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ | 55 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ |
OLD | NEW |