|
20 | 20 | #include "content/public/common/user_agent.h" |
21 | 21 | #include "media/media_features.h" |
22 | 22 | #include "ppapi/shared_impl/ppapi_permissions.h" |
23 | | -#include "third_party/widevine/cdm/stub/widevine_cdm_version.h" |
24 | 23 | #include "ui/base/l10n/l10n_util.h" |
25 | 24 | #include "url/url_constants.h" |
26 | 25 |
|
@@ -90,20 +89,6 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path, |
90 | 89 | kWidevineCdmPluginMimeType, kWidevineCdmPluginExtension, |
91 | 90 | kWidevineCdmPluginMimeTypeDescription); |
92 | 91 |
|
93 | | - // Add the supported codecs as if they came from the component manifest. |
94 | | - std::vector<std::string> codecs; |
95 | | - codecs.push_back(kCdmSupportedCodecVp8); |
96 | | - codecs.push_back(kCdmSupportedCodecVp9); |
97 | | -#if BUILDFLAG(USE_PROPRIETARY_CODECS) |
98 | | - codecs.push_back(kCdmSupportedCodecAvc1); |
99 | | -#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) |
100 | | - std::string codec_string = base::JoinString( |
101 | | - codecs, std::string(1, kCdmSupportedCodecsValueDelimiter)); |
102 | | - widevine_cdm_mime_type.additional_param_names.push_back( |
103 | | - base::ASCIIToUTF16(kCdmSupportedCodecsParamName)); |
104 | | - widevine_cdm_mime_type.additional_param_values.push_back( |
105 | | - base::ASCIIToUTF16(codec_string)); |
106 | | - |
107 | 92 | widevine_cdm.mime_types.push_back(widevine_cdm_mime_type); |
108 | 93 | widevine_cdm.permissions = kWidevineCdmPluginPermissions; |
109 | 94 |
|
@@ -224,4 +209,36 @@ void AtomContentClient::AddPepperPlugins( |
224 | 209 | #endif // defined(ENABLE_PDF_VIEWER) |
225 | 210 | } |
226 | 211 |
|
| 212 | +void AtomContentClient::AddContentDecryptionModules( |
| 213 | + std::vector<content::CdmInfo>* cdms, |
| 214 | + std::vector<media::CdmHostFilePath>* cdm_host_file_paths) { |
| 215 | +#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS) |
| 216 | + auto command_line = base::CommandLine::ForCurrentProcess(); |
| 217 | + base::FilePath widevine_cdm_path = |
| 218 | + command_line->GetSwitchValuePath(switches::kWidevineCdmPath); |
| 219 | + if (widevine_cdm_path.empty()) |
| 220 | + return; |
| 221 | + |
| 222 | + if (!base::PathExists(widevine_cdm_path)) |
| 223 | + return; |
| 224 | + |
| 225 | + auto widevine_cdm_version = |
| 226 | + command_line->GetSwitchValueASCII(switches::kWidevineCdmVersion); |
| 227 | + if (widevine_cdm_version.empty()) |
| 228 | + return; |
| 229 | + |
| 230 | + std::vector<media::VideoCodec> supported_video_codecs; |
| 231 | + supported_video_codecs.push_back(media::VideoCodec::kCodecVP8); |
| 232 | + supported_video_codecs.push_back(media::VideoCodec::kCodecVP9); |
| 233 | +#if BUILDFLAG(USE_PROPRIETARY_CODECS) |
| 234 | + supported_video_codecs.push_back(media::VideoCodec::kCodecH264); |
| 235 | +#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) |
| 236 | + content::CdmRegistry::GetInstance()->RegisterCdm( |
| 237 | + content::CdmInfo(kWidevineCdmDisplayName, kWidevineCdmGuid, |
| 238 | + base::Version(widevine_cdm_version), widevine_cdm_path, |
| 239 | + kWidevineCdmFileSystemId, supported_video_codecs, false, |
| 240 | + kWidevineKeySystem, false)); |
| 241 | +#endif // defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS) |
| 242 | +} |
| 243 | + |
227 | 244 | } // namespace atom |
0 commit comments