Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: chromecast/media/base/key_systems_common.cc

Issue 568243002: Adds initial key systems support for Chromecast. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address last comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/media/base/key_systems_common.h ('k') | chromecast/media/base/key_systems_common_simple.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/media/base/key_systems_common.cc
diff --git a/chromecast/media/base/key_systems_common.cc b/chromecast/media/base/key_systems_common.cc
new file mode 100644
index 0000000000000000000000000000000000000000..89257192dbc3d48139ffc008ba0607d60a9a4648
--- /dev/null
+++ b/chromecast/media/base/key_systems_common.cc
@@ -0,0 +1,39 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromecast/media/base/key_systems_common.h"
+
+#include <cstddef>
+
+#include "media/cdm/key_system_names.h"
+
+#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
+
+namespace chromecast {
+namespace media {
+
+const char kChromecastPlayreadyKeySystem[] = "com.chromecast.playready";
+
+CastKeySystem GetKeySystemByName(const std::string& key_system_name) {
+#if defined(WIDEVINE_CDM_AVAILABLE)
+ if (key_system_name.compare(kWidevineKeySystem) == 0) {
+ return KEY_SYSTEM_WIDEVINE;
+ }
+#endif // defined(WIDEVINE_CDM_AVAILABLE)
+
+#if defined(PLAYREADY_CDM_AVAILABLE)
+ if (key_system_name.compare(kChromecastPlayreadyKeySystem) == 0) {
+ return KEY_SYSTEM_PLAYREADY;
+ }
+#endif // defined(PLAYREADY_CDM_AVAILABLE)
+
+ if (key_system_name.compare(::media::kClearKey) == 0) {
+ return KEY_SYSTEM_CLEAR_KEY;
+ }
+
+ return GetPlatformKeySystemByName(key_system_name);
+}
+
+} // namespace media
+} // namespace chromecast
« no previous file with comments | « chromecast/media/base/key_systems_common.h ('k') | chromecast/media/base/key_systems_common_simple.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698