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
3 // found in the LICENSE file.
5 #include "chromecast/media/base/key_systems_common.h"
9 #include "media/cdm/key_system_names.h"
11 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
13 namespace chromecast {
16 #if defined(PLAYREADY_CDM_AVAILABLE)
17 const char kChromecastPlayreadyKeySystem[] = "com.chromecast.playready";
18 #endif // defined(PLAYREADY_CDM_AVAILABLE)
20 CastKeySystem GetKeySystemByName(const std::string& key_system_name) {
21 #if defined(WIDEVINE_CDM_AVAILABLE)
22 if (key_system_name.compare(kWidevineKeySystem) == 0) {
23 return KEY_SYSTEM_WIDEVINE;
25 #endif // defined(WIDEVINE_CDM_AVAILABLE)
27 #if defined(PLAYREADY_CDM_AVAILABLE)
28 if (key_system_name.compare(kChromecastPlayreadyKeySystem) == 0) {
29 return KEY_SYSTEM_PLAYREADY;
31 #endif // defined(PLAYREADY_CDM_AVAILABLE)
33 if (key_system_name.compare(::media::kClearKey) == 0) {
34 return KEY_SYSTEM_CLEAR_KEY;
37 return GetPlatformKeySystemByName(key_system_name);
41 } // namespace chromecast