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

Side by Side Diff: components/cdm/renderer/widevine_key_systems.cc

Issue 320383005: Add an IPC to return the platform supported key-system names in Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed xhwang's comments. Created 6 years, 6 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
« no previous file with comments | « components/cdm/renderer/widevine_key_systems.h ('k') | media/base/android/media_drm_bridge.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/cdm/renderer/widevine_key_systems.h" 5 #include "components/cdm/renderer/widevine_key_systems.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "components/cdm/common/cdm_messages_android.h"
12 #include "content/public/renderer/key_system_info.h"
13 #include "content/public/renderer/render_thread.h"
14 11
15 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 12 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
16 13
17 #if defined(WIDEVINE_CDM_AVAILABLE) 14 #if defined(WIDEVINE_CDM_AVAILABLE)
18 15
19 using content::KeySystemInfo; 16 using content::KeySystemInfo;
20 using content::SupportedCodecs; 17 using content::SupportedCodecs;
21 18
22 namespace cdm { 19 namespace cdm {
23 20
24 // Return |name|'s parent key system. 21 // Return |name|'s parent key system.
25 static std::string GetDirectParentName(std::string name) { 22 static std::string GetDirectParentName(std::string name) {
(...skipping 26 matching lines...) Expand all
52 // initDataType. 49 // initDataType.
53 info.supported_codecs = supported_codecs; 50 info.supported_codecs = supported_codecs;
54 51
55 #if defined(ENABLE_PEPPER_CDMS) 52 #if defined(ENABLE_PEPPER_CDMS)
56 info.pepper_type = kWidevineCdmPluginMimeType; 53 info.pepper_type = kWidevineCdmPluginMimeType;
57 #endif // defined(ENABLE_PEPPER_CDMS) 54 #endif // defined(ENABLE_PEPPER_CDMS)
58 55
59 concrete_key_systems->push_back(info); 56 concrete_key_systems->push_back(info);
60 } 57 }
61 58
62 #if defined(OS_ANDROID)
63 void AddAndroidWidevine(std::vector<KeySystemInfo>* concrete_key_systems) {
64 SupportedKeySystemRequest request;
65 SupportedKeySystemResponse response;
66
67 request.key_system = kWidevineKeySystem;
68 request.codecs = content::EME_CODEC_WEBM_ALL | content::EME_CODEC_MP4_ALL;
69 content::RenderThread::Get()->Send(
70 new ChromeViewHostMsg_GetSupportedKeySystems(request, &response));
71 DCHECK(response.compositing_codecs & content::EME_CODEC_ALL)
72 << "unrecognized codec";
73 DCHECK(response.non_compositing_codecs & content::EME_CODEC_ALL)
74 << "unrecognized codec";
75 if (response.compositing_codecs != content::EME_CODEC_NONE) {
76 AddWidevineWithCodecs(
77 WIDEVINE,
78 static_cast<SupportedCodecs>(response.compositing_codecs),
79 concrete_key_systems);
80 }
81
82 if (response.non_compositing_codecs != content::EME_CODEC_NONE) {
83 AddWidevineWithCodecs(
84 WIDEVINE_HR_NON_COMPOSITING,
85 static_cast<SupportedCodecs>(response.non_compositing_codecs),
86 concrete_key_systems);
87 }
88 }
89 #endif // OS_ANDROID
90
91 } // namespace cdm 59 } // namespace cdm
92 60
93 #endif // defined(WIDEVINE_CDM_AVAILABLE) 61 #endif // defined(WIDEVINE_CDM_AVAILABLE)
OLDNEW
« no previous file with comments | « components/cdm/renderer/widevine_key_systems.h ('k') | media/base/android/media_drm_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698