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

Side by Side 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: rebase Created 5 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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/browser/media/cast_media_client_android.h"
6
7 #include <utility>
8
9 #include "base/stl_util.h"
10 #include "chromecast/media/base/key_systems_common.h"
11 #include "chromecast/media/cdm/playready_drm_delegate_android.h"
12 #include "components/cdm/browser/widevine_drm_delegate_android.h"
13
14 namespace chromecast {
15 namespace media {
16
17 CastMediaClientAndroid::CastMediaClientAndroid() {
18 #if defined(PLAYREADY_CDM_AVAILABLE)
19 ::media::MediaDrmBridgeDelegate* playready_delegate =
20 new PlayreadyDrmDelegateAndroid();
21 AddKeySystemUUIDMapping(kChromecastPlayreadyKeySystem,
22 playready_delegate->GetUUID());
23 delegates_[playready_delegate->GetUUID()] = playready_delegate;
24 #endif
25
26 #if defined(WIDEVINE_CDM_AVAILABLE)
27 // Note: MediaDrmBridge adds the Widevine UUID mapping automatically.
28 delegates_[widevine_delegate->GetUUID()] =
29 new cdm::WidevineDrmDelegateAndroid();
30 #endif
31
32 auto platform_mappings = GetPlatformKeySystemUUIDMappings();
33 for (const auto& mapping : platform_mappings) {
34 AddKeySystemUUIDMapping(mapping.first, mapping.second);
35 }
36 }
37
38 CastMediaClientAndroid::~CastMediaClientAndroid() {
39 STLDeleteContainerPairSecondPointers(delegates_.begin(), delegates_.end());
40 }
41
42 ::media::MediaDrmBridgeDelegate*
43 CastMediaClientAndroid::GetMediaDrmBridgeDelegate(
44 const ::media::UUID& scheme_uuid) const {
45 DelegateMap::const_iterator it = delegates_.find(scheme_uuid);
46 if (it == delegates_.end())
47 return nullptr;
48 return it->second;
49 }
50
51 } // namespace media
52 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698