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 "components/cdm/renderer/android_key_systems.h" | 5 #include "components/cdm/renderer/android_key_systems.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // Since we do not control the implementation of the MediaDrm API on Android, | 118 // Since we do not control the implementation of the MediaDrm API on Android, |
119 // we assume that it can and will make use of persistence no matter whether | 119 // we assume that it can and will make use of persistence no matter whether |
120 // persistence-based features are supported or not. | 120 // persistence-based features are supported or not. |
121 | 121 |
122 const EmeSessionTypeSupport persistent_license_support = | 122 const EmeSessionTypeSupport persistent_license_support = |
123 response.is_persistent_license_supported | 123 response.is_persistent_license_supported |
124 ? EmeSessionTypeSupport::SUPPORTED_WITH_IDENTIFIER | 124 ? EmeSessionTypeSupport::SUPPORTED_WITH_IDENTIFIER |
125 : EmeSessionTypeSupport::NOT_SUPPORTED; | 125 : EmeSessionTypeSupport::NOT_SUPPORTED; |
126 | 126 |
127 if (response.compositing_codecs != media::EME_CODEC_NONE) { | 127 if (response.compositing_codecs != media::EME_CODEC_NONE) { |
| 128 DVLOG(3) << __func__ << " Widevine supported."; |
128 concrete_key_systems->emplace_back(new WidevineKeySystemProperties( | 129 concrete_key_systems->emplace_back(new WidevineKeySystemProperties( |
129 response.compositing_codecs, // Regular codecs. | 130 response.compositing_codecs, // Regular codecs. |
130 response.non_compositing_codecs, // Hardware-secure codecs. | 131 response.non_compositing_codecs, // Hardware-secure codecs. |
131 Robustness::HW_SECURE_CRYPTO, // Max audio robustness. | 132 Robustness::HW_SECURE_CRYPTO, // Max audio robustness. |
132 Robustness::HW_SECURE_ALL, // Max video robustness. | 133 Robustness::HW_SECURE_ALL, // Max video robustness. |
133 persistent_license_support, // persistent-license. | 134 persistent_license_support, // persistent-license. |
134 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-release-message. | 135 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-release-message. |
135 EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state. | 136 EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state. |
136 EmeFeatureSupport::ALWAYS_ENABLED)); // Distinctive identifier. | 137 EmeFeatureSupport::ALWAYS_ENABLED)); // Distinctive identifier. |
137 } else { | 138 } else { |
138 // It doesn't make sense to support secure codecs but not regular codecs. | 139 // It doesn't make sense to support secure codecs but not regular codecs. |
| 140 DVLOG(3) << __func__ << " Widevine NOT supported."; |
139 DCHECK(response.non_compositing_codecs == media::EME_CODEC_NONE); | 141 DCHECK(response.non_compositing_codecs == media::EME_CODEC_NONE); |
140 } | 142 } |
141 } | 143 } |
142 | 144 |
143 void AddAndroidPlatformKeySystems( | 145 void AddAndroidPlatformKeySystems( |
144 std::vector<std::unique_ptr<KeySystemProperties>>* concrete_key_systems) { | 146 std::vector<std::unique_ptr<KeySystemProperties>>* concrete_key_systems) { |
145 std::vector<std::string> key_system_names; | 147 std::vector<std::string> key_system_names; |
146 content::RenderThread::Get()->Send( | 148 content::RenderThread::Get()->Send( |
147 new ChromeViewHostMsg_GetPlatformKeySystemNames(&key_system_names)); | 149 new ChromeViewHostMsg_GetPlatformKeySystemNames(&key_system_names)); |
148 | 150 |
149 for (std::vector<std::string>::const_iterator it = key_system_names.begin(); | 151 for (std::vector<std::string>::const_iterator it = key_system_names.begin(); |
150 it != key_system_names.end(); ++it) { | 152 it != key_system_names.end(); ++it) { |
151 SupportedKeySystemResponse response = QueryKeySystemSupport(*it); | 153 SupportedKeySystemResponse response = QueryKeySystemSupport(*it); |
152 if (response.compositing_codecs != media::EME_CODEC_NONE) { | 154 if (response.compositing_codecs != media::EME_CODEC_NONE) { |
153 concrete_key_systems->emplace_back(new AndroidPlatformKeySystemProperties( | 155 concrete_key_systems->emplace_back(new AndroidPlatformKeySystemProperties( |
154 *it, response.compositing_codecs)); | 156 *it, response.compositing_codecs)); |
155 } | 157 } |
156 } | 158 } |
157 } | 159 } |
158 | 160 |
159 } // namespace cdm | 161 } // namespace cdm |
OLD | NEW |