Commit 19e4b95f authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Add supported CdmProxy::Protocol to CdmCapability

Also parse supported CdmProxy::Protocol from CDM manifest. For CDMs
supporting hardware secure decryption, the supported CdmProxy protocol
should be specified in CDM manifest, e.g. for kIntel protocol:

"x-cdm-supported-cdm-proxy-protocols": ["intel"],

In the next CL, we'll check whether the supported CdmProxy protocol
is also supported by the system.

Bug: 848532
Test: Updated unit tests.
Change-Id: I59567943620e672d72f72fdadd80cb3ce6c5bcfd
Reviewed-on: https://chromium-review.googlesource.com/1111109
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Reviewed-by: default avatarJohn Rummell <jrummell@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569889}
parent cc2090bd
include_rules = [ include_rules = [
"+media/cdm/cdm_proxy.h",
"+media/cdm/supported_cdm_versions.h", "+media/cdm/supported_cdm_versions.h",
"+ppapi/thunk", "+ppapi/thunk",
"+third_party/widevine" "+third_party/widevine"
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
// rename it to EncryptionScheme. // rename it to EncryptionScheme.
#include "media/base/decrypt_config.h" #include "media/base/decrypt_config.h"
#include "media/base/video_codecs.h" #include "media/base/video_codecs.h"
#include "media/cdm/cdm_proxy.h"
#include "media/cdm/supported_cdm_versions.h" #include "media/cdm/supported_cdm_versions.h"
#include "third_party/widevine/cdm/widevine_cdm_common.h" #include "third_party/widevine/cdm/widevine_cdm_common.h"
...@@ -106,6 +107,8 @@ const char kCdmPersistentLicenseSupportName[] = ...@@ -106,6 +107,8 @@ const char kCdmPersistentLicenseSupportName[] =
"x-cdm-persistent-license-support"; "x-cdm-persistent-license-support";
const char kCdmSupportedEncryptionSchemesName[] = const char kCdmSupportedEncryptionSchemesName[] =
"x-cdm-supported-encryption-schemes"; "x-cdm-supported-encryption-schemes";
const char kCdmSupportedCdmProxyProtocolsName[] =
"x-cdm-supported-cdm-proxy-protocols";
// The following strings are used to specify supported codecs in the // The following strings are used to specify supported codecs in the
// parameter |kCdmCodecsListName|. // parameter |kCdmCodecsListName|.
...@@ -120,6 +123,10 @@ const char kCdmSupportedCodecAvc1[] = "avc1"; ...@@ -120,6 +123,10 @@ const char kCdmSupportedCodecAvc1[] = "avc1";
const char kCdmSupportedEncryptionSchemeCenc[] = "cenc"; const char kCdmSupportedEncryptionSchemeCenc[] = "cenc";
const char kCdmSupportedEncryptionSchemeCbcs[] = "cbcs"; const char kCdmSupportedEncryptionSchemeCbcs[] = "cbcs";
// The following string(s) are used to specify supported CdmProxy protocols in
// the parameter |kCdmSupportedCdmProxyProtocolsName|.
const char kCdmSupportedCdmProxyProtocolIntel[] = "intel";
// Widevine CDM is packaged as a multi-CRX. Widevine CDM binaries are located in // Widevine CDM is packaged as a multi-CRX. Widevine CDM binaries are located in
// _platform_specific/<platform_arch> folder in the package. This function // _platform_specific/<platform_arch> folder in the package. This function
// returns the platform-specific subdirectory that is part of that multi-CRX. // returns the platform-specific subdirectory that is part of that multi-CRX.
...@@ -294,6 +301,47 @@ bool GetEncryptionSchemes( ...@@ -294,6 +301,47 @@ bool GetEncryptionSchemes(
return true; return true;
} }
// Returns true and updates |cdm_proxy_protocols| if the appropriate manifest
// entry is valid. Returns false and does not modify |cdm_proxy_protocols| if
// the manifest entry is incorrectly formatted. Incorrect types in the manifest
// entry will log the error and fail. Unrecognized values will be reported but
// otherwise ignored.
bool GetCdmProxyProtocols(
const base::DictionaryValue& manifest,
base::flat_set<media::CdmProxy::Protocol>* cdm_proxy_protocols) {
const auto* value = manifest.FindKey(kCdmSupportedCdmProxyProtocolsName);
if (!value)
return true;
if (!value->is_list()) {
DLOG(ERROR) << "Manifest entry " << kCdmSupportedCdmProxyProtocolsName
<< " is not a list.";
return false;
}
const base::Value::ListStorage& list = value->GetList();
base::flat_set<media::CdmProxy::Protocol> result;
for (const auto& item : list) {
if (!item.is_string()) {
DLOG(ERROR) << "Unrecognized item type in manifest entry "
<< kCdmSupportedCdmProxyProtocolsName;
return false;
}
const std::string& protocol = item.GetString();
if (protocol == kCdmSupportedCdmProxyProtocolIntel) {
result.insert(media::CdmProxy::Protocol::kIntel);
} else {
DLOG(WARNING) << "Unrecognized CdmProxy protocol" << protocol
<< " in manifest entry "
<< kCdmSupportedCdmProxyProtocolsName;
}
}
cdm_proxy_protocols->swap(result);
return true;
}
// Returns true if the entries in the manifest can be parsed correctly, // Returns true if the entries in the manifest can be parsed correctly,
// false otherwise. Updates |capability|, with the values obtained from the // false otherwise. Updates |capability|, with the values obtained from the
// manifest, if they are provided. If this method returns false, |capability| // manifest, if they are provided. If this method returns false, |capability|
...@@ -302,7 +350,8 @@ bool ParseManifest(const base::DictionaryValue& manifest, ...@@ -302,7 +350,8 @@ bool ParseManifest(const base::DictionaryValue& manifest,
content::CdmCapability* capability) { content::CdmCapability* capability) {
return GetCodecs(manifest, &capability->video_codecs) && return GetCodecs(manifest, &capability->video_codecs) &&
GetEncryptionSchemes(manifest, &capability->encryption_schemes) && GetEncryptionSchemes(manifest, &capability->encryption_schemes) &&
GetSessionTypes(manifest, &capability->session_types); GetSessionTypes(manifest, &capability->session_types) &&
GetCdmProxyProtocols(manifest, &capability->cdm_proxy_protocols);
} }
void RegisterWidevineCdmWithChrome( void RegisterWidevineCdmWithChrome(
......
...@@ -561,7 +561,8 @@ void ChromeContentClient::AddContentDecryptionModules( ...@@ -561,7 +561,8 @@ void ChromeContentClient::AddContentDecryptionModules(
content::CdmCapability capability( content::CdmCapability capability(
{}, {media::EncryptionMode::kCenc, media::EncryptionMode::kCbcs}, {}, {media::EncryptionMode::kCenc, media::EncryptionMode::kCbcs},
{media::CdmSessionType::TEMPORARY_SESSION, {media::CdmSessionType::TEMPORARY_SESSION,
media::CdmSessionType::PERSISTENT_LICENSE_SESSION}); media::CdmSessionType::PERSISTENT_LICENSE_SESSION},
{});
// Register kExternalClearKeyDifferentGuidTestKeySystem first separately. // Register kExternalClearKeyDifferentGuidTestKeySystem first separately.
// Otherwise, it'll be treated as a sub-key-system of normal // Otherwise, it'll be treated as a sub-key-system of normal
......
...@@ -26,6 +26,7 @@ namespace { ...@@ -26,6 +26,7 @@ namespace {
using VideoCodec = media::VideoCodec; using VideoCodec = media::VideoCodec;
using EncryptionMode = media::EncryptionMode; using EncryptionMode = media::EncryptionMode;
using CdmSessionType = media::CdmSessionType; using CdmSessionType = media::CdmSessionType;
using CdmProxy = media::CdmProxy;
const char kTestCdmName[] = "Test CDM"; const char kTestCdmName[] = "Test CDM";
const char kAlternateCdmName[] = "Alternate CDM"; const char kAlternateCdmName[] = "Alternate CDM";
...@@ -56,6 +57,9 @@ bool StlEquals(const Container a, std::initializer_list<T> b) { ...@@ -56,6 +57,9 @@ bool StlEquals(const Container a, std::initializer_list<T> b) {
#define EXPECT_SESSION_TYPES(...) \ #define EXPECT_SESSION_TYPES(...) \
EXPECT_STL_EQ(cdm.capability.session_types, __VA_ARGS__) EXPECT_STL_EQ(cdm.capability.session_types, __VA_ARGS__)
#define EXPECT_CDM_PROXY_PROTOCOLS(...) \
EXPECT_STL_EQ(cdm.capability.cdm_proxy_protocols, __VA_ARGS__)
} // namespace } // namespace
// For simplicity and to make failures easier to diagnose, this test uses // For simplicity and to make failures easier to diagnose, this test uses
...@@ -66,19 +70,19 @@ class CdmRegistryImplTest : public testing::Test { ...@@ -66,19 +70,19 @@ class CdmRegistryImplTest : public testing::Test {
~CdmRegistryImplTest() override {} ~CdmRegistryImplTest() override {}
protected: protected:
void Register(const std::string& name, CdmInfo GetTestCdmInfo() {
const std::string& version, return CdmInfo(kTestCdmName, kTestCdmGuid, base::Version(kVersion1),
const std::string& path, base::FilePath::FromUTF8Unsafe(kTestPath), kTestFileSystemId,
const std::vector<VideoCodec>& video_codecs, CdmCapability({media::kCodecVP8, media::kCodecVP9},
const base::flat_set<CdmSessionType>& session_types, {EncryptionMode::kCenc},
const base::flat_set<EncryptionMode>& encryption_schemes, {CdmSessionType::TEMPORARY_SESSION,
std::string supported_key_system, CdmSessionType::PERSISTENT_LICENSE_SESSION},
bool supports_sub_key_systems = false) { {CdmProxy::Protocol::kIntel}),
cdm_registry_.RegisterCdm( kTestKeySystem, /*supports_sub_key_systems=*/true);
CdmInfo(name, kTestCdmGuid, base::Version(version), }
base::FilePath::FromUTF8Unsafe(path), kTestFileSystemId,
CdmCapability(video_codecs, encryption_schemes, session_types), void Register(CdmInfo cdm_info) {
supported_key_system, supports_sub_key_systems)); cdm_registry_.RegisterCdm(std::move(cdm_info));
} }
bool IsRegistered(const std::string& name, const std::string& version) { bool IsRegistered(const std::string& name, const std::string& version) {
...@@ -103,12 +107,9 @@ class CdmRegistryImplTest : public testing::Test { ...@@ -103,12 +107,9 @@ class CdmRegistryImplTest : public testing::Test {
}; };
TEST_F(CdmRegistryImplTest, Register) { TEST_F(CdmRegistryImplTest, Register) {
Register(kTestCdmName, kVersion1, kTestPath, Register(GetTestCdmInfo());
{media::kCodecVP8, media::kCodecVP9},
{CdmSessionType::TEMPORARY_SESSION, auto cdms = cdm_registry_.GetAllRegisteredCdms();
CdmSessionType::PERSISTENT_LICENSE_SESSION},
{EncryptionMode::kCenc}, kTestKeySystem, true);
std::vector<CdmInfo> cdms = cdm_registry_.GetAllRegisteredCdms();
ASSERT_EQ(1u, cdms.size()); ASSERT_EQ(1u, cdms.size());
CdmInfo cdm = cdms[0]; CdmInfo cdm = cdms[0];
EXPECT_EQ(kTestCdmName, cdm.name); EXPECT_EQ(kTestCdmName, cdm.name);
...@@ -116,44 +117,41 @@ TEST_F(CdmRegistryImplTest, Register) { ...@@ -116,44 +117,41 @@ TEST_F(CdmRegistryImplTest, Register) {
EXPECT_EQ(kTestPath, cdm.path.MaybeAsASCII()); EXPECT_EQ(kTestPath, cdm.path.MaybeAsASCII());
EXPECT_EQ(kTestFileSystemId, cdm.file_system_id); EXPECT_EQ(kTestFileSystemId, cdm.file_system_id);
EXPECT_VIDEO_CODECS(VideoCodec::kCodecVP8, VideoCodec::kCodecVP9); EXPECT_VIDEO_CODECS(VideoCodec::kCodecVP8, VideoCodec::kCodecVP9);
EXPECT_ENCRYPTION_SCHEMES(EncryptionMode::kCenc);
EXPECT_SESSION_TYPES(CdmSessionType::TEMPORARY_SESSION, EXPECT_SESSION_TYPES(CdmSessionType::TEMPORARY_SESSION,
CdmSessionType::PERSISTENT_LICENSE_SESSION); CdmSessionType::PERSISTENT_LICENSE_SESSION);
EXPECT_ENCRYPTION_SCHEMES(EncryptionMode::kCenc); EXPECT_CDM_PROXY_PROTOCOLS(CdmProxy::Protocol::kIntel);
EXPECT_EQ(kTestKeySystem, cdm.supported_key_system); EXPECT_EQ(kTestKeySystem, cdm.supported_key_system);
EXPECT_TRUE(cdm.supports_sub_key_systems); EXPECT_TRUE(cdm.supports_sub_key_systems);
} }
TEST_F(CdmRegistryImplTest, ReRegister) { TEST_F(CdmRegistryImplTest, ReRegister) {
Register(kTestCdmName, kVersion1, "/bb/cc", {}, auto cdm_info = GetTestCdmInfo();
{CdmSessionType::TEMPORARY_SESSION}, {EncryptionMode::kCenc}, Register(cdm_info);
kTestKeySystem);
EXPECT_TRUE(IsRegistered(kTestCdmName, kVersion1)); EXPECT_TRUE(IsRegistered(kTestCdmName, kVersion1));
// Now register same key system with different values. // Now register same key system with different values.
Register(kTestCdmName, kVersion1, kTestPath, {}, cdm_info.supports_sub_key_systems = false;
{CdmSessionType::TEMPORARY_SESSION}, {EncryptionMode::kCenc}, Register(cdm_info);
kTestKeySystem);
EXPECT_TRUE(IsRegistered(kTestCdmName, kVersion1)); EXPECT_TRUE(IsRegistered(kTestCdmName, kVersion1));
} }
TEST_F(CdmRegistryImplTest, MultipleVersions) { TEST_F(CdmRegistryImplTest, MultipleVersions) {
Register(kTestCdmName, kVersion1, kTestPath, {}, auto cdm_info = GetTestCdmInfo();
{CdmSessionType::TEMPORARY_SESSION}, {EncryptionMode::kCenc}, Register(cdm_info);
kTestKeySystem); cdm_info.version = base::Version(kVersion2);
Register(kTestCdmName, kVersion2, "/bb/cc", {}, Register(cdm_info);
{CdmSessionType::TEMPORARY_SESSION}, {EncryptionMode::kCenc},
kTestKeySystem);
EXPECT_TRUE(IsRegistered(kTestCdmName, kVersion1)); EXPECT_TRUE(IsRegistered(kTestCdmName, kVersion1));
EXPECT_TRUE(IsRegistered(kTestCdmName, kVersion2)); EXPECT_TRUE(IsRegistered(kTestCdmName, kVersion2));
} }
TEST_F(CdmRegistryImplTest, NewVersionInsertedLast) { TEST_F(CdmRegistryImplTest, NewVersionInsertedLast) {
Register(kTestCdmName, kVersion1, kTestPath, {}, auto cdm_info = GetTestCdmInfo();
{CdmSessionType::TEMPORARY_SESSION}, {EncryptionMode::kCenc}, Register(cdm_info);
kTestKeySystem); cdm_info.version = base::Version(kVersion2);
Register(kTestCdmName, kVersion2, "/bb/cc", {}, Register(cdm_info);
{CdmSessionType::TEMPORARY_SESSION}, {EncryptionMode::kCenc},
kTestKeySystem);
const std::vector<std::string> versions = GetVersions(kTestCdmGuid); const std::vector<std::string> versions = GetVersions(kTestCdmGuid);
EXPECT_EQ(2u, versions.size()); EXPECT_EQ(2u, versions.size());
...@@ -162,20 +160,20 @@ TEST_F(CdmRegistryImplTest, NewVersionInsertedLast) { ...@@ -162,20 +160,20 @@ TEST_F(CdmRegistryImplTest, NewVersionInsertedLast) {
} }
TEST_F(CdmRegistryImplTest, DifferentNames) { TEST_F(CdmRegistryImplTest, DifferentNames) {
Register(kTestCdmName, kVersion1, kTestPath, {}, auto cdm_info = GetTestCdmInfo();
{CdmSessionType::TEMPORARY_SESSION}, {EncryptionMode::kCenc}, Register(cdm_info);
kTestKeySystem); cdm_info.name = kAlternateCdmName;
Register(kAlternateCdmName, kVersion1, kTestPath, {}, Register(cdm_info);
{CdmSessionType::TEMPORARY_SESSION}, {EncryptionMode::kCbcs},
kTestKeySystem);
EXPECT_TRUE(IsRegistered(kTestCdmName, kVersion1)); EXPECT_TRUE(IsRegistered(kTestCdmName, kVersion1));
EXPECT_TRUE(IsRegistered(kAlternateCdmName, kVersion1)); EXPECT_TRUE(IsRegistered(kAlternateCdmName, kVersion1));
} }
TEST_F(CdmRegistryImplTest, SupportedEncryptionSchemes) { TEST_F(CdmRegistryImplTest, SupportedEncryptionSchemes) {
Register(kTestCdmName, kVersion1, kTestPath, {}, auto cdm_info = GetTestCdmInfo();
{CdmSessionType::TEMPORARY_SESSION}, cdm_info.capability.encryption_schemes = {EncryptionMode::kCenc,
{EncryptionMode::kCenc, EncryptionMode::kCbcs}, kTestKeySystem); EncryptionMode::kCbcs};
Register(cdm_info);
std::vector<CdmInfo> cdms = cdm_registry_.GetAllRegisteredCdms(); std::vector<CdmInfo> cdms = cdm_registry_.GetAllRegisteredCdms();
ASSERT_EQ(1u, cdms.size()); ASSERT_EQ(1u, cdms.size());
......
...@@ -117,6 +117,7 @@ void KeySystemSupportImpl::IsKeySystemSupported( ...@@ -117,6 +117,7 @@ void KeySystemSupportImpl::IsKeySystemSupported(
// TODO(xhwang): Call into GetContentClient()->browser() to get key system // TODO(xhwang): Call into GetContentClient()->browser() to get key system
// specific hardware secure decryption capability on Windows. // specific hardware secure decryption capability on Windows.
// TODO(xhwang): Also check cdm_info->capability.cdm_proxy_protocols.
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
......
...@@ -60,20 +60,25 @@ class KeySystemSupportTest : public testing::Test { ...@@ -60,20 +60,25 @@ class KeySystemSupportTest : public testing::Test {
KeySystemSupportImpl::Create(mojo::MakeRequest(&key_system_support_)); KeySystemSupportImpl::Create(mojo::MakeRequest(&key_system_support_));
} }
// Registers |key_system| with supported capabilities. All other values for // TODO(xhwang): Add tests for hardware secure video codecs and encryption
// CdmInfo have some default value as they're not returned by // schemes.
// IsKeySystemSupported(). CdmCapability GetTestCdmCapability() {
void Register(const std::string& key_system, return CdmCapability({VideoCodec::kCodecVP8, VideoCodec::kCodecVP9},
const std::vector<VideoCodec>& video_codecs, {EncryptionMode::kCenc, EncryptionMode::kCbcs},
const base::flat_set<CdmSessionType>& session_types, {CdmSessionType::TEMPORARY_SESSION,
const base::flat_set<EncryptionMode>& encryption_schemes) { CdmSessionType::PERSISTENT_LICENSE_SESSION},
{});
}
// Registers |key_system| with |capability|. All other values for CdmInfo have
// some default value as they're not returned by IsKeySystemSupported().
void Register(const std::string& key_system, CdmCapability capability) {
DVLOG(1) << __func__; DVLOG(1) << __func__;
CdmRegistry::GetInstance()->RegisterCdm( CdmRegistry::GetInstance()->RegisterCdm(
CdmInfo(key_system, kTestCdmGuid, base::Version(kVersion), CdmInfo(key_system, kTestCdmGuid, base::Version(kVersion),
base::FilePath::FromUTF8Unsafe(kTestPath), kTestFileSystemId, base::FilePath::FromUTF8Unsafe(kTestPath), kTestFileSystemId,
CdmCapability(video_codecs, encryption_schemes, session_types), std::move(capability), key_system, false));
key_system, false));
} }
// Determines if |key_system| is registered. If it is, updates |codecs_| // Determines if |key_system| is registered. If it is, updates |codecs_|
...@@ -103,43 +108,25 @@ TEST_F(KeySystemSupportTest, NoKeySystems) { ...@@ -103,43 +108,25 @@ TEST_F(KeySystemSupportTest, NoKeySystems) {
} }
TEST_F(KeySystemSupportTest, OneKeySystem) { TEST_F(KeySystemSupportTest, OneKeySystem) {
Register("KeySystem2", {VideoCodec::kCodecVP8}, Register("KeySystem2", GetTestCdmCapability());
{CdmSessionType::TEMPORARY_SESSION,
CdmSessionType::PERSISTENT_LICENSE_SESSION},
{EncryptionMode::kCenc, EncryptionMode::kCbcs});
EXPECT_TRUE(IsSupported("KeySystem2")); EXPECT_TRUE(IsSupported("KeySystem2"));
EXPECT_VIDEO_CODECS(VideoCodec::kCodecVP8); EXPECT_VIDEO_CODECS(VideoCodec::kCodecVP8, VideoCodec::kCodecVP9);
EXPECT_ENCRYPTION_SCHEMES(EncryptionMode::kCenc, EncryptionMode::kCbcs); EXPECT_ENCRYPTION_SCHEMES(EncryptionMode::kCenc, EncryptionMode::kCbcs);
EXPECT_SESSION_TYPES(CdmSessionType::TEMPORARY_SESSION, EXPECT_SESSION_TYPES(CdmSessionType::TEMPORARY_SESSION,
CdmSessionType::PERSISTENT_LICENSE_SESSION); CdmSessionType::PERSISTENT_LICENSE_SESSION);
} }
TEST_F(KeySystemSupportTest, MultipleKeySystems) { TEST_F(KeySystemSupportTest, MultipleKeySystems) {
Register("KeySystem3", {VideoCodec::kCodecVP8, VideoCodec::kCodecVP9}, Register("KeySystem3", GetTestCdmCapability());
{CdmSessionType::TEMPORARY_SESSION, Register("KeySystem4", GetTestCdmCapability());
CdmSessionType::PERSISTENT_LICENSE_SESSION},
{EncryptionMode::kCenc});
Register("KeySystem4", {VideoCodec::kCodecVP9},
{CdmSessionType::TEMPORARY_SESSION}, {EncryptionMode::kCbcs});
EXPECT_TRUE(IsSupported("KeySystem3")); EXPECT_TRUE(IsSupported("KeySystem3"));
EXPECT_VIDEO_CODECS(VideoCodec::kCodecVP8, VideoCodec::kCodecVP9);
EXPECT_ENCRYPTION_SCHEMES(EncryptionMode::kCenc);
EXPECT_SESSION_TYPES(CdmSessionType::TEMPORARY_SESSION,
CdmSessionType::PERSISTENT_LICENSE_SESSION);
EXPECT_TRUE(IsSupported("KeySystem4")); EXPECT_TRUE(IsSupported("KeySystem4"));
EXPECT_VIDEO_CODECS(VideoCodec::kCodecVP9);
EXPECT_ENCRYPTION_SCHEMES(EncryptionMode::kCbcs);
EXPECT_SESSION_TYPES(CdmSessionType::TEMPORARY_SESSION);
} }
TEST_F(KeySystemSupportTest, MissingKeySystem) { TEST_F(KeySystemSupportTest, MissingKeySystem) {
Register("KeySystem5", {VideoCodec::kCodecVP8}, Register("KeySystem5", GetTestCdmCapability());
{CdmSessionType::TEMPORARY_SESSION,
CdmSessionType::PERSISTENT_LICENSE_SESSION},
{EncryptionMode::kCenc});
EXPECT_FALSE(IsSupported("KeySystem6")); EXPECT_FALSE(IsSupported("KeySystem6"));
EXPECT_FALSE(capability_); EXPECT_FALSE(capability_);
......
...@@ -14,10 +14,12 @@ CdmCapability::CdmCapability() = default; ...@@ -14,10 +14,12 @@ CdmCapability::CdmCapability() = default;
CdmCapability::CdmCapability( CdmCapability::CdmCapability(
std::vector<media::VideoCodec> video_codecs, std::vector<media::VideoCodec> video_codecs,
base::flat_set<media::EncryptionMode> encryption_schemes, base::flat_set<media::EncryptionMode> encryption_schemes,
base::flat_set<media::CdmSessionType> session_types) base::flat_set<media::CdmSessionType> session_types,
base::flat_set<media::CdmProxy::Protocol> cdm_proxy_protocols)
: video_codecs(std::move(video_codecs)), : video_codecs(std::move(video_codecs)),
encryption_schemes(std::move(encryption_schemes)), encryption_schemes(std::move(encryption_schemes)),
session_types(std::move(session_types)) {} session_types(std::move(session_types)),
cdm_proxy_protocols(std::move(cdm_proxy_protocols)) {}
CdmCapability::CdmCapability(const CdmCapability& other) = default; CdmCapability::CdmCapability(const CdmCapability& other) = default;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
// rename it to EncryptionScheme. // rename it to EncryptionScheme.
#include "media/base/decrypt_config.h" #include "media/base/decrypt_config.h"
#include "media/base/video_codecs.h" #include "media/base/video_codecs.h"
#include "media/cdm/cdm_proxy.h"
namespace content { namespace content {
...@@ -25,7 +26,8 @@ struct CONTENT_EXPORT CdmCapability { ...@@ -25,7 +26,8 @@ struct CONTENT_EXPORT CdmCapability {
CdmCapability(); CdmCapability();
CdmCapability(std::vector<media::VideoCodec> video_codecs, CdmCapability(std::vector<media::VideoCodec> video_codecs,
base::flat_set<media::EncryptionMode> encryption_schemes, base::flat_set<media::EncryptionMode> encryption_schemes,
base::flat_set<media::CdmSessionType> session_types); base::flat_set<media::CdmSessionType> session_types,
base::flat_set<media::CdmProxy::Protocol> cdm_proxy_protocols);
CdmCapability(const CdmCapability& other); CdmCapability(const CdmCapability& other);
~CdmCapability(); ~CdmCapability();
...@@ -41,6 +43,10 @@ struct CONTENT_EXPORT CdmCapability { ...@@ -41,6 +43,10 @@ struct CONTENT_EXPORT CdmCapability {
// List of session types supported by the CDM. // List of session types supported by the CDM.
base::flat_set<media::CdmSessionType> session_types; base::flat_set<media::CdmSessionType> session_types;
// List of CdmProxy protocols supported by the CDM. These protocols should
// also be supported by the system to support hardware secure decryption.
base::flat_set<media::CdmProxy::Protocol> cdm_proxy_protocols;
}; };
// Represents a Content Decryption Module implementation and its capabilities. // Represents a Content Decryption Module implementation and its capabilities.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment