Source release 19.6.0

GitOrigin-RevId: 13a33e34413c19da1bfe76abcc66be519c9ac9d1
This commit is contained in:
Googler
2025-05-30 14:47:25 -07:00
committed by mattfedd
parent f7ec4fdeff
commit 6d36a0c93d
59 changed files with 3327 additions and 1491 deletions

View File

@@ -58,6 +58,7 @@ class CDM_EXPORT Cdm : public ITimerClient {
kPersistentLicense = 1,
kPersistent = kPersistentLicense, // deprecated name from June 1 draft
// kPersistentUsageRecord = 2, // deprecated, no longer supported.
kUnknownSessionType = -1, // For error conditions
};
// Message types defined by EME.

View File

@@ -10,7 +10,7 @@
# define CDM_VERSION_MAJOR 19
#endif
#ifndef CDM_VERSION_MINOR
# define CDM_VERSION_MINOR 5
# define CDM_VERSION_MINOR 6
#endif
#ifndef CDM_VERSION_PATCH
# define CDM_VERSION_PATCH 0

View File

@@ -363,7 +363,8 @@ class CdmImpl final : public Cdm, public WvCdmEventListener {
int64_t expiration;
KeyStatusMap key_statuses;
SessionMetadata() : callable(false), type((SessionType)-1), expiration(0) {}
SessionMetadata()
: callable(false), type(kUnknownSessionType), expiration(0) {}
};
std::map<std::string, SessionMetadata> sessions_;

View File

@@ -40,8 +40,8 @@ void Log(const char* file, const char* function, int line, LogPriority level,
}
const char* severities[] = {"ERROR", "WARN", "INFO", "DEBUG", "VERBOSE"};
if (level < 0 || level >= static_cast<LogPriority>(sizeof(severities) /
sizeof(severities[0]))) {
if (level < 0 || static_cast<size_t>(level) >=
sizeof(severities) / sizeof(severities[0])) {
std::string fatal_message(kFallbackLogMessage);
FormatString(&fatal_message,
"[FATAL:%s(%d):%s] Invalid log priority level: %d", file, line,

View File

@@ -37,6 +37,8 @@ std::string product_name_;
std::string device_name_;
std::string arch_name_;
std::string build_info_;
std::string platform_;
std::string form_factor_;
bool isClientInfoFieldValid(const char* tag, const char* value) {
constexpr char kForbiddenSeparator[] = " | ";
@@ -59,14 +61,12 @@ bool isClientInfoFieldValid(const char* tag, const char* value) {
}
void SetClientInfo() {
std::string platform;
std::string form_factor;
std::string version;
#if defined(RUNTIME_CLIENT_INFO)
if (!CDM_NAMESPACE::ReadClientInformation(
&company_name_, &model_name_, &model_year_, &product_name_,
&device_name_, &arch_name_, &platform, &form_factor, &version)) {
&device_name_, &arch_name_, &platform_, &form_factor_, &version)) {
LOGE("ReadClientInformation failed.");
client_info_is_valid_ = false;
return;
@@ -78,8 +78,8 @@ void SetClientInfo() {
isClientInfoFieldValid("product_name", product_name_.c_str()) &&
isClientInfoFieldValid("device_name", device_name_.c_str()) &&
isClientInfoFieldValid("arch_name", arch_name_.c_str()) &&
isClientInfoFieldValid("platform", platform.c_str()) &&
isClientInfoFieldValid("form_factor", form_factor.c_str()) &&
isClientInfoFieldValid("platform", platform_.c_str()) &&
isClientInfoFieldValid("form_factor", form_factor_.c_str()) &&
isClientInfoFieldValid("version", version.c_str()))) {
client_info_is_valid_ = false;
return;
@@ -104,14 +104,14 @@ void SetClientInfo() {
product_name_ = CLIENT_PRODUCT_NAME;
device_name_ = CLIENT_DEVICE_NAME;
arch_name_ = CLIENT_ARCH_NAME;
platform = CLIENT_PLATFORM;
form_factor = CLIENT_FORM_FACTOR;
platform_ = CLIENT_PLATFORM;
form_factor_ = CLIENT_FORM_FACTOR;
version = CLIENT_VERSION;
#endif
if (!wvutil::FormatString(
&build_info_, "%s | %s | %s | %s | CE CDM %s | %s | %s | %s",
version.c_str(), platform.c_str(), form_factor.c_str(),
version.c_str(), platform_.c_str(), form_factor_.c_str(),
arch_name_.c_str(), CDM_VERSION, CPU_ARCH_MESSAGE, LOGGING_MESSAGE,
BUILD_FLAVOR_MESSAGE)) {
client_info_is_valid_ = false;
@@ -237,6 +237,16 @@ bool Properties::GetWVCdmVersion(std::string* version) {
return GetValue(CDM_VERSION, version);
}
// static
bool Properties::GetPlatform(std::string* platform) {
return GetValue(platform_.c_str(), platform);
}
// static
bool Properties::GetFormFactor(std::string* form_factor) {
return GetValue(form_factor_.c_str(), form_factor);
}
// static
bool Properties::GetDeviceFilesBasePath(CdmSecurityLevel,
std::string* base_path) {