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 MEDIA_BASE_KEY_SYSTEMS_H_ | 5 #ifndef MEDIA_BASE_KEY_SYSTEMS_H_ |
6 #define MEDIA_BASE_KEY_SYSTEMS_H_ | 6 #define MEDIA_BASE_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 "media/base/eme_constants.h" | 12 #include "media/base/eme_constants.h" |
13 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
14 | 14 |
15 namespace media { | 15 namespace media { |
16 | 16 |
17 // Prefixed EME API only supports prefixed (webkit-) key system name for | 17 // Prefixed EME API only supports prefixed (webkit-) key system name for |
18 // certain key systems. But internally only unprefixed key systems are | 18 // certain key systems. But internally only unprefixed key systems are |
19 // supported. The following two functions help convert between prefixed and | 19 // supported. The following two functions help convert between prefixed and |
20 // unprefixed key system names. | 20 // unprefixed key system names. |
21 | 21 |
22 // Gets the unprefixed key system name for |key_system|. | 22 // Gets the unprefixed key system name for |key_system|. |
23 MEDIA_EXPORT std::string GetUnprefixedKeySystemName( | 23 MEDIA_EXPORT std::string GetUnprefixedKeySystemName( |
24 const std::string& key_system); | 24 const std::string& key_system); |
25 | 25 |
26 // Gets the prefixed key system name for |key_system|. | 26 // Gets the prefixed key system name for |key_system|. |
27 MEDIA_EXPORT std::string GetPrefixedKeySystemName( | 27 MEDIA_EXPORT std::string GetPrefixedKeySystemName( |
28 const std::string& key_system); | 28 const std::string& key_system); |
29 | 29 |
30 // Returns false if a container-specific |init_data_type| is specified with an | |
31 // inappropriate container. | |
32 // TODO(sandersd): Remove this essentially internal detail if the spec is | |
33 // updated to not convolve the two in a single method call. | |
34 // TODO(sandersd): Use enum values instead of strings. http://crbug.com/417440 | |
35 MEDIA_EXPORT bool IsSaneInitDataTypeWithContainer( | |
36 const std::string& init_data_type, | |
37 const std::string& container); | |
38 | |
39 // Use for unprefixed EME only! | 30 // Use for unprefixed EME only! |
40 // Returns whether |key_system| is a supported key system. | 31 // Returns whether |key_system| is a supported key system. |
41 // Note: Shouldn't be used for prefixed API as the original | 32 // Note: Shouldn't be used for prefixed API as the original |
42 // IsSupportedKeySystemWithMediaMimeType() path reports UMAs, but this path does | 33 // IsSupportedKeySystemWithMediaMimeType() path reports UMAs, but this path does |
43 // not. | 34 // not. |
44 MEDIA_EXPORT bool IsSupportedKeySystem(const std::string& key_system); | 35 MEDIA_EXPORT bool IsSupportedKeySystem(const std::string& key_system); |
45 | 36 |
46 MEDIA_EXPORT bool IsSupportedKeySystemWithInitDataType( | 37 MEDIA_EXPORT bool IsSupportedKeySystemWithInitDataType( |
47 const std::string& key_system, | 38 const std::string& key_system, |
48 const std::string& init_data_type); | 39 const std::string& init_data_type); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 105 |
115 #if defined(UNIT_TEST) | 106 #if defined(UNIT_TEST) |
116 // Helper functions to add container/codec types for testing purposes. | 107 // Helper functions to add container/codec types for testing purposes. |
117 MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask); | 108 MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask); |
118 MEDIA_EXPORT void AddCodecMask(const std::string& codec, uint32 mask); | 109 MEDIA_EXPORT void AddCodecMask(const std::string& codec, uint32 mask); |
119 #endif // defined(UNIT_TEST) | 110 #endif // defined(UNIT_TEST) |
120 | 111 |
121 } // namespace media | 112 } // namespace media |
122 | 113 |
123 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ | 114 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ |
OLD | NEW |