Shaka Player Embedded
|
#include <clearkey_implementation.h>
Public Member Functions | |
ClearKeyImplementation (ImplementationHelper *helper) | |
~ClearKeyImplementation () override | |
bool | GetExpiration (const std::string &session_id, int64_t *expiration) const override |
bool | GetKeyStatuses (const std::string &session_id, std::vector< KeyStatusInfo > *statuses) const override |
void | SetServerCertificate (EmePromise promise, Data cert) override |
void | CreateSessionAndGenerateRequest (EmePromise promise, std::function< void(const std::string &)> set_session_id, MediaKeySessionType session_type, MediaKeyInitDataType init_data_type, Data data) override |
void | Load (const std::string &session_id, EmePromise promise) override |
void | Update (const std::string &session_id, EmePromise promise, Data data) override |
void | Close (const std::string &session_id, EmePromise promise) override |
void | Remove (const std::string &session_id, EmePromise promise) override |
DecryptStatus | Decrypt (const FrameEncryptionInfo *info, const uint8_t *data, size_t data_size, uint8_t *dest) const override |
![]() | |
Implementation () | |
virtual | ~ Implementation () |
Implementation (const Implementation &)=delete | |
Implementation & | operator= (const Implementation &)=delete |
Implementation (Implementation &&)=delete | |
Implementation & | operator= (Implementation &&)=delete |
Friends | |
class | ClearKeyImplementationTest |
class | media::DecoderIntegration |
class | media::DecoderDecryptIntegration |
Definition at line 39 of file clearkey_implementation.h.
|
explicit |
Definition at line 214 of file clearkey_implementation.cc.
|
override |
Definition at line 216 of file clearkey_implementation.cc.
|
overridevirtual |
Closes the given session. This does NOT delete persistent sessions, it only closes the current running session and any runtime data.
session_id | The session ID to close. |
promise | The Promise object. |
Implements shaka::eme::Implementation.
Definition at line 304 of file clearkey_implementation.cc.
|
overridevirtual |
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.
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. |
Implements shaka::eme::Implementation.
Definition at line 241 of file clearkey_implementation.cc.
|
overridevirtual |
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").
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. |
Implements shaka::eme::Implementation.
Definition at line 317 of file clearkey_implementation.cc.
|
overridevirtual |
Gets the expiration of the session. This should give the time in milliseconds since the epoch, or -1 if the session never expires.
session_id | The ID of the session to get the expiration for. |
expiration | [OUT] Where to put the expiration time. |
Implements shaka::eme::Implementation.
Definition at line 218 of file clearkey_implementation.cc.
|
overridevirtual |
Gets the status of each key in the given session. These values can be cached to avoid extra overhead. This means that the key status may have changed but not be reflected yet (e.g. they may have expired).
session_id | The ID of the session to query. |
statuses | [OUT] Where to put the resulting statuses. |
Implements shaka::eme::Implementation.
Definition at line 224 of file clearkey_implementation.cc.
|
overridevirtual |
Loads the given session from persistent storage.
This should use ResolveWith() and pass true if the session was found, false if the session didn't exist. This should still reject for errors.
session_id | The session ID to load. |
promise | The Promise object. |
Implements shaka::eme::Implementation.
Definition at line 269 of file clearkey_implementation.cc.
|
overridevirtual |
Removes any persistent data associated with the given session.
This should generate a 'license-release' message. The session should not actually be deleted until the response is given to Update(). However, the Promise should be resolved once the message is generated.
session_id | The session ID to delete. |
promise | The Promise object. |
Implements shaka::eme::Implementation.
Definition at line 311 of file clearkey_implementation.cc.
|
overridevirtual |
Sets the server certificate for the CDM.
This should use EmePromise::ResolveWith() and pass true for supported and false for not supported. This should only reject for errors in the certificate.
promise | The Promise object. |
cert | The data contents of the certificate. |
Implements shaka::eme::Implementation.
Definition at line 236 of file clearkey_implementation.cc.
|
overridevirtual |
Updates the given session with a response from the server.
session_id | The session ID to use. |
promise | The Promise object. |
data | The data contents of the response. |
Implements shaka::eme::Implementation.
Definition at line 275 of file clearkey_implementation.cc.
|
friend |
Definition at line 93 of file clearkey_implementation.h.
|
friend |
Definition at line 95 of file clearkey_implementation.h.
|
friend |
Definition at line 94 of file clearkey_implementation.h.