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 "chrome/renderer/media/chrome_key_systems.h" | 5 #include "chrome/renderer/media/chrome_key_systems.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 if (additional_param_names[i] == | 130 if (additional_param_names[i] == |
131 base::ASCIIToUTF16(kCdmSupportedCodecsParamName)) { | 131 base::ASCIIToUTF16(kCdmSupportedCodecsParamName)) { |
132 const base::string16& codecs_string16 = additional_param_values[i]; | 132 const base::string16& codecs_string16 = additional_param_values[i]; |
133 std::string codecs_string; | 133 std::string codecs_string; |
134 if (!base::UTF16ToUTF8(codecs_string16.c_str(), | 134 if (!base::UTF16ToUTF8(codecs_string16.c_str(), |
135 codecs_string16.length(), | 135 codecs_string16.length(), |
136 &codecs_string)) { | 136 &codecs_string)) { |
137 DLOG(WARNING) << "Non-UTF-8 codecs string."; | 137 DLOG(WARNING) << "Non-UTF-8 codecs string."; |
138 // Continue using the best effort conversion. | 138 // Continue using the best effort conversion. |
139 } | 139 } |
140 base::SplitString(codecs_string, | 140 *codecs = base::SplitString( |
141 kCdmSupportedCodecsValueDelimiter, | 141 codecs_string, std::string(1, kCdmSupportedCodecsValueDelimiter), |
142 codecs); | 142 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
143 break; | 143 break; |
144 } | 144 } |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 static void AddPepperBasedWidevine( | 148 static void AddPepperBasedWidevine( |
149 std::vector<KeySystemInfo>* concrete_key_systems) { | 149 std::vector<KeySystemInfo>* concrete_key_systems) { |
150 #if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) | 150 #if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) |
151 Version glibc_version(gnu_get_libc_version()); | 151 Version glibc_version(gnu_get_libc_version()); |
152 DCHECK(glibc_version.IsValid()); | 152 DCHECK(glibc_version.IsValid()); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 #if defined(WIDEVINE_CDM_AVAILABLE) | 222 #if defined(WIDEVINE_CDM_AVAILABLE) |
223 AddPepperBasedWidevine(key_systems_info); | 223 AddPepperBasedWidevine(key_systems_info); |
224 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 224 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
225 #endif // defined(ENABLE_PEPPER_CDMS) | 225 #endif // defined(ENABLE_PEPPER_CDMS) |
226 | 226 |
227 #if defined(OS_ANDROID) | 227 #if defined(OS_ANDROID) |
228 cdm::AddAndroidWidevine(key_systems_info); | 228 cdm::AddAndroidWidevine(key_systems_info); |
229 #endif // defined(OS_ANDROID) | 229 #endif // defined(OS_ANDROID) |
230 } | 230 } |
OLD | NEW |