Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: media/base/eme_constants.h

Issue 1027363002: Change EmeInitDataType to be an enum class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/media/cdm/browser_cdm_manager.cc ('k') | media/base/key_system_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // The mask values are stored in a SupportedInitDataTypes. 14 // http://w3c.github.io/encrypted-media/initdata-format-registry.html#registry
15 enum EmeInitDataType { 15 // The mask values are stored in a InitDataTypeMask.
16 EME_INIT_DATA_TYPE_NONE = 0, 16 enum class EmeInitDataType {
17 EME_INIT_DATA_TYPE_WEBM = 1 << 0, 17 UNKNOWN,
18 #if defined(USE_PROPRIETARY_CODECS) 18 WEBM,
19 EME_INIT_DATA_TYPE_CENC = 1 << 1, 19 CENC,
20 #endif // defined(USE_PROPRIETARY_CODECS) 20 KEYIDS
21 EME_INIT_DATA_TYPE_KEYIDS = 1 << 2,
22 }; 21 };
23 22
23 typedef uint32_t InitDataTypeMask;
24 const InitDataTypeMask kInitDataTypeMaskNone = 0;
25 const InitDataTypeMask kInitDataTypeMaskWebM = 1 << 0;
26 const InitDataTypeMask kInitDataTypeMaskCenc = 1 << 1;
27 const InitDataTypeMask kInitDataTypeMaskKeyIds = 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 a distinctive identifier is available. 62 // The session type is supported if a distinctive identifier is available.
59 EME_SESSION_TYPE_SUPPORTED_WITH_IDENTIFIER, 63 EME_SESSION_TYPE_SUPPORTED_WITH_IDENTIFIER,
60 // The session type is always supported. 64 // The session type is always supported.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // The configuration option is supported, but the user experience may be 124 // The configuration option is supported, but the user experience may be
121 // improved if a distinctive identifier is available. 125 // improved if a distinctive identifier is available.
122 IDENTIFIER_RECOMMENDED, 126 IDENTIFIER_RECOMMENDED,
123 // The configuration option is supported without conditions. 127 // The configuration option is supported without conditions.
124 SUPPORTED, 128 SUPPORTED,
125 }; 129 };
126 130
127 } // namespace media 131 } // namespace media
128 132
129 #endif // MEDIA_BASE_EME_CONSTANTS_H_ 133 #endif // MEDIA_BASE_EME_CONSTANTS_H_
OLDNEW
« no previous file with comments | « content/browser/media/cdm/browser_cdm_manager.cc ('k') | media/base/key_system_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698