|
| Implementation () |
|
virtual | ~ Implementation () |
|
| Implementation (const Implementation &)=delete |
|
Implementation & | operator= (const Implementation &)=delete |
|
| Implementation (Implementation &&)=delete |
|
Implementation & | operator= (Implementation &&)=delete |
|
virtual bool | GetExpiration (const std::string &session_id, int64_t *expiration) const =0 |
|
virtual bool | GetKeyStatuses (const std::string &session_id, std::vector< KeyStatusInfo > *statuses) const =0 |
|
virtual void | SetServerCertificate (EmePromise promise, Data cert)=0 |
|
virtual void | CreateSessionAndGenerateRequest (EmePromise promise, std::function< void(const std::string &)> set_session_id, MediaKeySessionType session_type, MediaKeyInitDataType init_data_type, Data data)=0 |
|
virtual void | Load (const std::string &session_id, EmePromise promise)=0 |
|
virtual void | Update (const std::string &session_id, EmePromise promise, Data data)=0 |
|
virtual void | Close (const std::string &session_id, EmePromise promise)=0 |
|
virtual void | Remove (const std::string &session_id, EmePromise promise)=0 |
|
virtual DecryptStatus | Decrypt (const FrameEncryptionInfo *info, const uint8_t *data, size_t data_size, uint8_t *dest) const =0 |
|
An interface for an EME implementation instance. This represents an adapter to a CDM instance. This is a one-to-one mapping to a MediaKeys object in EME. This should create and manage a single CDM instance. This object must remain alive until the Destroy() method is called.
This can spawn background threads as needed to monitor the system. These thread(s) must be deleted inside Destroy().
It is ok to manipulate the filesystem, but it should be done inside the ImplementationHelper::DataPathPrefix directory.
Many of the actions here are asynchronous. Some are completed by the end of the call here, but are run asynchronously with respect to JavaScript. In either case, those methods are given a promise
. Once the operation is complete (error or success), one of the methods on it MUST be called. It is ok to synchronously call those methods.
Most methods here are only called on the JS main thread; the exception is Decrypt, which can be called from any thread, including concurrently with other Decrypt calls. It is highly suggested to avoid exclusive locks in Decrypt so we can get parallel decrypt operations.
Definition at line 86 of file implementation.h.
This method creates a new session and generates a license request. This is only called for new session, not for loading persistent sessions.
This should call set_session_id before sending any messages so the session ID is set. The function must only be called once.
This method should create a message to send the license request. This will only be called with init data types where ImplementationFactory::SupportsInitDataType() returns true.
The Promise should be resolved when the request has been generated, NOT when the response comes back. This should call ImplementationHelper::OnMessage() before resolving the Promise.
There are situations where this may not generate the license request immediately, for example if the device isn't provisioned. This will still generate a message, but it may not be a license request.
- Parameters
-
promise | The Promise object. |
set_session_id | A function that accepts the session ID of the new session. |
session_type | The type of session to create. |
init_data_type | The type of init data given |
data | The data contents of the request. |
Implemented in shaka::eme::ClearKeyImplementation.
Decrypts the given data. This is given a whole frame and is expected to decrypt the encrypted portions and copy over clear portions. This method doesn't need to handle containers or codecs, all it needs to do is decrypt and copy the data. If the data needs to be processed before decryption (e.g. for MPEG2-TS), it is done by the caller.
If pattern is (0, 0), then this is not using pattern encryption (e.g. for "cenc" or "cbc1").
- Parameters
-
info | Contains information about how the frame is encrypted. |
data | The data to decrypt. |
data_size | The size of |data|. |
dest | The destination buffer to hold the decrypted data. Is at least |data_size| bytes large. |
- Returns
- The resulting status code.
Implemented in shaka::eme::ClearKeyImplementation.