Chromium Code Reviews| 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 { |
| 11 | 11 |
| 12 // Defines bitmask values that specify registered initialization data types used | 12 // Defines values that specify registered Initialization Data Types used |
| 13 // in Encrypted Media Extensions (EME). | 13 // in Encrypted Media Extensions (EME). |
| 14 // http://w3c.github.io/encrypted-media/initdata-format-registry.html#registry | |
| 14 // The mask values are stored in a SupportedInitDataTypes. | 15 // The mask values are stored in a SupportedInitDataTypes. |
| 15 enum EmeInitDataType { | 16 enum class EmeInitDataType { |
| 16 EME_INIT_DATA_TYPE_NONE = 0, | 17 NONE, |
|
sandersd (OOO until July 31)
2015/03/23 21:27:30
Remove NONE.
I see that it's used in two places,
jrummell
2015/03/25 21:44:25
Until everything is converted to an enum, I think
| |
| 17 EME_INIT_DATA_TYPE_WEBM = 1 << 0, | 18 WEBM, |
| 18 #if defined(USE_PROPRIETARY_CODECS) | 19 CENC, |
| 19 EME_INIT_DATA_TYPE_CENC = 1 << 1, | 20 KEYIDS |
| 20 #endif // defined(USE_PROPRIETARY_CODECS) | |
| 21 EME_INIT_DATA_TYPE_KEYIDS = 1 << 2, | |
| 22 }; | 21 }; |
| 23 | 22 |
| 23 typedef uint32_t SupportedInitDataTypes; | |
|
sandersd (OOO until July 31)
2015/03/23 21:27:30
InitDataTypeMask
jrummell
2015/03/25 21:44:25
Done.
| |
| 24 const SupportedInitDataTypes kSupportedInitDataTypeNone = 0; | |
| 25 const SupportedInitDataTypes kSupportedInitDataTypeWebM = 1 << 0; | |
| 26 const SupportedInitDataTypes kSupportedInitDataTypeCenc = 1 << 1; | |
| 27 const SupportedInitDataTypes kSupportedInitDataTypeKeyIds = 1 << 2; | |
| 28 | |
| 24 // Defines bitmask values that specify codecs used in Encrypted Media Extension | 29 // Defines bitmask values that specify codecs used in Encrypted Media Extension |
| 25 // (EME). Each value represents a codec within a specific container. | 30 // (EME). Each value represents a codec within a specific container. |
| 26 // The mask values are stored in a SupportedCodecs. | 31 // The mask values are stored in a SupportedCodecs. |
| 27 enum EmeCodec { | 32 enum EmeCodec { |
| 28 // *_ALL values should only be used for masking, do not use them to specify | 33 // *_ALL values should only be used for masking, do not use them to specify |
| 29 // codec support because they may be extended to include more codecs. | 34 // codec support because they may be extended to include more codecs. |
| 30 EME_CODEC_NONE = 0, | 35 EME_CODEC_NONE = 0, |
| 31 EME_CODEC_WEBM_OPUS = 1 << 0, | 36 EME_CODEC_WEBM_OPUS = 1 << 0, |
| 32 EME_CODEC_WEBM_VORBIS = 1 << 1, | 37 EME_CODEC_WEBM_VORBIS = 1 << 1, |
| 33 EME_CODEC_WEBM_AUDIO_ALL = EME_CODEC_WEBM_OPUS | EME_CODEC_WEBM_VORBIS, | 38 EME_CODEC_WEBM_AUDIO_ALL = EME_CODEC_WEBM_OPUS | EME_CODEC_WEBM_VORBIS, |
| 34 EME_CODEC_WEBM_VP8 = 1 << 2, | 39 EME_CODEC_WEBM_VP8 = 1 << 2, |
| 35 EME_CODEC_WEBM_VP9 = 1 << 3, | 40 EME_CODEC_WEBM_VP9 = 1 << 3, |
| 36 EME_CODEC_WEBM_VIDEO_ALL = (EME_CODEC_WEBM_VP8 | EME_CODEC_WEBM_VP9), | 41 EME_CODEC_WEBM_VIDEO_ALL = (EME_CODEC_WEBM_VP8 | EME_CODEC_WEBM_VP9), |
| 37 EME_CODEC_WEBM_ALL = (EME_CODEC_WEBM_AUDIO_ALL | EME_CODEC_WEBM_VIDEO_ALL), | 42 EME_CODEC_WEBM_ALL = (EME_CODEC_WEBM_AUDIO_ALL | EME_CODEC_WEBM_VIDEO_ALL), |
| 38 #if defined(USE_PROPRIETARY_CODECS) | 43 #if defined(USE_PROPRIETARY_CODECS) |
| 39 EME_CODEC_MP4_AAC = 1 << 4, | 44 EME_CODEC_MP4_AAC = 1 << 4, |
| 40 EME_CODEC_MP4_AUDIO_ALL = EME_CODEC_MP4_AAC, | 45 EME_CODEC_MP4_AUDIO_ALL = EME_CODEC_MP4_AAC, |
| 41 EME_CODEC_MP4_AVC1 = 1 << 5, | 46 EME_CODEC_MP4_AVC1 = 1 << 5, |
| 42 EME_CODEC_MP4_VIDEO_ALL = EME_CODEC_MP4_AVC1, | 47 EME_CODEC_MP4_VIDEO_ALL = EME_CODEC_MP4_AVC1, |
| 43 EME_CODEC_MP4_ALL = (EME_CODEC_MP4_AUDIO_ALL | EME_CODEC_MP4_VIDEO_ALL), | 48 EME_CODEC_MP4_ALL = (EME_CODEC_MP4_AUDIO_ALL | EME_CODEC_MP4_VIDEO_ALL), |
| 44 EME_CODEC_ALL = (EME_CODEC_WEBM_ALL | EME_CODEC_MP4_ALL), | 49 EME_CODEC_ALL = (EME_CODEC_WEBM_ALL | EME_CODEC_MP4_ALL), |
| 45 #else | 50 #else |
| 46 EME_CODEC_ALL = EME_CODEC_WEBM_ALL, | 51 EME_CODEC_ALL = EME_CODEC_WEBM_ALL, |
| 47 #endif // defined(USE_PROPRIETARY_CODECS) | 52 #endif // defined(USE_PROPRIETARY_CODECS) |
| 48 }; | 53 }; |
| 49 | 54 |
| 50 typedef uint32_t SupportedInitDataTypes; | |
| 51 typedef uint32_t SupportedCodecs; | 55 typedef uint32_t SupportedCodecs; |
| 52 | 56 |
| 53 enum EmeSessionTypeSupport { | 57 enum EmeSessionTypeSupport { |
| 54 // Invalid default value. | 58 // Invalid default value. |
| 55 EME_SESSION_TYPE_INVALID, | 59 EME_SESSION_TYPE_INVALID, |
| 56 // The session type is not supported. | 60 // The session type is not supported. |
| 57 EME_SESSION_TYPE_NOT_SUPPORTED, | 61 EME_SESSION_TYPE_NOT_SUPPORTED, |
| 58 // The session type is supported if the encrypted media permission is granted. | 62 // The session type is supported if the encrypted media permission is granted. |
| 59 EME_SESSION_TYPE_SUPPORTED_WITH_PERMISSION, | 63 EME_SESSION_TYPE_SUPPORTED_WITH_PERMISSION, |
| 60 // The session type is always supported. | 64 // The session type is always supported. |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 77 | 81 |
| 78 enum EmeFeatureRequirement { | 82 enum EmeFeatureRequirement { |
| 79 EME_FEATURE_NOT_ALLOWED, | 83 EME_FEATURE_NOT_ALLOWED, |
| 80 EME_FEATURE_OPTIONAL, | 84 EME_FEATURE_OPTIONAL, |
| 81 EME_FEATURE_REQUIRED, | 85 EME_FEATURE_REQUIRED, |
| 82 }; | 86 }; |
| 83 | 87 |
| 84 } // namespace media | 88 } // namespace media |
| 85 | 89 |
| 86 #endif // MEDIA_BASE_EME_CONSTANTS_H_ | 90 #endif // MEDIA_BASE_EME_CONSTANTS_H_ |
| OLD | NEW |