| 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_PUBLIC_RENDERER_KEY_SYSTEM_INFO_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_KEY_SYSTEM_INFO_H_ |
| 6 #define CONTENT_PUBLIC_RENDERER_KEY_SYSTEM_INFO_H_ | 6 #define CONTENT_PUBLIC_RENDERER_KEY_SYSTEM_INFO_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "media/cdm/encrypted_media_codecs.h" |
| 14 | 15 |
| 15 // Definitions: | 16 // Definitions: |
| 16 // * Key system | 17 // * Key system |
| 17 // https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypt
ed-media.html#key-system | 18 // https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypt
ed-media.html#key-system |
| 18 // * Concrete key system | 19 // * Concrete key system |
| 19 // A key system string that can be instantiated, such as | 20 // A key system string that can be instantiated, such as |
| 20 // via the MediaKeys constructor. Examples include "org.w3.clearkey" and | 21 // via the MediaKeys constructor. Examples include "org.w3.clearkey" and |
| 21 // "com.widevine.alpha". | 22 // "com.widevine.alpha". |
| 22 // * Abstract key system | 23 // * Abstract key system |
| 23 // A key system string that cannot be instantiated like a concrete key system | 24 // A key system string that cannot be instantiated like a concrete key system |
| 24 // but is otherwise useful, such as in discovery using isTypeSupported(). | 25 // but is otherwise useful, such as in discovery using isTypeSupported(). |
| 25 // * Parent key system | 26 // * Parent key system |
| 26 // A key system string that is one level up from the child key system. It may | 27 // A key system string that is one level up from the child key system. It may |
| 27 // be an abstract key system. | 28 // be an abstract key system. |
| 28 // As an example, "com.example" is the parent of "com.example.foo". | 29 // As an example, "com.example" is the parent of "com.example.foo". |
| 29 | 30 |
| 30 namespace content { | 31 namespace content { |
| 31 | 32 |
| 32 // Contains information about an EME key system as well as how to instantiate | 33 // Contains information about an EME key system as well as how to instantiate |
| 33 // the corresponding CDM. | 34 // the corresponding CDM. |
| 34 struct CONTENT_EXPORT KeySystemInfo { | 35 struct CONTENT_EXPORT KeySystemInfo { |
| 35 // Represents the set of codecs supported within a container. | |
| 36 typedef base::hash_set<std::string> CodecSet; | |
| 37 | |
| 38 // Represents container-codec combinations. The CodecSet may contain zero | |
| 39 // or more codecs. | |
| 40 typedef std::map<std::string, CodecSet> ContainerCodecsMap; | |
| 41 | |
| 42 explicit KeySystemInfo(const std::string& key_system); | 36 explicit KeySystemInfo(const std::string& key_system); |
| 43 ~KeySystemInfo(); | 37 ~KeySystemInfo(); |
| 44 | 38 |
| 45 std::string key_system; | 39 std::string key_system; |
| 46 | 40 |
| 47 // Specifies container and codec combinations supported by |key_system|. | 41 // Specifies codecs supported by |key_system|. |
| 48 // Multiple codecs may be listed for each container. | 42 media::SupportedCodecs supported_codecs; |
| 49 // In all cases, the container without a codec is also always supported. | |
| 50 ContainerCodecsMap supported_types; | |
| 51 | 43 |
| 52 // A hierarchical parent for |key_system|. This value can be used to check | 44 // A hierarchical parent for |key_system|. This value can be used to check |
| 53 // supported types but cannot be used to instantiate a MediaKeys object. | 45 // supported types but cannot be used to instantiate a MediaKeys object. |
| 54 // Only one parent key system is currently supported per concrete key system. | 46 // Only one parent key system is currently supported per concrete key system. |
| 55 std::string parent_key_system; | 47 std::string parent_key_system; |
| 56 | 48 |
| 57 // The following indicate how the corresponding CDM should be instantiated. | 49 // The following indicate how the corresponding CDM should be instantiated. |
| 58 bool use_aes_decryptor; | 50 bool use_aes_decryptor; |
| 59 #if defined(ENABLE_PEPPER_CDMS) | 51 #if defined(ENABLE_PEPPER_CDMS) |
| 60 std::string pepper_type; | 52 std::string pepper_type; |
| 61 #endif | 53 #endif |
| 62 }; | 54 }; |
| 63 | 55 |
| 64 } // namespace content | 56 } // namespace content |
| 65 | 57 |
| 66 #endif // CONTENT_PUBLIC_RENDERER_KEY_SYSTEM_INFO_H_ | 58 #endif // CONTENT_PUBLIC_RENDERER_KEY_SYSTEM_INFO_H_ |
| OLD | NEW |