OLD | NEW |
---|---|
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 "chromecast/media/base/key_systems_common.h" | 11 #include "chromecast/media/base/key_systems_common.h" |
12 #include "components/cdm/renderer/widevine_key_systems.h" | 12 #include "components/cdm/renderer/widevine_key_systems.h" |
13 #include "media/base/eme_constants.h" | 13 #include "media/base/eme_constants.h" |
14 | 14 |
15 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 15 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
16 | 16 |
17 using ::media::EmeFeatureSupport; | |
18 using ::media::EmeRobustness; | |
19 using ::media::EmeSessionTypeSupport; | |
20 | |
17 namespace chromecast { | 21 namespace chromecast { |
18 namespace shell { | 22 namespace shell { |
19 | 23 |
20 void AddKeySystemWithCodecs( | 24 void AddKeySystemWithCodecs( |
21 const std::string& key_system_name, | 25 const std::string& key_system_name, |
22 std::vector<::media::KeySystemInfo>* key_systems_info) { | 26 std::vector<::media::KeySystemInfo>* key_systems_info) { |
23 ::media::KeySystemInfo info; | 27 ::media::KeySystemInfo info; |
24 info.key_system = key_system_name; | 28 info.key_system = key_system_name; |
25 info.supported_init_data_types = ::media::kInitDataTypeMaskCenc; | 29 info.supported_init_data_types = ::media::kInitDataTypeMaskCenc; |
26 info.supported_codecs = | 30 info.supported_codecs = |
27 ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1; | 31 ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1; |
28 info.max_audio_robustness = ::media::EmeRobustness::EMPTY; | 32 info.max_audio_robustness = ::media::EmeRobustness::EMPTY; |
29 info.max_video_robustness = ::media::EmeRobustness::EMPTY; | 33 info.max_video_robustness = ::media::EmeRobustness::EMPTY; |
30 info.persistent_license_support = | 34 info.persistent_license_support = |
31 ::media::EmeSessionTypeSupport::NOT_SUPPORTED; | 35 ::media::EmeSessionTypeSupport::NOT_SUPPORTED; |
32 info.persistent_release_message_support = | 36 info.persistent_release_message_support = |
33 ::media::EmeSessionTypeSupport::NOT_SUPPORTED; | 37 ::media::EmeSessionTypeSupport::NOT_SUPPORTED; |
34 info.persistent_state_support = ::media::EmeFeatureSupport::ALWAYS_ENABLED; | 38 info.persistent_state_support = ::media::EmeFeatureSupport::ALWAYS_ENABLED; |
35 info.distinctive_identifier_support = | 39 info.distinctive_identifier_support = |
36 ::media::EmeFeatureSupport::ALWAYS_ENABLED; | 40 ::media::EmeFeatureSupport::ALWAYS_ENABLED; |
37 key_systems_info->push_back(info); | 41 key_systems_info->push_back(info); |
38 } | 42 } |
39 | 43 |
40 void AddChromecastKeySystems( | 44 void AddChromecastKeySystems( |
41 std::vector<::media::KeySystemInfo>* key_systems_info) { | 45 std::vector<::media::KeySystemInfo>* key_systems_info) { |
42 #if defined(WIDEVINE_CDM_AVAILABLE) | 46 #if defined(WIDEVINE_CDM_AVAILABLE) |
47 ::media::SupportedCodecs codecs = | |
48 ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1; | |
43 AddWidevineWithCodecs( | 49 AddWidevineWithCodecs( |
44 cdm::WIDEVINE, ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1, | 50 cdm::WIDEVINE, |
45 ::media::EmeRobustness::HW_SECURE_ALL, // Max audio robustness. | 51 codecs, // Regular codecs. |
46 ::media::EmeRobustness::HW_SECURE_ALL, // Max video robustness. | 52 #if defined(OS_ANDROID) |
47 ::media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. | 53 codecs, // Hardware-secure codecs. |
ddorwin
2015/05/01 22:26:13
Hmm. We should have someone from Cast on Android l
sandersd (OOO until July 31)
2015/05/01 22:33:21
Possibly. However, since they are specifically lis
ddorwin
2015/05/01 23:08:45
Acknowledged.
You'll at least need an OWNER to rev
| |
48 ::media::EmeSessionTypeSupport:: | 54 #endif // defined(OS_ANDROID) |
49 NOT_SUPPORTED, // persistent-release-message. | 55 EmeRobustness::HW_SECURE_ALL, // Max audio robustness. |
56 EmeRobustness::HW_SECURE_ALL, // Max video robustness. | |
57 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. | |
58 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-release-message. | |
50 // Note: On Chromecast, all CDMs may have persistent state. | 59 // Note: On Chromecast, all CDMs may have persistent state. |
51 ::media::EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state. | 60 EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state. |
52 ::media::EmeFeatureSupport::ALWAYS_ENABLED, // Distinctive | 61 EmeFeatureSupport::ALWAYS_ENABLED, // Distinctive identifier. |
53 // identifier. | |
54 key_systems_info); | 62 key_systems_info); |
55 #endif | 63 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
56 | 64 |
57 #if defined(PLAYREADY_CDM_AVAILABLE) | 65 #if defined(PLAYREADY_CDM_AVAILABLE) |
58 AddKeySystemWithCodecs(media::kChromecastPlayreadyKeySystem, | 66 AddKeySystemWithCodecs(media::kChromecastPlayreadyKeySystem, |
59 key_systems_info); | 67 key_systems_info); |
60 #endif | 68 #endif // defined(PLAYREADY_CDM_AVAILABLE) |
61 } | 69 } |
62 | 70 |
63 } // namespace shell | 71 } // namespace shell |
64 } // namespace chromecast | 72 } // namespace chromecast |
OLD | NEW |