Source release 18.1.0
This commit is contained in:
@@ -55,7 +55,7 @@ class CDM_EXPORT Cdm : public ITimerClient {
|
||||
kTemporary = 0,
|
||||
kPersistentLicense = 1,
|
||||
kPersistent = kPersistentLicense, // deprecated name from June 1 draft
|
||||
kPersistentUsageRecord = 2,
|
||||
// kPersistentUsageRecord = 2, // deprecated, no longer supported.
|
||||
};
|
||||
|
||||
// Message types defined by EME.
|
||||
@@ -226,14 +226,26 @@ class CDM_EXPORT Cdm : public ITimerClient {
|
||||
// application's license server.
|
||||
// The response, if successful, should be provided back to the CDM via a
|
||||
// call to Cdm::update().
|
||||
//
|
||||
// The |server_url| parameter is not part of EME and may be ignored
|
||||
// on EME-based integrations. It will be blank for initial license requests
|
||||
// but filled in for renewal and release messages. It's offered for the use
|
||||
// of apps that want to know the URL to send renewals and releases to
|
||||
// without hardcoding it or retrieving it out-of-band.
|
||||
virtual void onMessage(const std::string& session_id,
|
||||
MessageType message_type,
|
||||
const std::string& message) = 0;
|
||||
MessageType message_type, const std::string& message,
|
||||
const std::string& server_url) = 0;
|
||||
|
||||
// There has been a change in the keys in the session or their status.
|
||||
virtual void onKeyStatusesChange(const std::string& session_id,
|
||||
bool has_new_usable_key) = 0;
|
||||
|
||||
// Called when the CDM changes the expiration time for a session.
|
||||
// |new_expiration| is in milliseconds since 1970 UTC. If the license
|
||||
// doesn't expire, it'll be -1.
|
||||
virtual void onExpirationChange(const std::string& session_id,
|
||||
int64_t new_expiration) = 0;
|
||||
|
||||
// A remove() operation has been completed.
|
||||
virtual void onRemoveComplete(const std::string& session_id) = 0;
|
||||
|
||||
@@ -320,6 +332,24 @@ class CDM_EXPORT Cdm : public ITimerClient {
|
||||
ITimer() {}
|
||||
};
|
||||
|
||||
// A logging interface provided by the application. This will be called any
|
||||
// time the CE CDM wants to log a message.
|
||||
// See Cdm::initialize().
|
||||
//
|
||||
// A reference implementation that logs to stderr is provided in
|
||||
// stderr_logger.h. Its behavior is identical to the behavior of previous
|
||||
// CE CDM releases.
|
||||
class ILogger {
|
||||
public:
|
||||
virtual ~ILogger() {}
|
||||
|
||||
// Log the provided message.
|
||||
virtual void log(const std::string& message) = 0;
|
||||
|
||||
protected:
|
||||
ILogger() {}
|
||||
};
|
||||
|
||||
// The CE CDM has various pieces of client information baked into it at
|
||||
// compile-time. These can be retrieved at runtime by Cdm::getClientInfo(),
|
||||
// which returns them in this struct.
|
||||
@@ -363,7 +393,7 @@ class CDM_EXPORT Cdm : public ITimerClient {
|
||||
// Must be called and must return kSuccess before create() is called.
|
||||
static Status initialize(SecureOutputType secure_output_type,
|
||||
IStorage* storage, IClock* clock, ITimer* timer,
|
||||
LogLevel verbosity);
|
||||
ILogger* logger, LogLevel verbosity);
|
||||
|
||||
// This is a variant of the above function that allows the caller to pass a
|
||||
// Sandbox ID. Platforms that use Sandbox IDs should use this initalize()
|
||||
@@ -371,7 +401,8 @@ class CDM_EXPORT Cdm : public ITimerClient {
|
||||
// should not use this version of initialize().
|
||||
static Status initialize(SecureOutputType secure_output_type,
|
||||
IStorage* storage, IClock* clock, ITimer* timer,
|
||||
LogLevel verbosity, const std::string& sandbox_id);
|
||||
ILogger* logger, LogLevel verbosity,
|
||||
const std::string& sandbox_id);
|
||||
|
||||
// Query the CDM library version.
|
||||
static const char* version();
|
||||
@@ -387,6 +418,7 @@ class CDM_EXPORT Cdm : public ITimerClient {
|
||||
// |storage| defines the storage to use for this instance. By providing
|
||||
// different objects here for different origins, this parameter can be used to
|
||||
// provide per-origin storage. It may not be NULL.
|
||||
//
|
||||
// If |privacy_mode| is true, service certificates are required and will be
|
||||
// used to encrypt messages to the license server.
|
||||
// By using service certificates to encrypt communication with the license
|
||||
@@ -395,23 +427,19 @@ class CDM_EXPORT Cdm : public ITimerClient {
|
||||
// the server.
|
||||
// This is particularly useful for browser environments, but is recommended
|
||||
// for use whenever possible.
|
||||
static Cdm* create(IEventListener* listener, IStorage* storage,
|
||||
bool privacy_mode);
|
||||
|
||||
// This is a variant of the above function that allows the caller to specify
|
||||
// that the IStorage should be treated as read-only. Passing true for this
|
||||
// parameter will cause the Widevine CE CDM to prevent attempts to modify any
|
||||
// data in the IStorage. Note that this is *not* the expected operation mode
|
||||
// for most clients and will likely lead to playback failures. It should only
|
||||
// be used in cases where read-only certificates and licenses have been
|
||||
// pre-loaded on a device, such as the preloaded licenses in ATSC 3.
|
||||
//
|
||||
// If |storage_is_read_only| is true, the Widevine CE CDM will treat |storage|
|
||||
// as read-only and prevent attempts to modify any data in the IStorage. Note
|
||||
// that this is *not* the expected operation mode for most clients and will
|
||||
// likely lead to playback failures. It should only be used in cases where
|
||||
// read-only certificates and licenses have been pre-loaded on a device, such
|
||||
// as the preloaded licenses in ATSC 3.
|
||||
// It is not possible to mix read-only and non-read-only files in the same
|
||||
// IStorage instance. A separate CDM with a separate IStorage pointing to the
|
||||
// non-read-only files should be created with the read-only flag omitted or
|
||||
// set to false.
|
||||
// non-read-only files should be created with the read-only flag set to false.
|
||||
static Cdm* create(IEventListener* listener, IStorage* storage,
|
||||
bool privacy_mode, bool storage_is_read_only);
|
||||
bool privacy_mode = false,
|
||||
bool storage_is_read_only = false);
|
||||
|
||||
~Cdm() override {}
|
||||
|
||||
@@ -509,22 +537,6 @@ class CDM_EXPORT Cdm : public ITimerClient {
|
||||
// CDM's current IStorage object.
|
||||
virtual Status listStoredLicenses(std::vector<std::string>* key_set_ids) = 0;
|
||||
|
||||
// Get the current list of secure-stop licenses on the system.
|
||||
// License storage is origin-specific, and the origin is determined by the
|
||||
// CDM's current IStorage object. ksids receives list of KSIDs representing
|
||||
// usage records or secure-stop licenses.
|
||||
virtual Status listUsageRecords(std::vector<std::string>* ksids) = 0;
|
||||
|
||||
// Delete the usage record for the given key_set_id.
|
||||
// Usage info storage is origin-specific, and the origin is determined by the
|
||||
// CDM's current IStorage object.
|
||||
virtual Status deleteUsageRecord(const std::string& key_set_id) = 0;
|
||||
|
||||
// Delete all usage records for the current origin.
|
||||
// Usage info storage is origin-specific, and the origin is determined by the
|
||||
// CDM's current IStorage object.
|
||||
virtual Status deleteAllUsageRecords() = 0;
|
||||
|
||||
// Checks whether the device is capable of supporting a given HDCP version.
|
||||
// If successful, |key_status| is set to either kUsable or kOutputRestricted.
|
||||
virtual Status getStatusForHdcpVersion(HdcpVersion hdcp,
|
||||
@@ -549,7 +561,14 @@ class CDM_EXPORT Cdm : public ITimerClient {
|
||||
virtual Status createSession(SessionType session_type,
|
||||
std::string* session_id) = 0;
|
||||
|
||||
// Generates a request based on the initData.
|
||||
// Generates a request based on the provided |init_data|. For PSSH init data,
|
||||
// the CE CDM can accept the full concatenated blob of PSSH boxes from the
|
||||
// stream. It will select the correct Widevine PSSH, so callers do not have to
|
||||
// determine the correct PSSH from the list themselves.
|
||||
// If the init data contains embedded keys, they will be remembered by the
|
||||
// session and loaded after the matching entitlement key is provided to
|
||||
// update().
|
||||
//
|
||||
// The request will be provided via a synchronous call to
|
||||
// IEventListener::onMessage().
|
||||
// This is done so that license requests and renewals follow the same flow.
|
||||
@@ -567,8 +586,16 @@ class CDM_EXPORT Cdm : public ITimerClient {
|
||||
const std::string& response) = 0;
|
||||
|
||||
// Loads the entitled keys embedded in |init_data| into the session identified
|
||||
// by |session_id|. This function is only used when using entitlement
|
||||
// licenses for key rotation.
|
||||
// by |session_id|. The matching entitlement key must already be loaded in the
|
||||
// session via previous calls to update() or load(). For PSSH init data, the
|
||||
// CE CDM can accept the full concatenated blob of PSSH boxes from the stream.
|
||||
// It will select the correct Widevine PSSH, so callers do not have to
|
||||
// determine the correct PSSH from the list themselves.
|
||||
//
|
||||
// It is not necessary to call this function after passing PSSHs containing
|
||||
// entitled keys to generateRequest(). This function is only used when adding
|
||||
// new entitled keys to an existing session, such as for key rotation or
|
||||
// after loading a persisted entitlement license.
|
||||
virtual Status loadEmbeddedKeys(const std::string& session_id,
|
||||
InitDataType init_data_type,
|
||||
const std::string& init_data) = 0;
|
||||
|
||||
Reference in New Issue
Block a user