Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 "android_webview/renderer/aw_key_systems.h" | 5 #include "android_webview/renderer/aw_key_systems.h" |
| 6 | 6 |
| 7 #include <string> | |
| 8 | |
| 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" | |
| 13 | |
| 14 using content::KeySystemInfo; | 7 using content::KeySystemInfo; |
|
Tom Sepez
2014/04/28 18:21:52
nit: the identifier KeySystemInfo now appears but
| |
| 15 | 8 |
| 16 namespace { | |
| 17 | |
| 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); | |
| 23 } | |
| 24 | |
| 25 void AddWidevineWithCodecs(const std::string& key_system_name, | |
| 26 bool add_parent_name, | |
| 27 std::vector<KeySystemInfo>* concrete_key_systems) { | |
| 28 KeySystemInfo info(key_system_name); | |
| 29 | |
| 30 if (add_parent_name) | |
| 31 info.parent_key_system = GetDirectParentName(key_system_name); | |
| 32 | |
| 33 info.supported_codecs = content::EME_CODEC_MP4_ALL; | |
| 34 | |
| 35 concrete_key_systems->push_back(info); | |
| 36 } | |
| 37 | |
| 38 } // namespace | |
| 39 | |
| 40 namespace android_webview { | 9 namespace android_webview { |
| 41 | 10 |
| 42 void AwAddKeySystems( | 11 void AwAddKeySystems( |
| 43 std::vector<KeySystemInfo>* key_systems_info) { | 12 std::vector<KeySystemInfo>* key_systems_info) { |
| 44 AddWidevineWithCodecs(kWidevineKeySystem, true, key_systems_info); | 13 // TODO(ycheo): Add the keysystems read from the configuration file. |
| 45 } | 14 } |
| 46 | 15 |
| 47 } // namespace android_webview | 16 } // namespace android_webview |
| OLD | NEW |