Added CDM support for Watermarking reporting.

[ Merge of http://go/wvgerrit/148552 ]

Extended the CDM layer to report OEMCrypto's watermarking support.
The reporting of watermarking comes in three (3) mechanisms:
1) ClientCapabilities in license requests
2) CryptoSession metrics when queried to OEMCrypto
3) String property query by apps

If OEMCrypto implementents OEMCrypto_GetWatermarkingSupport(), then
the reported watermarking support by the CDM will match that of
OEMCrypto.

If OEMCrypto does not implement OEMCrypto_GetWatermarkingSupport()
or an error occurs, it is assumed that OEMCrypto does not support
watermarking, and the CDM will report "Not Supported".

Bug: 226443788
Test: run_x86_64_tests request_license_test and license_unittest
Change-Id: Id929a356c395e6bcf45d371ee6887eec40d35329
This commit is contained in:
Alex Dale
2022-03-23 17:00:32 -07:00
parent 0a65e3ba32
commit 97f3544866
22 changed files with 191 additions and 9 deletions

View File

@@ -216,6 +216,11 @@ class CryptoSession {
std::string* info);
virtual bool GetBuildInformation(std::string* info);
virtual bool GetWatermarkingSupport(CdmWatermarkingSupport* support);
virtual bool GetWatermarkingSupport(
RequestedSecurityLevel requested_security_level,
CdmWatermarkingSupport* support);
virtual bool GetMaximumUsageTableEntries(
RequestedSecurityLevel security_level, size_t* number_of_entries);

View File

@@ -70,6 +70,8 @@ size_t OEMCrypto_MaximumUsageTableHeaderSize(RequestedSecurityLevel level);
OEMCryptoResult OEMCrypto_GetOEMPublicCertificate(uint8_t* public_cert,
size_t* public_cert_length,
RequestedSecurityLevel level);
OEMCrypto_WatermarkingSupport OEMCrypto_GetWatermarkingSupport(
RequestedSecurityLevel level);
} // namespace wvcdm
/* The following functions are deprecated in OEMCrypto v13. They are defined

View File

@@ -110,6 +110,7 @@ static const std::string QUERY_KEY_ANALOG_OUTPUT_CAPABILITIES =
"AnalogOutputCapabilities";
static const std::string QUERY_KEY_CAN_DISABLE_ANALOG_OUTPUT =
"CanDisableAnalogOutput";
static const std::string QUERY_KEY_WATERMARKING_SUPPORT = "WatermarkingSupport";
static const std::string QUERY_VALUE_TRUE = "True";
static const std::string QUERY_VALUE_FALSE = "False";
@@ -137,6 +138,9 @@ static const std::string QUERY_VALUE_OEM_CERTIFICATE = "OEMCertificate";
static const std::string QUERY_VALUE_CGMS_A = "CGMS-A";
static const std::string QUERY_VALUE_BOOT_CERTIFICATE_CHAIN =
"BootCertificateChain";
static const std::string QUERY_VALUE_NOT_SUPPORTED = "NotSupported";
static const std::string QUERY_VALUE_CONFIGURABLE = "Configurable";
static const std::string QUERY_VALUE_ALWAYS_ON = "AlwaysOn";
static const std::string ISO_BMFF_VIDEO_MIME_TYPE = "video/mp4";
static const std::string ISO_BMFF_AUDIO_MIME_TYPE = "audio/mp4";

View File

@@ -593,6 +593,12 @@ enum CdmProvisioningStatus : int32_t {
kNeedsOemCertProvisioning,
};
enum CdmWatermarkingSupport : int32_t {
kWatermarkingNotSupported,
kWatermarkingConfigurable,
kWatermarkingAlwaysOn
};
class CdmKeyAllowedUsage {
public:
CdmKeyAllowedUsage() { Clear(); }
@@ -835,6 +841,7 @@ const char* CdmSecurityLevelToString(CdmSecurityLevel security_level);
const char* CdmUsageEntryStorageTypeToString(CdmUsageEntryStorageType type);
const char* RequestedSecurityLevelToString(
RequestedSecurityLevel security_level);
const char* CdmWatermarkingSupportToString(CdmWatermarkingSupport support);
// Converts a generic, unknown enum value to a string representation
// containing its numeric value.
// The pointer returned from this function is thread_local.