Files
android/libwvdrmengine/cdm/metrics/src/value_metric.cpp
Jacob Trimble b3dd9c3711 Misc Windows fixes.
(This is a merge of http://go/wvgerrit/70324)

- Add build settings for Windows.
- Conditionally add pthread.
- Add dummy DLLMain method.
- Fix #if checks for Windows.
- Remove designated initializers which aren't supported in MSVC.
- Remove variable length array.

Test: Android Unit Tests
Bug: 122953649
Change-Id: I14f16e7ce4b3ff17ee0139ea6c2f7243ae999aa1
2019-01-25 15:05:00 -08:00

116 lines
3.1 KiB
C++

// 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 "OEMCryptoCENC.h"
#include "metrics_collections.h"
#include "wv_cdm_types.h"
namespace wvcdm {
namespace metrics {
namespace impl{
template <>
void SetValue<int>(drm_metrics::ValueMetric *value_proto,
const int &value) {
value_proto->set_int_value(value);
}
template <>
void SetValue<long>(drm_metrics::ValueMetric *value_proto,
const long &value) {
value_proto->set_int_value(value);
}
template <>
void SetValue<long long>(drm_metrics::ValueMetric *value_proto,
const long long &value) {
value_proto->set_int_value(value);
}
template <>
void SetValue<unsigned int>(drm_metrics::ValueMetric *value_proto,
const unsigned int &value) {
value_proto->set_int_value((int64_t)value);
}
template <>
void SetValue<unsigned short>(drm_metrics::ValueMetric *value_proto,
const unsigned short &value) {
value_proto->set_int_value((int64_t)value);
}
template <>
void SetValue<unsigned long>(drm_metrics::ValueMetric *value_proto,
const unsigned long &value) {
value_proto->set_int_value((int64_t)value);
}
template <>
void SetValue<unsigned long long>(drm_metrics::ValueMetric *value_proto,
const unsigned long long &value) {
value_proto->set_int_value((int64_t)value);
}
template <>
void SetValue<bool>(drm_metrics::ValueMetric *value_proto,
const bool &value) {
value_proto->set_int_value(value);
}
template <>
void SetValue<OEMCrypto_HDCP_Capability>(
drm_metrics::ValueMetric *value_proto,
const OEMCrypto_HDCP_Capability &value) {
value_proto->set_int_value(value);
}
template <>
void SetValue<OEMCrypto_ProvisioningMethod>(
drm_metrics::ValueMetric *value_proto,
const OEMCrypto_ProvisioningMethod &value) {
value_proto->set_int_value(value);
}
template <>
void SetValue<OEMCryptoInitializationMode>(
drm_metrics::ValueMetric *value_proto,
const OEMCryptoInitializationMode &value) {
value_proto->set_int_value(value);
}
template <>
void SetValue<CdmSecurityLevel>(drm_metrics::ValueMetric *value_proto,
const CdmSecurityLevel &value) {
value_proto->set_int_value(value);
}
template <>
void SetValue<CdmUsageSupportType>(drm_metrics::ValueMetric *value_proto,
const CdmUsageSupportType &value) {
value_proto->set_int_value(value);
}
template <>
void SetValue<double>(drm_metrics::ValueMetric *value_proto,
const double &value) {
value_proto->set_double_value(value);
}
template <>
void SetValue<std::string>(drm_metrics::ValueMetric *value_proto,
const std::string &value) {
value_proto->set_string_value(value);
}
} // namespace impl
} // namespace metrics
} // namespace wvcdm