Source release v3.5.0

This commit is contained in:
Gene Morgan
2017-11-28 17:42:16 -08:00
parent 501c22890d
commit 31381a1311
155 changed files with 16680 additions and 3816 deletions

View File

@@ -0,0 +1,115 @@
// Copyright 2017 Google Inc. All Rights Reserved.
//
// This file contains the specializations for helper methods for the
// ValueMetric class.
#include <stdint.h>
#include <string>
#include "value_metric.h"
#include "metrics_collections.h"
#include "OEMCryptoCENC.h"
#include "wv_cdm_types.h"
namespace wvcdm {
namespace metrics {
// Private namespace for some helper implementation functions.
namespace impl {
template<>
void Serialize<int32_t>(MetricSerializer* serializer,
const std::string& metric_name,
const int32_t& value) {
serializer->SetInt32(metric_name, value);
}
template<>
void Serialize<int64_t>(MetricSerializer* serializer,
const std::string& metric_name,
const int64_t& value) {
serializer->SetInt64(metric_name, value);
}
// This specialization forces the uint32_t to an int32_t.
template<>
void Serialize<uint32_t>(MetricSerializer* serializer,
const std::string& metric_name,
const uint32_t& value) {
serializer->SetInt32(metric_name, value);
}
// This specialization forces the uint32_t to an int64_t.
template<>
void Serialize<uint64_t>(MetricSerializer* serializer,
const std::string& metric_name,
const uint64_t& value) {
serializer->SetInt64(metric_name, value);
}
// This specialization forces a bool to an int32_t.
template<>
void Serialize<bool>(MetricSerializer* serializer,
const std::string& metric_name,
const bool& value) {
serializer->SetInt32(metric_name, value);
}
// This specialization forces an unsigned short to an int32_t.
template<>
void Serialize<unsigned short>(MetricSerializer* serializer,
const std::string& metric_name,
const unsigned short& value) {
serializer->SetInt32(metric_name, value);
}
template<>
void Serialize<std::string>(MetricSerializer* serializer,
const std::string& metric_name,
const std::string& value) {
serializer->SetString(metric_name, value);
}
template<>
void Serialize<double>(MetricSerializer* serializer,
const std::string& metric_name,
const double& value) {
serializer->SetDouble(metric_name, value);
}
// These specializations force CDM-specific types to int32_t
template<>
void Serialize<CdmSecurityLevel>(MetricSerializer* serializer,
const std::string& metric_name,
const CdmSecurityLevel& value) {
serializer->SetInt32(metric_name, value);
}
template<>
void Serialize<OEMCrypto_HDCP_Capability>(
MetricSerializer* serializer,
const std::string& metric_name,
const OEMCrypto_HDCP_Capability& value) {
serializer->SetInt32(metric_name, value);
}
template<>
void Serialize<OEMCrypto_ProvisioningMethod>(
MetricSerializer* serializer,
const std::string& metric_name,
const OEMCrypto_ProvisioningMethod& value) {
serializer->SetInt32(metric_name, value);
}
template<>
void Serialize<OEMCryptoInitializationMode>(
MetricSerializer* serializer,
const std::string& metric_name,
const OEMCryptoInitializationMode& value) {
serializer->SetInt32(metric_name, value);
}
} // namespace impl
} // namespace metrics
} // namespace wvcdm