Source release 15.0.0
This commit is contained in:
@@ -5,15 +5,13 @@
|
||||
#ifndef WVCDM_CORE_DEVICE_FILES_H_
|
||||
#define WVCDM_CORE_DEVICE_FILES_H_
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "device_files.pb.h"
|
||||
#include "disallow_copy_and_assign.h"
|
||||
#include "scoped_ptr.h"
|
||||
#include "platform.h"
|
||||
#include "wv_cdm_types.h"
|
||||
|
||||
#if defined(UNIT_TEST)
|
||||
@@ -32,6 +30,29 @@ class DeviceFiles {
|
||||
kLicenseStateUnknown,
|
||||
} LicenseState;
|
||||
|
||||
// All error response codes start with 5000 to avoid overlap with other error
|
||||
// spaces.
|
||||
enum ResponseType {
|
||||
kNoError = NO_ERROR,
|
||||
kResponseTypeBase = 5000,
|
||||
kObjectNotInitialized = kResponseTypeBase + 1,
|
||||
kParameterNull = kResponseTypeBase + 2,
|
||||
kBasePathUnavailable = kResponseTypeBase + 3,
|
||||
kFileNotFound = kResponseTypeBase + 4,
|
||||
kFileOpenFailed = kResponseTypeBase + 5,
|
||||
kFileWriteError = kResponseTypeBase + 6,
|
||||
kFileReadError = kResponseTypeBase + 7,
|
||||
kInvalidFileSize = kResponseTypeBase + 8,
|
||||
kHashComputationFailed = kResponseTypeBase + 9,
|
||||
kFileHashMismatch = kResponseTypeBase + 10,
|
||||
kFileParseError1 = kResponseTypeBase + 11,
|
||||
kFileParseError2 = kResponseTypeBase + 12,
|
||||
kUnknownLicenseState = kResponseTypeBase + 13,
|
||||
kIncorrectFileType = kResponseTypeBase + 14,
|
||||
kIncorrectFileVersion = kResponseTypeBase + 15,
|
||||
kLicenseNotPresent = kResponseTypeBase + 16,
|
||||
};
|
||||
|
||||
struct CdmUsageData {
|
||||
std::string provider_session_token;
|
||||
CdmKeyMessage license_request;
|
||||
@@ -71,7 +92,9 @@ class DeviceFiles {
|
||||
int64_t grace_period_end_time,
|
||||
const CdmAppParameterMap& app_parameters,
|
||||
const CdmUsageEntry& usage_entry,
|
||||
uint32_t usage_entry_number);
|
||||
uint32_t usage_entry_number,
|
||||
ResponseType* result);
|
||||
|
||||
virtual bool RetrieveLicense(
|
||||
const std::string& key_set_id, LicenseState* state,
|
||||
CdmInitData* pssh_data, CdmKeyMessage* key_request,
|
||||
@@ -79,7 +102,8 @@ class DeviceFiles {
|
||||
CdmKeyResponse* key_renewal_response, std::string* release_server_url,
|
||||
int64_t* playback_start_time, int64_t* last_playback_time,
|
||||
int64_t* grace_period_end_time, CdmAppParameterMap* app_parameters,
|
||||
CdmUsageEntry* usage_entry, uint32_t* usage_entry_number);
|
||||
CdmUsageEntry* usage_entry, uint32_t* usage_entry_number,
|
||||
ResponseType* result);
|
||||
virtual bool DeleteLicense(const std::string& key_set_id);
|
||||
virtual bool ListLicenses(std::vector<std::string>* key_set_ids);
|
||||
virtual bool DeleteAllFiles();
|
||||
@@ -199,12 +223,12 @@ class DeviceFiles {
|
||||
|
||||
// Helpers that wrap the File interface and automatically handle hashing, as
|
||||
// well as adding the device files base path to to the file name.
|
||||
bool StoreFileWithHash(const std::string& name,
|
||||
const std::string& serialized_file);
|
||||
bool StoreFileRaw(const std::string& name,
|
||||
const std::string& serialized_file);
|
||||
bool RetrieveHashedFile(const std::string& name,
|
||||
video_widevine_client::sdk::File* file);
|
||||
ResponseType StoreFileWithHash(const std::string& name,
|
||||
const std::string& serialized_file);
|
||||
ResponseType StoreFileRaw(const std::string& name,
|
||||
const std::string& serialized_file);
|
||||
ResponseType RetrieveHashedFile(const std::string& name,
|
||||
video_widevine_client::sdk::File* file);
|
||||
bool FileExists(const std::string& name);
|
||||
bool ListFiles(std::vector<std::string>* names);
|
||||
bool RemoveFile(const std::string& name);
|
||||
|
||||
Reference in New Issue
Block a user