Merge latest oemcrypto-v17 change

No-Typo-Check: Not related to this change.

Bug: 161477208
Change-Id: I99e4780f6855b7045aa0cd5a49c13d2d0d51ed64
This commit is contained in:
Kyle Zhang
2022-01-21 05:58:12 +00:00
committed by Fred Gylys-Colwell
parent c924960962
commit 642965c678
176 changed files with 301013 additions and 296749 deletions

View File

@@ -10,7 +10,7 @@
#include "string_conversions.h"
namespace wvcdm {
namespace wvutil {
// Advance an IV according to ISO-CENC's CTR modes. The lower half of the IV is
// split off and treated as an unsigned 64-bit integer, then incremented by the
@@ -41,6 +41,6 @@ inline void AdvanceIvCtr(uint8_t (*subsample_iv)[16], size_t bytes) {
memcpy(&(*subsample_iv)[kCounterIndex], &counter, kCounterSize);
}
} // namespace wvcdm
} // namespace wvutil
#endif // WVCDM_UTIL_ADVANCE_IV_CTR_H_

View File

@@ -7,7 +7,7 @@
#include <stdint.h>
namespace wvcdm {
namespace wvutil {
// Returns the size of a fixed-length array.
template <typename T, size_t N>
@@ -15,6 +15,6 @@ constexpr size_t ArraySize(const T (&)[N]) {
return N;
}
} // namespace wvcdm
} // namespace wvutil
#endif // WVCDM_UTIL_ARRAYSIZE_H_

View File

@@ -8,7 +8,7 @@
#include <random>
#include <string>
namespace wvcdm {
namespace wvutil {
// CdmRandomGenerator is a thread safe, pseudo-random number generator.
// It's purpose is to simplified interface for C++11's <random> library.
@@ -112,6 +112,6 @@ class CdmRandom {
static CdmRandomGenerator* GetInstance();
};
} // namespace wvcdm
} // namespace wvutil
#endif // WVCDM_CORE_CDM_RANDOM_H_

View File

@@ -9,7 +9,7 @@
#include <stdint.h>
namespace wvcdm {
namespace wvutil {
// Provides time related information. The implementation is platform dependent.
class Clock {
@@ -21,6 +21,6 @@ class Clock {
virtual int64_t GetCurrentTime();
};
} // namespace wvcdm
} // namespace wvutil
#endif // WVCDM_UTIL_CLOCK_H_

View File

@@ -5,12 +5,12 @@
#ifndef WVCDM_UTIL_DISALLOW_COPY_AND_ASSIGN_H_
#define WVCDM_UTIL_DISALLOW_COPY_AND_ASSIGN_H_
namespace wvcdm {
namespace wvutil {
#define CORE_DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
} // namespace wvcdm
} // namespace wvutil
#endif // WVCDM_UTIL_DISALLOW_COPY_AND_ASSIGN_H_

View File

@@ -16,7 +16,7 @@
#include "platform.h"
#include "util_common.h"
namespace wvcdm {
namespace wvutil {
static const std::string kAtscCertificateFileName = "atsccert.bin";
static const std::string kCertificateFileName = "cert1.bin";
@@ -24,6 +24,8 @@ static const std::string kCertificateFileNameExt = ".bin";
static const std::string kCertificateFileNamePrefix = "cert1_";
static const std::string kLegacyCertificateFileName = "cert.bin";
static const std::string kLegacyCertificateFileNamePrefix = "cert";
static const std::string kOemCertificateFileName = "oemcert.bin";
static const std::string kOemCertificateFileNamePrefix = "oemcert_";
// File class. The implementation is platform dependent.
class CORE_UTIL_EXPORT File {
@@ -79,6 +81,6 @@ class CORE_UTIL_EXPORT FileSystem {
CORE_DISALLOW_COPY_AND_ASSIGN(FileSystem);
};
} // namespace wvcdm
} // namespace wvutil
#endif // WVCDM_UTIL_FILE_STORE_H_

View File

@@ -5,9 +5,7 @@
#include <string>
#include <vector>
#include "wv_cdm_types.h"
namespace wvcdm {
namespace wvutil {
const char kCurrentDirectory[] = ".";
const char kParentDirectory[] = "..";
@@ -27,4 +25,4 @@ class FileUtils {
static bool CreateDirectory(const std::string& path);
};
} // namespace wvcdm
} // namespace wvutil

View File

@@ -12,9 +12,10 @@
#include <mutex>
#include <string>
#include <vector>
#include "util_common.h"
namespace wvcdm {
namespace wvutil {
// Simple logging class. The implementation is platform dependent.
@@ -52,7 +53,7 @@ class LogBuffer {
extern LogBuffer g_logbuf;
static const uint32_t UNKNOWN_UID = ~0;
static const uint32_t UNKNOWN_UID = std::numeric_limits<uint32_t>::max();
#ifdef __ANDROID__
void SetLoggingUid(const uint32_t);
@@ -92,16 +93,16 @@ CORE_UTIL_EXPORT void Log(const char* file, const char* function, int line,
// Log APIs
#ifndef LOGE
# define LOGE(...) \
Log(__FILE__, __func__, __LINE__, wvcdm::LOG_ERROR, __VA_ARGS__)
Log(__FILE__, __func__, __LINE__, wvutil::LOG_ERROR, __VA_ARGS__)
# define LOGW(...) \
Log(__FILE__, __func__, __LINE__, wvcdm::LOG_WARN, __VA_ARGS__)
Log(__FILE__, __func__, __LINE__, wvutil::LOG_WARN, __VA_ARGS__)
# define LOGI(...) \
Log(__FILE__, __func__, __LINE__, wvcdm::LOG_INFO, __VA_ARGS__)
Log(__FILE__, __func__, __LINE__, wvutil::LOG_INFO, __VA_ARGS__)
# define LOGD(...) \
Log(__FILE__, __func__, __LINE__, wvcdm::LOG_DEBUG, __VA_ARGS__)
Log(__FILE__, __func__, __LINE__, wvutil::LOG_DEBUG, __VA_ARGS__)
# define LOGV(...) \
Log(__FILE__, __func__, __LINE__, wvcdm::LOG_VERBOSE, __VA_ARGS__)
Log(__FILE__, __func__, __LINE__, wvutil::LOG_VERBOSE, __VA_ARGS__)
#endif
} // namespace wvcdm
} // namespace wvutil
#endif // WVCDM_UTIL_LOG_H_

View File

@@ -13,7 +13,7 @@
#include "disallow_copy_and_assign.h"
#include "util_common.h"
namespace wvcdm {
namespace wvutil {
// A simple reader-writer mutex implementation that mimics the one from C++17
class CORE_UTIL_EXPORT shared_mutex {
@@ -60,6 +60,6 @@ class shared_lock {
CORE_DISALLOW_COPY_AND_ASSIGN(shared_lock);
};
} // namespace wvcdm
} // namespace wvutil
#endif // WVCDM_UTIL_RW_LOCK_H_

View File

@@ -12,7 +12,7 @@
#include "util_common.h"
namespace wvcdm {
namespace wvutil {
// ASCII hex to Binary conversion.
CORE_UTIL_EXPORT std::vector<uint8_t> a2b_hex(const std::string& b);
@@ -58,6 +58,6 @@ CORE_UTIL_EXPORT inline int64_t ntohll64(int64_t x) { return htonll64(x); }
// Encode unsigned integer into a big endian formatted string.
CORE_UTIL_EXPORT std::string EncodeUint32(uint32_t u);
} // namespace wvcdm
} // namespace wvutil
#endif // WVCDM_UTIL_STRING_CONVERSIONS_H_