| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 return (init_data_types & kInitDataTypeMaskWebM) != 0; | 62 return (init_data_types & kInitDataTypeMaskWebM) != 0; |
| 63 case EmeInitDataType::CENC: | 63 case EmeInitDataType::CENC: |
| 64 return (init_data_types & kInitDataTypeMaskCenc) != 0; | 64 return (init_data_types & kInitDataTypeMaskCenc) != 0; |
| 65 case EmeInitDataType::KEYIDS: | 65 case EmeInitDataType::KEYIDS: |
| 66 return (init_data_types & kInitDataTypeMaskKeyIds) != 0; | 66 return (init_data_types & kInitDataTypeMaskKeyIds) != 0; |
| 67 } | 67 } |
| 68 NOTREACHED(); | 68 NOTREACHED(); |
| 69 return false; | 69 return false; |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool IsSupportedCodecCombination( | 72 // TODO(sandersd): Secure codec simulation. |
| 73 EmeConfigRule GetContentTypeConfigRule( |
| 73 const std::string& key_system, | 74 const std::string& key_system, |
| 74 EmeMediaType media_type, | 75 EmeMediaType media_type, |
| 75 const std::string& container_mime_type, | 76 const std::string& container_mime_type, |
| 76 const std::vector<std::string>& codecs) const override { | 77 const std::vector<std::string>& codecs) const override { |
| 77 if (container_mime_type == kUnsupportedContainer) | 78 if (container_mime_type == kUnsupportedContainer) |
| 78 return false; | 79 return EmeConfigRule::NOT_SUPPORTED; |
| 79 DCHECK_EQ(kSupportedContainer, container_mime_type); | 80 DCHECK_EQ(kSupportedContainer, container_mime_type); |
| 80 for (const std::string& codec : codecs) { | 81 for (const std::string& codec : codecs) { |
| 81 if (codec == kUnsupportedCodec) | 82 if (codec == kUnsupportedCodec) |
| 82 return false; | 83 return EmeConfigRule::NOT_SUPPORTED; |
| 83 DCHECK_EQ(kSupportedCodec, codec); | 84 DCHECK_EQ(kSupportedCodec, codec); |
| 84 } | 85 } |
| 85 return true; | 86 return EmeConfigRule::SUPPORTED; |
| 86 } | 87 } |
| 87 | 88 |
| 88 EmeConfigRule GetRobustnessConfigRule( | 89 EmeConfigRule GetRobustnessConfigRule( |
| 89 const std::string& key_system, | 90 const std::string& key_system, |
| 90 EmeMediaType media_type, | 91 EmeMediaType media_type, |
| 91 const std::string& requested_robustness) const override { | 92 const std::string& requested_robustness) const override { |
| 92 if (requested_robustness == kUnsupported) | 93 if (requested_robustness == kUnsupported) |
| 93 return EmeConfigRule::NOT_SUPPORTED; | 94 return EmeConfigRule::NOT_SUPPORTED; |
| 94 if (requested_robustness == kRequireIdentifier) | 95 if (requested_robustness == kRequireIdentifier) |
| 95 return EmeConfigRule::IDENTIFIER_REQUIRED; | 96 return EmeConfigRule::IDENTIFIER_REQUIRED; |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 | 757 |
| 757 blink::WebMediaKeySystemConfiguration config2; | 758 blink::WebMediaKeySystemConfiguration config2; |
| 758 config2.label = "b"; | 759 config2.label = "b"; |
| 759 configs_.push_back(config2); | 760 configs_.push_back(config2); |
| 760 | 761 |
| 761 ASSERT_TRUE(SelectConfigRequestsPermissionAndReturnsConfig()); | 762 ASSERT_TRUE(SelectConfigRequestsPermissionAndReturnsConfig()); |
| 762 ASSERT_EQ("b", config_.label); | 763 ASSERT_EQ("b", config_.label); |
| 763 } | 764 } |
| 764 | 765 |
| 765 } // namespace media | 766 } // namespace media |
| OLD | NEW |