Chromium Code Reviews| 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_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ | 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_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 "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 // Prefixed EME API only supports prefixed (webkit-) key system name for | 16 // Prefixed EME API only supports prefixed (webkit-) key system name for |
| 17 // certain key systems. But internally only unprefixed key systems are | 17 // certain key systems. But internally only unprefixed key systems are |
| 18 // supported. The following two functions help convert between prefixed and | 18 // supported. The following two functions help convert between prefixed and |
| 19 // unprefixed key system names. | 19 // unprefixed key system names. |
| 20 | 20 |
| 21 // Gets the unprefixed key system name for |key_system|. | 21 // Gets the unprefixed key system name for |key_system|. |
| 22 std::string GetUnprefixedKeySystemName(const std::string& key_system); | 22 std::string GetUnprefixedKeySystemName(const std::string& key_system); |
| 23 | 23 |
| 24 // Gets the prefixed key system name for |key_system|. | 24 // Gets the prefixed key system name for |key_system|. |
| 25 std::string GetPrefixedKeySystemName(const std::string& key_system); | 25 std::string GetPrefixedKeySystemName(const std::string& key_system); |
| 26 | 26 |
| 27 bool IsSaneInitDataTypeWithContainer( | |
|
ddorwin
2014/09/23 22:48:17
This is really an implementation detail of this cl
ddorwin
2014/09/23 22:48:17
This probably deserves a comment:
// Returns false
sandersd (OOO until July 31)
2014/09/24 22:22:34
Done.
sandersd (OOO until July 31)
2014/09/24 22:22:34
Acknowledged.
| |
| 28 const std::string& init_data_type, | |
|
ddorwin
2014/09/23 22:48:17
I was thinking we should convert IDT (and maybe co
sandersd (OOO until July 31)
2014/09/24 22:22:34
This makes sense; we could add APIs here to turn t
ddorwin
2014/09/27 00:41:24
Even better, the strings should never reach Chromi
| |
| 29 const std::string& container); | |
| 30 | |
| 31 bool IsSupportedKeySystem(const std::string& key_system); | |
| 32 | |
| 33 bool IsSupportedKeySystemWithInitDataType( | |
| 34 const std::string& key_system, | |
| 35 const std::string& init_data_type); | |
| 36 | |
| 27 // Returns whether |key_system| is a real supported key system that can be | 37 // Returns whether |key_system| is a real supported key system that can be |
| 28 // instantiated. | 38 // instantiated. |
| 29 // Abstract parent |key_system| strings will return false. | 39 // Abstract parent |key_system| strings will return false. |
| 30 // Call IsSupportedKeySystemWithMediaMimeType() to determine whether a | 40 // Call IsSupportedKeySystemWithMediaMimeType() to determine whether a |
| 31 // |key_system| supports a specific type of media or to check parent key | 41 // |key_system| supports a specific type of media or to check parent key |
| 32 // systems. | 42 // systems. |
| 33 CONTENT_EXPORT bool IsConcreteSupportedKeySystem(const std::string& key_system); | 43 CONTENT_EXPORT bool IsConcreteSupportedKeySystem(const std::string& key_system); |
| 34 | 44 |
| 35 // Returns whether |key_sytem| supports the specified media type and codec(s). | 45 // Returns whether |key_sytem| supports the specified media type and codec(s). |
| 36 CONTENT_EXPORT bool IsSupportedKeySystemWithMediaMimeType( | 46 CONTENT_EXPORT bool IsSupportedKeySystemWithMediaMimeType( |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 53 | 63 |
| 54 #if defined(UNIT_TEST) | 64 #if defined(UNIT_TEST) |
| 55 // Helper functions to add container/codec types for testing purposes. | 65 // Helper functions to add container/codec types for testing purposes. |
| 56 CONTENT_EXPORT void AddContainerMask(const std::string& container, uint32 mask); | 66 CONTENT_EXPORT void AddContainerMask(const std::string& container, uint32 mask); |
| 57 CONTENT_EXPORT void AddCodecMask(const std::string& codec, uint32 mask); | 67 CONTENT_EXPORT void AddCodecMask(const std::string& codec, uint32 mask); |
| 58 #endif // defined(UNIT_TEST) | 68 #endif // defined(UNIT_TEST) |
| 59 | 69 |
| 60 } // namespace content | 70 } // namespace content |
| 61 | 71 |
| 62 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ | 72 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_H_ |
| OLD | NEW |