| Index: chrome/renderer/media/chrome_key_systems.cc
|
| diff --git a/content/renderer/media/crypto/key_systems_info.cc b/chrome/renderer/media/chrome_key_systems.cc
|
| similarity index 82%
|
| copy from content/renderer/media/crypto/key_systems_info.cc
|
| copy to chrome/renderer/media/chrome_key_systems.cc
|
| index ff84f57948d3a07bf4883690c76fec6d327c75c3..d96ded4ccfebe26938aa27be482a502e889438b4 100644
|
| --- a/content/renderer/media/crypto/key_systems_info.cc
|
| +++ b/chrome/renderer/media/chrome_key_systems.cc
|
| @@ -2,10 +2,9 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "content/renderer/media/crypto/key_systems_info.h"
|
| +#include "chrome/renderer/media/chrome_key_systems.h"
|
|
|
| #include "base/logging.h"
|
| -#include "third_party/WebKit/public/platform/WebString.h"
|
|
|
| #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
|
|
|
| @@ -16,12 +15,7 @@
|
| #include "base/version.h"
|
| #endif
|
|
|
| -#if defined(DISABLE_WIDEVINE_CDM_CANPLAYTYPE)
|
| -#include "base/command_line.h"
|
| -#include "media/base/media_switches.h"
|
| -#endif
|
| -
|
| -namespace content {
|
| +using content::KeySystemInfo;
|
|
|
| static const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey";
|
|
|
| @@ -37,6 +31,8 @@ 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)
|
| @@ -45,7 +41,7 @@ enum SupportedCodecs {
|
| #endif // defined(USE_PROPRIETARY_CODECS)
|
| };
|
|
|
| -static void AddWidevineForTypes(
|
| +static void AddWidevineWithCodecs(
|
| SupportedCodecs supported_codecs,
|
| std::vector<KeySystemInfo>* concrete_key_systems) {
|
| static const char kWidevineParentKeySystem[] = "com.widevine";
|
| @@ -105,13 +101,13 @@ static void AddPepperBasedWidevine(
|
| #endif
|
| #endif // defined(USE_PROPRIETARY_CODECS)
|
|
|
| - AddWidevineForTypes(supported_codecs, concrete_key_systems);
|
| + AddWidevineWithCodecs(supported_codecs, concrete_key_systems);
|
| }
|
| #elif defined(OS_ANDROID)
|
| static void AddAndroidWidevine(
|
| std::vector<KeySystemInfo>* concrete_key_systems) {
|
| SupportedCodecs supported_codecs = MP4_AAC | MP4_AVC1;
|
| - AddWidevineForTypes(supported_codecs, concrete_key_systems);
|
| + AddWidevineWithCodecs(supported_codecs, concrete_key_systems);
|
| }
|
| #endif // defined(ENABLE_PEPPER_CDMS)
|
| #endif // defined(WIDEVINE_CDM_AVAILABLE)
|
| @@ -155,7 +151,7 @@ static void AddExternalClearKey(
|
| }
|
| #endif // defined(ENABLE_PEPPER_CDMS)
|
|
|
| -void AddKeySystems(std::vector<KeySystemInfo>* key_systems_info) {
|
| +void AddChromeKeySystems(std::vector<KeySystemInfo>* key_systems_info) {
|
| AddClearKey(key_systems_info);
|
|
|
| #if defined(ENABLE_PEPPER_CDMS)
|
| @@ -170,26 +166,3 @@ void AddKeySystems(std::vector<KeySystemInfo>* key_systems_info) {
|
| #endif
|
| #endif
|
| }
|
| -
|
| -bool IsCanPlayTypeSuppressed(const std::string& key_system) {
|
| -#if defined(DISABLE_WIDEVINE_CDM_CANPLAYTYPE)
|
| - // See http://crbug.com/237627.
|
| - if (key_system == kWidevineKeySystem &&
|
| - !CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kOverrideEncryptedMediaCanPlayType))
|
| - return true;
|
| -#endif
|
| - return false;
|
| -}
|
| -
|
| -std::string KeySystemNameForUMAInternal(const WebKit::WebString& key_system) {
|
| - if (key_system == kClearKeyKeySystem)
|
| - return "ClearKey";
|
| -#if defined(WIDEVINE_CDM_AVAILABLE)
|
| - if (key_system == kWidevineKeySystem)
|
| - return "Widevine";
|
| -#endif // WIDEVINE_CDM_AVAILABLE
|
| - return "Unknown";
|
| -}
|
| -
|
| -} // namespace content
|
|
|