Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #include "chromecast/media/base/key_systems_common.h" | |
| 6 | |
| 7 #include <cstddef> | |
| 8 | |
| 9 #include "media/cdm/key_system_names.h" | |
| 10 | |
| 11 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | |
| 12 | |
| 13 namespace chromecast { | |
| 14 | |
| 15 // TODO(gunsch): remove this support when moving to EMEv2. | |
|
ddorwin
2014/09/15 22:50:53
The correct term is "unprefixed EME". It's not rea
gunsch
2014/09/16 16:58:00
Done.
| |
| 16 // See also: crbug/393397 | |
|
ddorwin
2014/09/15 22:50:53
I don't think this bug addresses the clear key nam
gunsch
2014/09/16 16:58:00
Done.
| |
| 17 const char kUnsupportedClearKeySystem[] = "unsupported-org.w3.clearkey"; | |
| 18 | |
| 19 const char* kPlayreadyKeySystems[] = { | |
| 20 // TODO(gunsch): Replace with a more appropriate name when moving to EMEv2. | |
| 21 // See also: crbug/393397. | |
| 22 "com.microsoft.playready", | |
| 23 "com.youtube.playready", | |
| 24 NULL, | |
| 25 }; | |
| 26 | |
| 27 CastKeySystem GetKeySystemByName(const std::string& key_system_name) { | |
| 28 #if defined(WIDEVINE_CDM_AVAILABLE) | |
| 29 if (key_system_name.compare(kWidevineKeySystem) == 0) { | |
| 30 return KEY_SYSTEM_WIDEVINE; | |
| 31 } | |
| 32 #endif // defined(WIDEVINE_CDM_AVAILABLE) | |
| 33 | |
| 34 #if defined(PLAYREADY_CDM_AVAILABLE) | |
| 35 for (size_t i = 0; kPlayreadyKeySystems[i] != NULL; i++) { | |
| 36 if (key_system_name.compare(kPlayreadyKeySystems[i]) == 0) { | |
| 37 return KEY_SYSTEM_PLAYREADY; | |
| 38 } | |
| 39 } | |
| 40 #endif // defined(PLAYREADY_CDM_AVAILABLE) | |
| 41 | |
| 42 if (key_system_name.compare(::media::kClearKey) == 0 || | |
| 43 key_system_name.compare(kUnsupportedClearKeySystem) == 0) { | |
| 44 return KEY_SYSTEM_CLEAR_KEY; | |
| 45 } | |
| 46 | |
| 47 return KEY_SYSTEM_NONE; | |
| 48 } | |
| 49 | |
| 50 } // namespace chromecast | |
| OLD | NEW |