| 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 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 // Chromecast defines behaviors for Cast clients within its reverse domain. | 163 // Chromecast defines behaviors for Cast clients within its reverse domain. |
| 164 const char kChromecastRoot[] = "com.chromecast"; | 164 const char kChromecastRoot[] = "com.chromecast"; |
| 165 if (IsChildKeySystemOf(key_system, kChromecastRoot)) | 165 if (IsChildKeySystemOf(key_system, kChromecastRoot)) |
| 166 return true; | 166 return true; |
| 167 | 167 |
| 168 // Implementations that do not have a specification or appropriate glue code | 168 // Implementations that do not have a specification or appropriate glue code |
| 169 // can use the "x-" prefix to avoid conflicting with and advertising support | 169 // can use the "x-" prefix to avoid conflicting with and advertising support |
| 170 // for real key system names. Use is discouraged. | 170 // for real key system names. Use is discouraged. |
| 171 const char kExcludedPrefix[] = "x-"; | 171 const char kExcludedPrefix[] = "x-"; |
| 172 if (key_system.find(kExcludedPrefix, 0, arraysize(kExcludedPrefix) - 1) == 0) | 172 return base::StartsWith(key_system, kExcludedPrefix, |
| 173 return true; | 173 base::CompareCase::SENSITIVE); |
| 174 | |
| 175 return false; | |
| 176 } | 174 } |
| 177 | 175 |
| 178 class KeySystemsImpl : public KeySystems { | 176 class KeySystemsImpl : public KeySystems { |
| 179 public: | 177 public: |
| 180 static KeySystemsImpl* GetInstance(); | 178 static KeySystemsImpl* GetInstance(); |
| 181 | 179 |
| 182 void UpdateIfNeeded(); | 180 void UpdateIfNeeded(); |
| 183 | 181 |
| 184 std::string GetKeySystemNameForUMA(const std::string& key_system) const; | 182 std::string GetKeySystemNameForUMA(const std::string& key_system) const; |
| 185 | 183 |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 uint32_t mask) { | 727 uint32_t mask) { |
| 730 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); | 728 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); |
| 731 } | 729 } |
| 732 | 730 |
| 733 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, | 731 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, |
| 734 uint32_t mask) { | 732 uint32_t mask) { |
| 735 KeySystemsImpl::GetInstance()->AddMimeTypeCodecMask(mime_type, mask); | 733 KeySystemsImpl::GetInstance()->AddMimeTypeCodecMask(mime_type, mask); |
| 736 } | 734 } |
| 737 | 735 |
| 738 } // namespace media | 736 } // namespace media |
| OLD | NEW |