OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/blink/key_system_config_selector.h" | 5 #include "media/blink/key_system_config_selector.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 EmeMediaType media_type, | 316 EmeMediaType media_type, |
317 const std::string& container_mime_type, | 317 const std::string& container_mime_type, |
318 const std::string& codecs, | 318 const std::string& codecs, |
319 KeySystemConfigSelector::ConfigState* config_state) { | 319 KeySystemConfigSelector::ConfigState* config_state) { |
320 // From RFC6838: "Both top-level type and subtype names are case-insensitive." | 320 // From RFC6838: "Both top-level type and subtype names are case-insensitive." |
321 std::string container_lower = base::ToLowerASCII(container_mime_type); | 321 std::string container_lower = base::ToLowerASCII(container_mime_type); |
322 | 322 |
323 // contentTypes must provide a codec string unless the container implies a | 323 // contentTypes must provide a codec string unless the container implies a |
324 // particular codec. For EME, none of the currently supported containers | 324 // particular codec. For EME, none of the currently supported containers |
325 // imply a codec, so |codecs| must be provided. | 325 // imply a codec, so |codecs| must be provided. |
326 if (codecs.empty()) | 326 if (codecs.empty()) { |
| 327 DVLOG(3) << __func__ << " KeySystemConfig for " << container_mime_type |
| 328 << " does not specify necessary codecs."; |
327 return false; | 329 return false; |
| 330 } |
328 | 331 |
329 // Check that |container_mime_type| and |codecs| are supported by Chrome. This | 332 // Check that |container_mime_type| and |codecs| are supported by Chrome. This |
330 // is done primarily to validate extended codecs, but it also ensures that the | 333 // is done primarily to validate extended codecs, but it also ensures that the |
331 // CDM cannot support codecs that Chrome does not (which could complicate the | 334 // CDM cannot support codecs that Chrome does not (which could complicate the |
332 // robustness algorithm). | 335 // robustness algorithm). |
333 if (!IsSupportedMediaFormat(container_lower, codecs, | 336 if (!IsSupportedMediaFormat(container_lower, codecs, |
334 CanUseAesDecryptor(key_system))) { | 337 CanUseAesDecryptor(key_system))) { |
335 return false; | 338 return false; |
336 } | 339 } |
337 | 340 |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 | 933 |
931 void KeySystemConfigSelector::OnPermissionResult( | 934 void KeySystemConfigSelector::OnPermissionResult( |
932 std::unique_ptr<SelectionRequest> request, | 935 std::unique_ptr<SelectionRequest> request, |
933 bool is_permission_granted) { | 936 bool is_permission_granted) { |
934 request->was_permission_requested = true; | 937 request->was_permission_requested = true; |
935 request->is_permission_granted = is_permission_granted; | 938 request->is_permission_granted = is_permission_granted; |
936 SelectConfigInternal(std::move(request)); | 939 SelectConfigInternal(std::move(request)); |
937 } | 940 } |
938 | 941 |
939 } // namespace media | 942 } // namespace media |
OLD | NEW |