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

Unified Diff: chromecast/browser/media/cast_media_client_android.cc

Issue 962793005: Adds MediaClientAndroid to support embedder/MediaDrmBridge interaction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename createSession to createSessionFromNative to avoid bug in FindBugs Created 5 years, 8 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/browser/media/cast_media_client_android.h ('k') | chromecast/chromecast.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/media/cast_media_client_android.cc
diff --git a/chromecast/browser/media/cast_media_client_android.cc b/chromecast/browser/media/cast_media_client_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..696471e6c0dd368651c9a2f39031af01b42469e7
--- /dev/null
+++ b/chromecast/browser/media/cast_media_client_android.cc
@@ -0,0 +1,44 @@
+// Copyright 2015 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/browser/media/cast_media_client_android.h"
+
+#include "chromecast/media/base/key_systems_common.h"
+
+namespace chromecast {
+namespace media {
+
+CastMediaClientAndroid::CastMediaClientAndroid() {
+}
+
+CastMediaClientAndroid::~CastMediaClientAndroid() {
+}
+
+void CastMediaClientAndroid::AddKeySystemUUIDMappings(KeySystemUuidMap* map) {
+ // Note: MediaDrmBridge adds the Widevine UUID mapping automatically.
+#if defined(PLAYREADY_CDM_AVAILABLE)
+ (*map)[kChromecastPlayreadyKeySystem] = playready_delegate_.GetUUID();
+#endif
+
+ auto platform_mappings = GetPlatformKeySystemUUIDMappings();
+ for (const auto& mapping : platform_mappings)
+ map->insert(mapping);
+}
+
+::media::MediaDrmBridgeDelegate*
+CastMediaClientAndroid::GetMediaDrmBridgeDelegate(
+ const ::media::UUID& scheme_uuid) {
+#if defined(PLAYREADY_CDM_AVAILABLE)
+ if (scheme_uuid == playready_delegate_.GetUUID())
+ return &playready_delegate_;
+#endif
+
+ if (scheme_uuid == widevine_delegate_.GetUUID())
+ return &widevine_delegate_;
+
+ return nullptr;
+}
+
+} // namespace media
+} // namespace chromecast
« no previous file with comments | « chromecast/browser/media/cast_media_client_android.h ('k') | chromecast/chromecast.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698