1 // Copyright 2013 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.
5 #include "android_webview/renderer/aw_key_systems.h"
9 #include "base/command_line.h"
10 #include "base/logging.h"
11 #include "content/public/common/eme_codec.h"
12 #include "third_party/widevine/cdm/widevine_cdm_common.h"
14 using content::KeySystemInfo
;
18 // Return |name|'s parent key system.
19 std::string
GetDirectParentName(const std::string
& name
) {
20 int last_period
= name
.find_last_of('.');
21 DCHECK_GT(last_period
, 0);
22 return name
.substr(0, last_period
);
25 void AddWidevineWithCodecs(const std::string
& key_system_name
,
27 std::vector
<KeySystemInfo
>* concrete_key_systems
) {
28 KeySystemInfo
info(key_system_name
);
31 info
.parent_key_system
= GetDirectParentName(key_system_name
);
33 info
.supported_codecs
= content::EME_CODEC_MP4_ALL
;
35 concrete_key_systems
->push_back(info
);
40 namespace android_webview
{
43 std::vector
<KeySystemInfo
>* key_systems_info
) {
44 AddWidevineWithCodecs(kWidevineKeySystem
, true, key_systems_info
);
47 } // namespace android_webview