Android development of the widevine CDM has been done on the jb-mr2 branch of the cdm code base. This CL contains a merge of that jb-mr2 work to CDM master, and also reflects the evolution of the common Modular DRM code base since jb-mr2 branched. Change-Id: I1d7e1a12d092c00044a4298261146cb97808d4ef
63 lines
1.7 KiB
C++
63 lines
1.7 KiB
C++
// Copyright 2012 Google Inc. All Rights Reserved.
|
|
|
|
#ifndef CDM_BASE_LICENSE_H_
|
|
#define CDM_BASE_LICENSE_H_
|
|
|
|
#include "wv_cdm_types.h"
|
|
|
|
namespace video_widevine_server {
|
|
namespace sdk {
|
|
class SignedMessage;
|
|
}
|
|
} // namespace video_widevine_server
|
|
|
|
namespace wvcdm {
|
|
|
|
class CryptoSession;
|
|
class PolicyEngine;
|
|
|
|
class CdmLicense {
|
|
public:
|
|
|
|
CdmLicense();
|
|
~CdmLicense();
|
|
|
|
bool Init(const std::string& token, CryptoSession* session,
|
|
PolicyEngine* policy_engine);
|
|
|
|
bool PrepareKeyRequest(const CdmInitData& pssh_data,
|
|
const CdmLicenseType license_type,
|
|
const CdmAppParameterMap& app_parameters,
|
|
CdmKeyMessage* signed_request,
|
|
std::string* server_url);
|
|
bool PrepareKeyUpdateRequest(bool is_renewal,
|
|
CdmKeyMessage* signed_request,
|
|
std::string* server_url);
|
|
CdmResponseType HandleKeyResponse(const CdmKeyResponse& license_response);
|
|
CdmResponseType HandleKeyUpdateResponse(
|
|
bool is_renewal,
|
|
const CdmKeyResponse& license_response);
|
|
|
|
bool RestoreOfflineLicense(CdmKeyMessage& license_request,
|
|
CdmKeyResponse& license_response,
|
|
CdmKeyResponse& license_renewal_response);
|
|
|
|
private:
|
|
CdmResponseType HandleKeyErrorResponse(
|
|
const video_widevine_server::sdk::SignedMessage& signed_message);
|
|
|
|
CryptoSession* session_;
|
|
PolicyEngine* policy_engine_;
|
|
std::string server_url_;
|
|
std::string token_;
|
|
|
|
// Used for certificate based licensing
|
|
CdmKeyMessage key_request_;
|
|
|
|
CORE_DISALLOW_COPY_AND_ASSIGN(CdmLicense);
|
|
};
|
|
|
|
} // namespace wvcdm
|
|
|
|
#endif // CDM_BASE_LICENSE_H_
|