| 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 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 if (IsWidevineHrSupported()) | 285 if (IsWidevineHrSupported()) |
| 286 AddWidevineWithCodecs(WIDEVINE_HR, supported_codecs, concrete_key_systems); | 286 AddWidevineWithCodecs(WIDEVINE_HR, supported_codecs, concrete_key_systems); |
| 287 } | 287 } |
| 288 #elif defined(OS_ANDROID) | 288 #elif defined(OS_ANDROID) |
| 289 static void AddAndroidWidevine( | 289 static void AddAndroidWidevine( |
| 290 std::vector<KeySystemInfo>* concrete_key_systems) { | 290 std::vector<KeySystemInfo>* concrete_key_systems) { |
| 291 SupportedKeySystemRequest request; | 291 SupportedKeySystemRequest request; |
| 292 SupportedKeySystemResponse response; | 292 SupportedKeySystemResponse response; |
| 293 | 293 |
| 294 request.key_system = kWidevineKeySystem; | 294 request.key_system = kWidevineKeySystem; |
| 295 #if defined(USE_PROPRIETARY_CODECS) | |
| 296 request.codecs = static_cast<android::SupportedCodecs>( | 295 request.codecs = static_cast<android::SupportedCodecs>( |
| 297 android::MP4_AAC | android::MP4_AVC1); | 296 android::WEBM_VP8_AND_VORBIS | android::MP4_AAC | android::MP4_AVC1); |
| 298 #endif // defined(USE_PROPRIETARY_CODECS) | |
| 299 content::RenderThread::Get()->Send( | 297 content::RenderThread::Get()->Send( |
| 300 new ChromeViewHostMsg_GetSupportedKeySystems(request, &response)); | 298 new ChromeViewHostMsg_GetSupportedKeySystems(request, &response)); |
| 301 DCHECK_EQ(response.compositing_codecs >> 3, 0) << "unrecognized codec"; | 299 DCHECK_EQ(response.compositing_codecs >> 3, 0) << "unrecognized codec"; |
| 302 DCHECK_EQ(response.non_compositing_codecs >> 3, 0) << "unrecognized codec"; | 300 DCHECK_EQ(response.non_compositing_codecs >> 3, 0) << "unrecognized codec"; |
| 303 if (response.compositing_codecs != android::NO_SUPPORTED_CODECS) { | 301 if (response.compositing_codecs != android::NO_SUPPORTED_CODECS) { |
| 304 AddWidevineWithCodecs( | 302 AddWidevineWithCodecs( |
| 305 WIDEVINE, | 303 WIDEVINE, |
| 306 static_cast<SupportedCodecs>(response.compositing_codecs), | 304 static_cast<SupportedCodecs>(response.compositing_codecs), |
| 307 concrete_key_systems); | 305 concrete_key_systems); |
| 308 } | 306 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 323 #endif | 321 #endif |
| 324 | 322 |
| 325 #if defined(WIDEVINE_CDM_AVAILABLE) | 323 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 326 #if defined(ENABLE_PEPPER_CDMS) | 324 #if defined(ENABLE_PEPPER_CDMS) |
| 327 AddPepperBasedWidevine(key_systems_info); | 325 AddPepperBasedWidevine(key_systems_info); |
| 328 #elif defined(OS_ANDROID) | 326 #elif defined(OS_ANDROID) |
| 329 AddAndroidWidevine(key_systems_info); | 327 AddAndroidWidevine(key_systems_info); |
| 330 #endif | 328 #endif |
| 331 #endif | 329 #endif |
| 332 } | 330 } |
| OLD | NEW |