OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EME_CONSTANTS_H_ | 5 #ifndef MEDIA_BASE_EME_CONSTANTS_H_ |
6 #define MEDIA_BASE_EME_CONSTANTS_H_ | 6 #define MEDIA_BASE_EME_CONSTANTS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 }; | 48 }; |
49 | 49 |
50 typedef uint32_t SupportedInitDataTypes; | 50 typedef uint32_t SupportedInitDataTypes; |
51 typedef uint32_t SupportedCodecs; | 51 typedef uint32_t SupportedCodecs; |
52 | 52 |
53 enum EmeSessionTypeSupport { | 53 enum EmeSessionTypeSupport { |
54 // Invalid default value. | 54 // Invalid default value. |
55 EME_SESSION_TYPE_INVALID, | 55 EME_SESSION_TYPE_INVALID, |
56 // The session type is not supported. | 56 // The session type is not supported. |
57 EME_SESSION_TYPE_NOT_SUPPORTED, | 57 EME_SESSION_TYPE_NOT_SUPPORTED, |
58 // The session type is supported if the encrypted media permission is granted. | 58 // The session type is supported if a distinctive identifier is available. |
59 EME_SESSION_TYPE_SUPPORTED_WITH_PERMISSION, | 59 EME_SESSION_TYPE_SUPPORTED_WITH_IDENTIFIER, |
60 // The session type is always supported. | 60 // The session type is always supported. |
61 EME_SESSION_TYPE_SUPPORTED, | 61 EME_SESSION_TYPE_SUPPORTED, |
62 }; | 62 }; |
63 | 63 |
| 64 // Used to declare support for distinctive identifier and persistent state. |
64 enum EmeFeatureSupport { | 65 enum EmeFeatureSupport { |
65 // Invalid default value. | 66 // Invalid default value. |
66 EME_FEATURE_INVALID, | 67 EME_FEATURE_INVALID, |
67 // Access to the feature is not supported at all. | 68 // Access to the feature is not supported at all. |
68 EME_FEATURE_NOT_SUPPORTED, | 69 EME_FEATURE_NOT_SUPPORTED, |
69 // Access to the feature may be requested if the encrypted media permission is | 70 // Access to the feature may be requested if a distinctive identifier is |
70 // granted. | 71 // available. (This is the correct choice for declaring support for a |
71 EME_FEATURE_REQUESTABLE_WITH_PERMISSION, | 72 // requestable distinctive identifier.) |
| 73 EME_FEATURE_REQUESTABLE_WITH_IDENTIFIER, |
72 // Access to the feature may be requested. | 74 // Access to the feature may be requested. |
73 EME_FEATURE_REQUESTABLE, | 75 EME_FEATURE_REQUESTABLE, |
74 // Access to the feature cannot be blocked. | 76 // Access to the feature cannot be blocked. |
75 EME_FEATURE_ALWAYS_ENABLED, | 77 EME_FEATURE_ALWAYS_ENABLED, |
76 }; | 78 }; |
77 | 79 |
| 80 // Used to query support for distinctive identifier and persistent state. |
78 enum EmeFeatureRequirement { | 81 enum EmeFeatureRequirement { |
79 EME_FEATURE_NOT_ALLOWED, | 82 EME_FEATURE_NOT_ALLOWED, |
80 EME_FEATURE_OPTIONAL, | 83 EME_FEATURE_OPTIONAL, |
81 EME_FEATURE_REQUIRED, | 84 EME_FEATURE_REQUIRED, |
82 }; | 85 }; |
83 | 86 |
| 87 enum class EmeMediaType { |
| 88 AUDIO, |
| 89 VIDEO, |
| 90 }; |
| 91 |
| 92 // Robustness values understood by KeySystems. |
| 93 // Note: KeySystems expects this ordering (in GetRobustnessConfigRule()), |
| 94 // changes may be required there if this list changes. |
| 95 enum class EmeRobustness { |
| 96 INVALID, |
| 97 EMPTY, |
| 98 SW_SECURE_CRYPTO, |
| 99 SW_SECURE_DECODE, |
| 100 HW_SECURE_CRYPTO, |
| 101 HW_SECURE_DECODE, |
| 102 HW_SECURE_ALL, |
| 103 }; |
| 104 |
| 105 // Configuration rules indicate the configuration state required to support a |
| 106 // configuration option (note: a configuration option may be disallowing a |
| 107 // feature). Configuration rules are used to answer queries about distinctive |
| 108 // identifier, persistent state, and robustness requirements, as well as to |
| 109 // describe support for different session types. |
| 110 // |
| 111 // If in the future there are reasons to request user permission other than |
| 112 // access to a distinctive identifier, then additional rules should be added. |
| 113 // Rules are implemented in ConfigState and are otherwise opaque. |
| 114 enum class EmeConfigRule { |
| 115 // The configuration option is not supported. |
| 116 NOT_SUPPORTED, |
| 117 // The configuration option is supported if a distinctive identifier is |
| 118 // available. |
| 119 IDENTIFIER_REQUIRED, |
| 120 // The configuration option is supported, but the user experience may be |
| 121 // improved if a distinctive identifier is available. |
| 122 IDENTIFIER_RECOMMENDED, |
| 123 // The configuration option is supported without conditions. |
| 124 SUPPORTED, |
| 125 }; |
| 126 |
84 } // namespace media | 127 } // namespace media |
85 | 128 |
86 #endif // MEDIA_BASE_EME_CONSTANTS_H_ | 129 #endif // MEDIA_BASE_EME_CONSTANTS_H_ |
OLD | NEW |