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

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

Issue 2268283003: media: Add External Clear Key content browser test on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 2 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
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/android_key_systems.h" 5 #include "components/cdm/renderer/android_key_systems.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 EmeFeatureSupport GetDistinctiveIdentifierSupport() const override { 85 EmeFeatureSupport GetDistinctiveIdentifierSupport() const override {
86 return EmeFeatureSupport::ALWAYS_ENABLED; 86 return EmeFeatureSupport::ALWAYS_ENABLED;
87 } 87 }
88 88
89 private: 89 private:
90 const std::string name_; 90 const std::string name_;
91 const SupportedCodecs supported_codecs_; 91 const SupportedCodecs supported_codecs_;
92 }; 92 };
93 93
94 } // namespace 94 SupportedKeySystemResponse QueryKeySystemSupport(
95
96 static SupportedKeySystemResponse QueryKeySystemSupport(
97 const std::string& key_system) { 95 const std::string& key_system) {
98 SupportedKeySystemRequest request; 96 SupportedKeySystemRequest request;
99 SupportedKeySystemResponse response; 97 SupportedKeySystemResponse response;
100 98
101 request.key_system = key_system; 99 request.key_system = key_system;
102 request.codecs = media::EME_CODEC_ALL; 100 request.codecs = media::EME_CODEC_ALL;
103 content::RenderThread::Get()->Send( 101 content::RenderThread::Get()->Send(
104 new ChromeViewHostMsg_QueryKeySystemSupport(request, &response)); 102 new ChromeViewHostMsg_QueryKeySystemSupport(request, &response));
105 DCHECK(!(response.compositing_codecs & ~media::EME_CODEC_ALL)) 103 DCHECK(!(response.compositing_codecs & ~media::EME_CODEC_ALL))
106 << "unrecognized codec"; 104 << "unrecognized codec";
107 DCHECK(!(response.non_compositing_codecs & ~media::EME_CODEC_ALL)) 105 DCHECK(!(response.non_compositing_codecs & ~media::EME_CODEC_ALL))
108 << "unrecognized codec"; 106 << "unrecognized codec";
109 return response; 107 return response;
110 } 108 }
111 109
110 } // namespace
111
112 void AddAndroidWidevine( 112 void AddAndroidWidevine(
113 std::vector<std::unique_ptr<KeySystemProperties>>* concrete_key_systems) { 113 std::vector<std::unique_ptr<KeySystemProperties>>* concrete_key_systems) {
114 SupportedKeySystemResponse response = QueryKeySystemSupport( 114 SupportedKeySystemResponse response = QueryKeySystemSupport(
115 kWidevineKeySystem); 115 kWidevineKeySystem);
116 116
117 // Since we do not control the implementation of the MediaDrm API on Android, 117 // Since we do not control the implementation of the MediaDrm API on Android,
118 // we assume that it can and will make use of persistence even though no 118 // we assume that it can and will make use of persistence even though no
119 // persistence-based features are supported. 119 // persistence-based features are supported.
120 120
121 if (response.compositing_codecs != media::EME_CODEC_NONE) { 121 if (response.compositing_codecs != media::EME_CODEC_NONE) {
(...skipping 22 matching lines...) Expand all
144 it != key_system_names.end(); ++it) { 144 it != key_system_names.end(); ++it) {
145 SupportedKeySystemResponse response = QueryKeySystemSupport(*it); 145 SupportedKeySystemResponse response = QueryKeySystemSupport(*it);
146 if (response.compositing_codecs != media::EME_CODEC_NONE) { 146 if (response.compositing_codecs != media::EME_CODEC_NONE) {
147 concrete_key_systems->emplace_back(new AndroidPlatformKeySystemProperties( 147 concrete_key_systems->emplace_back(new AndroidPlatformKeySystemProperties(
148 *it, response.compositing_codecs)); 148 *it, response.compositing_codecs));
149 } 149 }
150 } 150 }
151 } 151 }
152 152
153 } // namespace cdm 153 } // namespace cdm
OLDNEW
« no previous file with comments | « components/cdm/renderer/BUILD.gn ('k') | components/cdm/renderer/external_clear_key_key_system_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698