Chromium Code Reviews| Index: chrome/renderer/media/chrome_key_systems.cc |
| diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc |
| index be7c4b1e05373b34250e14affc2bf1f95899e60c..eb16a39c9243448b14e29e1f2746123d556d1fa4 100644 |
| --- a/chrome/renderer/media/chrome_key_systems.cc |
| +++ b/chrome/renderer/media/chrome_key_systems.cc |
| @@ -5,6 +5,8 @@ |
| #include "chrome/renderer/media/chrome_key_systems.h" |
| #include "base/logging.h" |
| +#include "chrome/common/widevine_cdm_constants.h" |
| +#include "content/public/renderer/render_thread.h" |
| #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
| @@ -15,6 +17,10 @@ |
| #include "base/version.h" |
| #endif |
| +#if defined(OS_ANDROID) |
| +#include "chrome/common/encrypted_media_messages_android.h" |
| +#endif |
| + |
| using content::KeySystemInfo; |
| static const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; |
| @@ -31,25 +37,11 @@ static const char kAvc1[] = "avc1"; |
| static const char kMp4aAvc1[] = "mp4a,avc1"; |
| #if defined(WIDEVINE_CDM_AVAILABLE) |
| -// Defines bitmask values used to specify supported codecs. |
| -// Each value represents a codec within a specific container. |
| -enum SupportedCodecs { |
| - WEBM_VP8_AND_VORBIS = 1 << 0, |
| -#if defined(USE_PROPRIETARY_CODECS) |
| - MP4_AAC = 1 << 1, |
| - MP4_AVC1 = 1 << 2, |
| -#endif // defined(USE_PROPRIETARY_CODECS) |
| -}; |
| static void AddWidevineWithCodecs( |
| SupportedCodecs supported_codecs, |
| std::vector<KeySystemInfo>* concrete_key_systems) { |
| static const char kWidevineParentKeySystem[] = "com.widevine"; |
| -#if defined(OS_ANDROID) |
| - static const uint8 kWidevineUuid[16] = { |
| - 0xED, 0xEF, 0x8B, 0xA9, 0x79, 0xD6, 0x4A, 0xCE, |
| - 0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED }; |
| -#endif |
| #if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION) |
| Version glibc_version(gnu_get_libc_version()); |
| @@ -106,11 +98,22 @@ static void AddPepperBasedWidevine( |
| #elif defined(OS_ANDROID) |
| static void AddAndroidWidevine( |
| std::vector<KeySystemInfo>* concrete_key_systems) { |
| + SupportedKeySystemRequest request; |
| + SupportedKeySystemResponse response; |
| + |
| + request.uuid.insert( |
| + request.uuid.begin(), kWidevineUuid, kWidevineUuid + 16); |
|
ddorwin
2013/09/17 22:29:08
s/16/arraysize/
qinmin
2013/09/18 00:45:44
Done.
|
| #if defined(USE_PROPRIETARY_CODECS) |
| - SupportedCodecs supported_codecs = |
| - static_cast<SupportedCodecs>(MP4_AAC | MP4_AVC1); |
| - AddWidevineWithCodecs(supported_codecs, concrete_key_systems); |
| + request.supported_codecs = static_cast<SupportedCodecs>(MP4_AAC | MP4_AVC1); |
| #endif // defined(USE_PROPRIETARY_CODECS) |
| + content::RenderThread::Get()->Send( |
| + new ChromeViewHostMsg_GetSupportedKeySystems( |
| + request, &response)); |
| + // TODO(qinmin): using different key system types for compositing and |
|
ddorwin
2013/09/17 22:29:08
s/using/Use/
qinmin
2013/09/18 00:45:44
Done.
|
| + // non-compositing codecs. |
| + SupportedCodecs supported_codecs = static_cast<SupportedCodecs>( |
| + response.compositing_codecs | response.non_compositing_codecs); |
| + AddWidevineWithCodecs(supported_codecs, concrete_key_systems); |
| } |
| #endif // defined(ENABLE_PEPPER_CDMS) |
| #endif // defined(WIDEVINE_CDM_AVAILABLE) |