| 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 #include "media/base/key_systems.h" | 5 #include "media/base/key_systems.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
| 12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "media/base/key_system_info.h" | 19 #include "media/base/key_system_info.h" |
| 20 #include "media/base/key_system_names.h" |
| 20 #include "media/base/key_system_properties.h" | 21 #include "media/base/key_system_properties.h" |
| 21 #include "media/base/media.h" | 22 #include "media/base/media.h" |
| 22 #include "media/base/media_client.h" | 23 #include "media/base/media_client.h" |
| 23 #include "media/cdm/key_system_names.h" | |
| 24 #include "media/media_features.h" | 24 #include "media/media_features.h" |
| 25 #include "third_party/widevine/cdm/widevine_cdm_common.h" | 25 #include "third_party/widevine/cdm/widevine_cdm_common.h" |
| 26 | 26 |
| 27 namespace media { | 27 namespace media { |
| 28 | 28 |
| 29 const char kClearKeyKeySystem[] = "org.w3.clearkey"; | 29 const char kClearKeyKeySystem[] = "org.w3.clearkey"; |
| 30 | 30 |
| 31 // These names are used by UMA. Do not change them! | 31 // These names are used by UMA. Do not change them! |
| 32 const char kClearKeyKeySystemNameForUMA[] = "ClearKey"; | 32 const char kClearKeyKeySystemNameForUMA[] = "ClearKey"; |
| 33 const char kUnknownKeySystemNameForUMA[] = "Unknown"; | 33 const char kUnknownKeySystemNameForUMA[] = "Unknown"; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // these key systems. | 162 // these key systems. |
| 163 // | 163 // |
| 164 // If you need to add support for other key systems, ensure that you have | 164 // If you need to add support for other key systems, ensure that you have |
| 165 // obtained the specification for how to integrate it with EME, implemented the | 165 // obtained the specification for how to integrate it with EME, implemented the |
| 166 // appropriate glue/adapter code, and added all the appropriate data to | 166 // appropriate glue/adapter code, and added all the appropriate data to |
| 167 // KeySystemsImpl. Only then should you change this function. | 167 // KeySystemsImpl. Only then should you change this function. |
| 168 static bool IsPotentiallySupportedKeySystem(const std::string& key_system) { | 168 static bool IsPotentiallySupportedKeySystem(const std::string& key_system) { |
| 169 // Known and supported key systems. | 169 // Known and supported key systems. |
| 170 if (key_system == kWidevineKeySystem) | 170 if (key_system == kWidevineKeySystem) |
| 171 return true; | 171 return true; |
| 172 if (key_system == kClearKey) | 172 if (key_system == kClearKeyKeySystem) |
| 173 return true; | 173 return true; |
| 174 | 174 |
| 175 // External Clear Key is known and supports suffixes for testing. | 175 // External Clear Key is known and supports suffixes for testing. |
| 176 if (IsExternalClearKey(key_system)) | 176 if (IsExternalClearKey(key_system)) |
| 177 return true; | 177 return true; |
| 178 | 178 |
| 179 // Chromecast defines behaviors for Cast clients within its reverse domain. | 179 // Chromecast defines behaviors for Cast clients within its reverse domain. |
| 180 const char kChromecastRoot[] = "com.chromecast"; | 180 const char kChromecastRoot[] = "com.chromecast"; |
| 181 if (IsChildKeySystemOf(key_system, kChromecastRoot)) | 181 if (IsChildKeySystemOf(key_system, kChromecastRoot)) |
| 182 return true; | 182 return true; |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 uint32_t mask) { | 875 uint32_t mask) { |
| 876 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); | 876 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); |
| 877 } | 877 } |
| 878 | 878 |
| 879 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, | 879 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, |
| 880 uint32_t mask) { | 880 uint32_t mask) { |
| 881 KeySystemsImpl::GetInstance()->AddMimeTypeCodecMask(mime_type, mask); | 881 KeySystemsImpl::GetInstance()->AddMimeTypeCodecMask(mime_type, mask); |
| 882 } | 882 } |
| 883 | 883 |
| 884 } // namespace media | 884 } // namespace media |
| OLD | NEW |