0

[Chromecast] Use CdmConfig to create CDM

1. Pass CdmConfig to CreatePlatformBrowserCdm.
2. Add |force_software_crypto| to AddChromecastKeySystems. When enable,
cast should use software based OEMCrypto in Widevine.

The CL just adds the parameter to the function, corresponding action
isn't added.

BUG=internal b/31575507
TEST=None

Review-Url: https://codereview.chromium.org/2478453002
Cr-Commit-Position: refs/heads/master@{#429668}
This commit is contained in:
yucliu
2016-11-03 12:19:30 -07:00
committed by Commit bot
parent 17efc52ce3
commit 83362159d9
5 changed files with 17 additions and 9 deletions

@ -43,16 +43,14 @@ void CastCdmFactory::Create(
::media::CdmCreatedCB bound_cdm_created_cb =
::media::BindToCurrentLoop(cdm_created_cb);
DCHECK(!cdm_config.use_hw_secure_codecs)
<< "Chromecast does not use |use_hw_secure_codecs|";
CastKeySystem cast_key_system(GetKeySystemByName(key_system));
scoped_refptr<chromecast::media::CastCdm> cast_cdm;
if (cast_key_system == chromecast::media::KEY_SYSTEM_CLEAR_KEY) {
// TODO(gunsch): handle ClearKey decryption. See crbug.com/441957
} else {
cast_cdm = CreatePlatformBrowserCdm(cast_key_system, security_origin);
cast_cdm =
CreatePlatformBrowserCdm(cast_key_system, security_origin, cdm_config);
}
if (!cast_cdm) {
@ -80,7 +78,8 @@ void CastCdmFactory::Create(
scoped_refptr<CastCdm> CastCdmFactory::CreatePlatformBrowserCdm(
const CastKeySystem& cast_key_system,
const GURL& security_origin) {
const GURL& security_origin,
const ::media::CdmConfig& cdm_config) {
return nullptr;
}

@ -15,6 +15,10 @@ namespace base {
class SingleThreadTaskRunner;
} // namespace base
namespace media {
struct CdmConfig;
} // namespace media
namespace chromecast {
namespace media {
@ -41,7 +45,8 @@ class CastCdmFactory : public ::media::CdmFactory {
// Provides a platform-specific BrowserCdm instance.
virtual scoped_refptr<CastCdm> CreatePlatformBrowserCdm(
const CastKeySystem& cast_key_system,
const GURL& security_origin);
const GURL& security_origin,
const ::media::CdmConfig& cdm_config);
protected:
MediaResourceTracker* media_resource_tracker_;

@ -117,7 +117,9 @@ void CastContentRendererClient::RenderViewCreated(
void CastContentRendererClient::AddSupportedKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>*
key_systems_properties) {
AddChromecastKeySystems(key_systems_properties, false);
AddChromecastKeySystems(key_systems_properties,
false /* enable_persistent_license_support */,
false /* force_software_crypto */);
}
blink::WebPrescientNetworking*

@ -86,7 +86,8 @@ class PlayReadyKeySystemProperties : public ::media::KeySystemProperties {
void AddChromecastKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>*
key_systems_properties,
bool enable_persistent_license_support) {
bool enable_persistent_license_support,
bool force_software_crypto) {
#if defined(PLAYREADY_CDM_AVAILABLE)
#if defined(OS_ANDROID)
CHECK(!enable_persistent_license_support);

@ -18,7 +18,8 @@ namespace shell {
void AddChromecastKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>*
key_systems_properties,
bool enable_persistent_license_support);
bool enable_persistent_license_support,
bool force_software_crypto);
} // namespace shell
} // namespace chromecast