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

Side by Side Diff: chromecast/renderer/key_systems_cast.cc

Issue 1926533002: Convert Widevine and Android platform key systems to KeySystemProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Few small cleanups Created 4 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
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 "chromecast/renderer/key_systems_cast.h" 5 #include "chromecast/renderer/key_systems_cast.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "chromecast/media/base/key_systems_common.h" 12 #include "chromecast/media/base/key_systems_common.h"
13 #include "components/cdm/renderer/widevine_key_systems.h" 13 #include "components/cdm/renderer/widevine_key_system_properties.h"
14 #include "media/base/eme_constants.h" 14 #include "media/base/eme_constants.h"
15 15
16 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
17
18 using ::media::EmeFeatureSupport; 16 using ::media::EmeFeatureSupport;
19 using ::media::EmeRobustness; 17 using ::media::EmeRobustness;
20 using ::media::EmeSessionTypeSupport; 18 using ::media::EmeSessionTypeSupport;
21 19
22 namespace chromecast { 20 namespace chromecast {
23 namespace shell { 21 namespace shell {
24 22
25 void AddKeySystemWithCodecs( 23 void AddKeySystemWithCodecs(
26 const std::string& key_system_name, 24 const std::string& key_system_name,
27 std::vector<::media::KeySystemInfo>* key_systems_info) { 25 std::vector<::media::KeySystemInfo>* key_systems_info) {
(...skipping 13 matching lines...) Expand all
41 #endif 39 #endif
42 info.persistent_release_message_support = 40 info.persistent_release_message_support =
43 ::media::EmeSessionTypeSupport::NOT_SUPPORTED; 41 ::media::EmeSessionTypeSupport::NOT_SUPPORTED;
44 info.persistent_state_support = ::media::EmeFeatureSupport::ALWAYS_ENABLED; 42 info.persistent_state_support = ::media::EmeFeatureSupport::ALWAYS_ENABLED;
45 info.distinctive_identifier_support = 43 info.distinctive_identifier_support =
46 ::media::EmeFeatureSupport::ALWAYS_ENABLED; 44 ::media::EmeFeatureSupport::ALWAYS_ENABLED;
47 key_systems_info->push_back(info); 45 key_systems_info->push_back(info);
48 } 46 }
49 47
50 void AddChromecastKeySystems( 48 void AddChromecastKeySystems(
51 std::vector<::media::KeySystemInfo>* key_systems_info) { 49 std::vector<std::unique_ptr<::media::KeySystemProperties>>*
50 key_systems_properties) {
52 #if defined(WIDEVINE_CDM_AVAILABLE) 51 #if defined(WIDEVINE_CDM_AVAILABLE)
53 ::media::SupportedCodecs codecs = 52 ::media::SupportedCodecs codecs =
54 ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1 | 53 ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1 |
55 ::media::EME_CODEC_WEBM_VP8 | ::media::EME_CODEC_WEBM_VP9; 54 ::media::EME_CODEC_WEBM_VP8 | ::media::EME_CODEC_WEBM_VP9;
56 cdm::AddWidevineWithCodecs( 55 key_systems->emplace_back(new cdm::WidevineKeySystemProperties(
57 codecs, // Regular codecs. 56 codecs, // Regular codecs.
58 #if defined(OS_ANDROID) 57 #if defined(OS_ANDROID)
59 codecs, // Hardware-secure codecs. 58 codecs, // Hardware-secure codecs.
60 #endif // defined(OS_ANDROID) 59 #endif
61 EmeRobustness::HW_SECURE_ALL, // Max audio robustness. 60 ::media::EmeRobustness::HW_SECURE_ALL, // Max audio robustness.
xhwang 2016/04/27 19:28:39 OOC, how did this work before without ::media::?
halliwell 2016/04/27 22:20:13 Oh, there are some using statements at the top. I
62 EmeRobustness::HW_SECURE_ALL, // Max video robustness. 61 ::media::EmeRobustness::HW_SECURE_ALL, // Max video robustness.
63 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. 62 ::media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license.
64 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-release-message. 63 ::media::EmeSessionTypeSupport::
64 NOT_SUPPORTED, // persistent-release-message.
65 // Note: On Chromecast, all CDMs may have persistent state. 65 // Note: On Chromecast, all CDMs may have persistent state.
66 EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state. 66 ::media::EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state.
67 EmeFeatureSupport::ALWAYS_ENABLED, // Distinctive identifier. 67 ::media::EmeFeatureSupport::ALWAYS_ENABLED)); // Distinctive identifier.
68 key_systems_info);
69 #endif // defined(WIDEVINE_CDM_AVAILABLE) 68 #endif // defined(WIDEVINE_CDM_AVAILABLE)
69 }
70 70
71 void AddChromecastKeySystemsInfo(
72 std::vector<::media::KeySystemInfo>* key_systems_info) {
71 #if defined(PLAYREADY_CDM_AVAILABLE) 73 #if defined(PLAYREADY_CDM_AVAILABLE)
72 AddKeySystemWithCodecs(media::kChromecastPlayreadyKeySystem, 74 AddKeySystemWithCodecs(media::kChromecastPlayreadyKeySystem,
73 key_systems_info); 75 key_systems_info);
74 #endif // defined(PLAYREADY_CDM_AVAILABLE) 76 #endif // defined(PLAYREADY_CDM_AVAILABLE)
75 } 77 }
76 78
77 } // namespace shell 79 } // namespace shell
78 } // namespace chromecast 80 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698