Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "chromecast/media/base/key_systems_common.h" | 5 #include "chromecast/media/base/key_systems_common.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "media/cdm/key_system_names.h" | 9 #include "media/cdm/key_system_names.h" |
| 10 | 10 |
| 11 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 11 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
|
gunsch
2014/12/02 23:29:41
Drive-by comment: for all of the cases where WIDEV
sandersd (OOO until July 31)
2014/12/12 01:34:46
This is true, but my attempt resulted in a very la
| |
| 12 | 12 |
| 13 namespace chromecast { | 13 namespace chromecast { |
| 14 namespace media { | 14 namespace media { |
| 15 | 15 |
| 16 #if defined(PLAYREADY_CDM_AVAILABLE) | 16 #if defined(PLAYREADY_CDM_AVAILABLE) |
| 17 const char kChromecastPlayreadyKeySystem[] = "com.chromecast.playready"; | 17 const char kChromecastPlayreadyKeySystem[] = "com.chromecast.playready"; |
| 18 #endif // defined(PLAYREADY_CDM_AVAILABLE) | 18 #endif // defined(PLAYREADY_CDM_AVAILABLE) |
| 19 | 19 |
| 20 CastKeySystem GetKeySystemByName(const std::string& key_system_name) { | 20 CastKeySystem GetKeySystemByName(const std::string& key_system_name) { |
| 21 #if defined(WIDEVINE_CDM_AVAILABLE) | 21 #if defined(ENABLE_WIDEVINE) |
| 22 if (key_system_name.compare(kWidevineKeySystem) == 0) { | 22 if (key_system_name.compare(kWidevineKeySystem) == 0) { |
| 23 return KEY_SYSTEM_WIDEVINE; | 23 return KEY_SYSTEM_WIDEVINE; |
| 24 } | 24 } |
| 25 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 25 #endif // defined(ENABLE_WIDEVINE) |
| 26 | 26 |
| 27 #if defined(PLAYREADY_CDM_AVAILABLE) | 27 #if defined(PLAYREADY_CDM_AVAILABLE) |
| 28 if (key_system_name.compare(kChromecastPlayreadyKeySystem) == 0) { | 28 if (key_system_name.compare(kChromecastPlayreadyKeySystem) == 0) { |
| 29 return KEY_SYSTEM_PLAYREADY; | 29 return KEY_SYSTEM_PLAYREADY; |
| 30 } | 30 } |
| 31 #endif // defined(PLAYREADY_CDM_AVAILABLE) | 31 #endif // defined(PLAYREADY_CDM_AVAILABLE) |
| 32 | 32 |
| 33 if (key_system_name.compare(::media::kClearKey) == 0) { | 33 if (key_system_name.compare(::media::kClearKey) == 0) { |
| 34 return KEY_SYSTEM_CLEAR_KEY; | 34 return KEY_SYSTEM_CLEAR_KEY; |
| 35 } | 35 } |
| 36 | 36 |
| 37 return GetPlatformKeySystemByName(key_system_name); | 37 return GetPlatformKeySystemByName(key_system_name); |
| 38 } | 38 } |
| 39 | 39 |
| 40 } // namespace media | 40 } // namespace media |
| 41 } // namespace chromecast | 41 } // namespace chromecast |
| OLD | NEW |