Source release 17.1.0

This commit is contained in:
John "Juce" Bruce
2022-07-07 17:14:31 -07:00
parent 8c17574083
commit 694cf6fb25
2233 changed files with 272026 additions and 223371 deletions

View File

@@ -1,9 +1,15 @@
// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine Master
// License Agreement.
// source code may only be used and distributed under the Widevine License
// Agreement.
#include "properties_ce.h"
#include <stdio.h>
#include <memory>
#include <string>
#include "cdm_version.h"
#include "compiler_detection.h"
#include "log.h"
#include "properties.h"
@@ -19,16 +25,20 @@ std::string sandbox_id_;
widevine::Cdm::SecureOutputType secure_output_type_ =
widevine::Cdm::kNoSecureOutput;
widevine::Cdm::ClientInfo client_info_;
bool GetValue(const std::string& source, std::string* output) {
if (!output) {
bool GetValue(const char* source, std::string* output) {
if (!source || !output) {
return false;
}
*output = source;
return source.size() != 0;
return source[0] != '\0';
}
constexpr char kBuildInfo[] = CLIENT_VERSION
" | " CLIENT_PLATFORM " | " CLIENT_FORM_FACTOR " | " CLIENT_ARCH_NAME
" | CE CDM " CDM_VERSION " | " CPU_ARCH_MESSAGE " | " LOGGING_MESSAGE
" | " BUILD_FLAVOR_MESSAGE;
} // namespace
namespace widevine {
@@ -63,14 +73,6 @@ Cdm::SecureOutputType PropertiesCE::GetSecureOutputType() {
return secure_output_type_;
}
// static
void PropertiesCE::SetClientInfo(const Cdm::ClientInfo& client_info) {
client_info_ = client_info;
}
// static
Cdm::ClientInfo PropertiesCE::GetClientInfo() { return client_info_; }
// static
void PropertiesCE::SetProvisioningMessagesAreBinary(bool new_setting) {
set_provisioning_messages_to_binary_ = new_setting;
@@ -100,32 +102,37 @@ void Properties::InitOnce() {
// static
bool Properties::GetCompanyName(std::string* company_name) {
return GetValue(client_info_.company_name, company_name);
return GetValue(CLIENT_COMPANY_NAME, company_name);
}
// static
bool Properties::GetModelName(std::string* model_name) {
return GetValue(client_info_.model_name, model_name);
return GetValue(CLIENT_MODEL_NAME, model_name);
}
// static
bool Properties::GetModelYear(std::string* model_year) {
return GetValue(CLIENT_MODEL_YEAR, model_year);
}
// static
bool Properties::GetArchitectureName(std::string* arch_name) {
return GetValue(client_info_.arch_name, arch_name);
return GetValue(CLIENT_ARCH_NAME, arch_name);
}
// static
bool Properties::GetDeviceName(std::string* device_name) {
return GetValue(client_info_.device_name, device_name);
return GetValue(CLIENT_DEVICE_NAME, device_name);
}
// static
bool Properties::GetProductName(std::string* product_name) {
return GetValue(client_info_.product_name, product_name);
return GetValue(CLIENT_PRODUCT_NAME, product_name);
}
// static
bool Properties::GetBuildInfo(std::string* build_info) {
return GetValue(client_info_.build_info, build_info);
return GetValue(kBuildInfo, build_info);
}
// static
@@ -151,7 +158,13 @@ bool Properties::GetFactoryKeyboxPath(std::string*) {
// static
bool Properties::GetOEMCryptoPath(std::string* path) {
if (path == nullptr) return false;
*path = "liboemcrypto.so";
// Using an environment variable is useful for testing.
const char* env_path = getenv("LIBOEMCRYPTO_PATH");
if (env_path) {
*path = std::string(env_path);
} else {
*path = "liboemcrypto.so";
}
return true;
}