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 <map> | 5 #include <map> |
6 | 6 |
7 #include "webkit/renderer/media/crypto/key_systems.h" | 7 #include "webkit/renderer/media/crypto/key_systems.h" |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 return false; | 105 return false; |
106 | 106 |
107 const CodecMappings& codecs = mime_iter->second; | 107 const CodecMappings& codecs = mime_iter->second; |
108 return (codecs.find(codec) != codecs.end()) && IsSystemCompatible(key_system); | 108 return (codecs.find(codec) != codecs.end()) && IsSystemCompatible(key_system); |
109 } | 109 } |
110 | 110 |
111 bool KeySystems::IsSupportedKeySystemWithMediaMimeType( | 111 bool KeySystems::IsSupportedKeySystemWithMediaMimeType( |
112 const std::string& mime_type, | 112 const std::string& mime_type, |
113 const std::vector<std::string>& codecs, | 113 const std::vector<std::string>& codecs, |
114 const std::string& key_system) { | 114 const std::string& key_system) { |
| 115 // This method is only used by the canPlaytType() path (not the EME methods), |
| 116 // so we check for suppressed key_systems here. |
| 117 if(IsCanPlayTypeSuppressed(key_system)) |
| 118 return false; |
| 119 |
115 if (codecs.empty()) | 120 if (codecs.empty()) |
116 return IsSupportedKeySystemWithContainerAndCodec( | 121 return IsSupportedKeySystemWithContainerAndCodec( |
117 mime_type, std::string(), key_system); | 122 mime_type, std::string(), key_system); |
118 | 123 |
119 for (size_t i = 0; i < codecs.size(); ++i) { | 124 for (size_t i = 0; i < codecs.size(); ++i) { |
120 if (!IsSupportedKeySystemWithContainerAndCodec( | 125 if (!IsSupportedKeySystemWithContainerAndCodec( |
121 mime_type, codecs[i], key_system)) | 126 mime_type, codecs[i], key_system)) |
122 return false; | 127 return false; |
123 } | 128 } |
124 | 129 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 for (int i = 0; i < kNumKeySystemToUUIDMapping; ++i) { | 170 for (int i = 0; i < kNumKeySystemToUUIDMapping; ++i) { |
166 if (kKeySystemToUUIDMapping[i].key_system == key_system) | 171 if (kKeySystemToUUIDMapping[i].key_system == key_system) |
167 return std::vector<uint8>(kKeySystemToUUIDMapping[i].uuid, | 172 return std::vector<uint8>(kKeySystemToUUIDMapping[i].uuid, |
168 kKeySystemToUUIDMapping[i].uuid + 16); | 173 kKeySystemToUUIDMapping[i].uuid + 16); |
169 } | 174 } |
170 return std::vector<uint8>(); | 175 return std::vector<uint8>(); |
171 } | 176 } |
172 #endif // defined(OS_ANDROID) | 177 #endif // defined(OS_ANDROID) |
173 | 178 |
174 } // namespace webkit_media | 179 } // namespace webkit_media |
OLD | NEW |