Index: chromecast/shell/renderer/key_systems_cast.cc |
diff --git a/chromecast/shell/renderer/key_systems_cast.cc b/chromecast/shell/renderer/key_systems_cast.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2820616d0d73397b1ef4d77a4470ff742f61433e |
--- /dev/null |
+++ b/chromecast/shell/renderer/key_systems_cast.cc |
@@ -0,0 +1,55 @@ |
+// 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/shell/renderer/key_systems_cast.h" |
+ |
+#include <string> |
+ |
+#include "base/command_line.h" |
+#include "base/logging.h" |
+#include "chromecast/media/base/key_systems_common.h" |
+#include "components/cdm/renderer/widevine_key_systems.h" |
+#include "content/public/common/eme_codec.h" |
+ |
+#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
+ |
+using content::KeySystemInfo; |
+ |
+namespace { |
+ |
+void AddKeySystemWithCodecs( |
+ const std::string& key_system_name, |
+ std::vector<KeySystemInfo>* concrete_key_systems) { |
+ KeySystemInfo info(key_system_name); |
+ info.supported_codecs = content::EME_CODEC_MP4_ALL; |
+ concrete_key_systems->push_back(info); |
+} |
+ |
+} // namespace |
+ |
+namespace chromecast { |
+namespace shell { |
+ |
+void AddChromecastKeySystems(std::vector<KeySystemInfo>* key_systems_info) { |
+ // Chromecast supports using "org.w3.clearkey" with webkitGenerateKeyRequest, |
+ // which key_systems.cc rewrites to "unsupported-org.w3.clearkey". |
+ // TODO(gunsch): remove this after moving to EMEv2. |
ddorwin
2014/09/15 22:50:53
ditto on v2
gunsch
2014/09/16 16:58:00
Done.
|
+ // See: 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.
|
+ AddKeySystemWithCodecs(kUnsupportedClearKeySystem, key_systems_info); |
+ |
+#if defined(WIDEVINE_CDM_AVAILABLE) |
+ AddWidevineWithCodecs(cdm::WIDEVINE, |
+ content::EME_CODEC_MP4_ALL, |
+ key_systems_info); |
+#endif |
+ |
+#if defined(PLAYREADY_CDM_AVAILABLE) |
+ for (size_t i = 0; kPlayreadyKeySystems[i] != NULL; i++) { |
+ AddKeySystemWithCodecs(kPlayreadyKeySystems[i], key_systems_info); |
+ } |
+#endif |
+} |
+ |
+} // namespace shell |
+} // namespace chromecast |