This change incorporates the following CLs from the Widevine
cdm repository:
Update the java request/response test app to match Drm API changes
Don't build the mock liboemcrypto.so by default
Do not build CDM tests by default
Fix Build Break in DrmEngine Unit Tests
Fix Build Break in WVDrmPlugin
Initial version of roadmap for CDM projects.
Implement License Query
Implement Generic DRM in OEMCrypto Reference Implementation
Add key_data_length field when calling OEMCrypto_LoadKeys
Policy engine unittests
Generalized DRM API for OEMCrypto
Fixes proto buf libraries build.
Add Version Number to OEMCrypto API
Test key control block duration field in OEMCrypto
Add fix for missing crypto offset.
Fixed android/media*/test builds and added proto files for Cert. provisioning
Refactor and clean up callback code in CDM.
Add "device_id" name-value pair to LicenseRequest::ClientIdentification
Separate unit and end-to-end tests from the top level makefie.
Includes changes for 'fall back to l3 oemcrypto lib' in top level makefile.
Fall Back to Level 3 if Level 1 Fails
Fix compilation error in wvcdm_unittest.
Fix Android build break due to Decrypt() signature change in cdm_engine.h.
Wire up callbacks and errors in the Steel proxy.
Fix lock assert if there is no keybox on the device.
RSA Certificate Unit Test
Change Generic_Verify signature to constant.
Change-Id: I2e42db9d0b4f8d4e833675ae81d0714509bbfd2c
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
// Copyright 2013 Google Inc. All Rights Reserved.
|
|
|
|
#ifndef CDM_BASE_PROPERTIES_H_
|
|
#define CDM_BASE_PROPERTIES_H_
|
|
|
|
#include <map>
|
|
#include <string>
|
|
|
|
#include "lock.h"
|
|
#include "wv_cdm_types.h"
|
|
|
|
namespace wvcdm {
|
|
|
|
typedef std::map<std::string, bool> CdmBooleanPropertiesMap;
|
|
|
|
struct CdmBooleanProperties {
|
|
std::string name;
|
|
bool value;
|
|
};
|
|
|
|
// This class saves information about features and properties enabled
|
|
// for a given platform. At initialization it reads in properties from
|
|
// property_configuration.h. That file specifies features selected for each
|
|
// platform. Core CDM can then query enabled features though the GetProperty
|
|
// method and tailor its behaviour in a non-platform specific way.
|
|
//
|
|
// Additional features can be added at runtime as long as the key names do
|
|
// not clash. Also, only boolean properties are supported at this time, though
|
|
// it should be trivial to in support for other datatypes.
|
|
class Properties {
|
|
public:
|
|
static Properties* GetInstance();
|
|
|
|
// value argument is only set if the property was found (true is returned)
|
|
bool GetProperty(std::string& key, bool& value);
|
|
|
|
private:
|
|
Properties();
|
|
~Properties() {}
|
|
|
|
void SetProperty(std::string& key, bool value);
|
|
|
|
static Properties* instance_;
|
|
static Lock properties_lock_;
|
|
|
|
CdmBooleanPropertiesMap boolean_properties_;
|
|
|
|
CORE_DISALLOW_COPY_AND_ASSIGN(Properties);
|
|
};
|
|
|
|
} // namespace wvcdm
|
|
|
|
#endif // CDM_BASE_PROPERTIES_H_
|