Chromium Code Reviews| 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 "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 { |
| 22 namespace { | |
| 24 | 23 |
| 24 #if defined(PLAYREADY_CDM_AVAILABLE) | |
| 25 void AddKeySystemWithCodecs( | 25 void AddKeySystemWithCodecs( |
| 26 const std::string& key_system_name, | 26 const std::string& key_system_name, |
| 27 std::vector<::media::KeySystemInfo>* key_systems_info) { | 27 std::vector<::media::KeySystemInfo>* key_systems_info) { |
| 28 ::media::KeySystemInfo info; | 28 ::media::KeySystemInfo info; |
| 29 info.key_system = key_system_name; | 29 info.key_system = key_system_name; |
| 30 info.supported_init_data_types = ::media::kInitDataTypeMaskCenc; | 30 info.supported_init_data_types = ::media::kInitDataTypeMaskCenc; |
| 31 info.supported_codecs = | 31 info.supported_codecs = |
| 32 ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1; | 32 ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1; |
| 33 info.max_audio_robustness = ::media::EmeRobustness::EMPTY; | 33 info.max_audio_robustness = EmeRobustness::EMPTY; |
| 34 info.max_video_robustness = ::media::EmeRobustness::EMPTY; | 34 info.max_video_robustness = EmeRobustness::EMPTY; |
| 35 #if defined(OS_ANDROID) | 35 #if defined(OS_ANDROID) |
| 36 info.persistent_license_support = | 36 info.persistent_license_support = EmeSessionTypeSupport::NOT_SUPPORTED; |
| 37 ::media::EmeSessionTypeSupport::NOT_SUPPORTED; | |
| 38 #else | 37 #else |
| 39 info.persistent_license_support = | 38 info.persistent_license_support = EmeSessionTypeSupport::SUPPORTED; |
| 40 ::media::EmeSessionTypeSupport::SUPPORTED; | |
| 41 #endif | 39 #endif |
| 42 info.persistent_release_message_support = | 40 info.persistent_release_message_support = |
| 43 ::media::EmeSessionTypeSupport::NOT_SUPPORTED; | 41 EmeSessionTypeSupport::NOT_SUPPORTED; |
| 44 info.persistent_state_support = ::media::EmeFeatureSupport::ALWAYS_ENABLED; | 42 info.persistent_state_support = EmeFeatureSupport::ALWAYS_ENABLED; |
| 45 info.distinctive_identifier_support = | 43 info.distinctive_identifier_support = EmeFeatureSupport::ALWAYS_ENABLED; |
| 46 ::media::EmeFeatureSupport::ALWAYS_ENABLED; | |
| 47 key_systems_info->push_back(info); | 44 key_systems_info->push_back(info); |
| 48 } | 45 } |
| 46 #endif // defined(PLAYREADY_CDM_AVAILABLE) | |
| 47 | |
| 48 } // namespace | |
| 49 | 49 |
| 50 void AddChromecastKeySystems( | 50 void AddChromecastKeySystems( |
| 51 std::vector<::media::KeySystemInfo>* key_systems_info) { | 51 std::vector<std::unique_ptr<::media::KeySystemProperties>>* |
| 52 key_systems_properties) { | |
| 52 #if defined(WIDEVINE_CDM_AVAILABLE) | 53 #if defined(WIDEVINE_CDM_AVAILABLE) |
|
ddorwin
2016/04/27 22:41:54
The header that defines this was removed. Does chr
halliwell
2016/04/27 23:50:45
Good point, restored the header for now (we might
| |
| 53 ::media::SupportedCodecs codecs = | 54 ::media::SupportedCodecs codecs = |
| 54 ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1 | | 55 ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1 | |
| 55 ::media::EME_CODEC_WEBM_VP8 | ::media::EME_CODEC_WEBM_VP9; | 56 ::media::EME_CODEC_WEBM_VP8 | ::media::EME_CODEC_WEBM_VP9; |
| 56 cdm::AddWidevineWithCodecs( | 57 key_systems->emplace_back(new cdm::WidevineKeySystemProperties( |
| 57 codecs, // Regular codecs. | 58 codecs, // Regular codecs. |
| 58 #if defined(OS_ANDROID) | 59 #if defined(OS_ANDROID) |
| 59 codecs, // Hardware-secure codecs. | 60 codecs, // Hardware-secure codecs. |
| 60 #endif // defined(OS_ANDROID) | 61 #endif |
| 61 EmeRobustness::HW_SECURE_ALL, // Max audio robustness. | 62 EmeRobustness::HW_SECURE_ALL, // Max audio robustness. |
| 62 EmeRobustness::HW_SECURE_ALL, // Max video robustness. | 63 EmeRobustness::HW_SECURE_ALL, // Max video robustness. |
| 63 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. | 64 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. |
| 64 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-release-message. | 65 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-release-message. |
| 65 // Note: On Chromecast, all CDMs may have persistent state. | 66 // Note: On Chromecast, all CDMs may have persistent state. |
| 66 EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state. | 67 EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state. |
| 67 EmeFeatureSupport::ALWAYS_ENABLED, // Distinctive identifier. | 68 EmeFeatureSupport::ALWAYS_ENABLED)); // Distinctive identifier. |
| 68 key_systems_info); | |
| 69 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 69 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 70 } | |
| 70 | 71 |
| 72 void AddChromecastKeySystemsInfo( | |
| 73 std::vector<::media::KeySystemInfo>* key_systems_info) { | |
| 71 #if defined(PLAYREADY_CDM_AVAILABLE) | 74 #if defined(PLAYREADY_CDM_AVAILABLE) |
| 72 AddKeySystemWithCodecs(media::kChromecastPlayreadyKeySystem, | 75 AddKeySystemWithCodecs(media::kChromecastPlayreadyKeySystem, |
|
ddorwin
2016/04/27 22:41:54
If ECK is converted, this would be the only reason
halliwell
2016/04/27 23:50:45
Yep, I was planning to do ECK and Chromecast PR ne
| |
| 73 key_systems_info); | 76 key_systems_info); |
| 74 #endif // defined(PLAYREADY_CDM_AVAILABLE) | 77 #endif // defined(PLAYREADY_CDM_AVAILABLE) |
| 75 } | 78 } |
| 76 | 79 |
| 77 } // namespace shell | 80 } // namespace shell |
| 78 } // namespace chromecast | 81 } // namespace chromecast |
| OLD | NEW |