DASH Media Packaging SDK
|
#include <widevine_key_source.h>
Public Member Functions | |
WidevineKeySource (const std::string &server_url, bool add_common_pssh) | |
Status | FetchKeys (const std::vector< uint8_t > &content_id, const std::string &policy) |
void | set_protection_scheme (FourCC protection_scheme) |
Set the protection scheme for the key source. | |
void | set_signer (std::unique_ptr< RequestSigner > signer) |
void | set_key_fetcher (std::unique_ptr< KeyFetcher > key_fetcher) |
KeySource implementation overrides. | |
Status | FetchKeys (EmeInitDataType init_data_type, const std::vector< uint8_t > &init_data) override |
Status | GetKey (const std::string &stream_label, EncryptionKey *key) override |
Status | GetKey (const std::vector< uint8_t > &key_id, EncryptionKey *key) override |
Status | GetCryptoPeriodKey (uint32_t crypto_period_index, const std::string &stream_label, EncryptionKey *key) override |
WidevineKeySource talks to the Widevine encryption service to acquire the encryption keys.
Definition at line 31 of file widevine_key_source.h.
shaka::media::WidevineKeySource::WidevineKeySource | ( | const std::string & | server_url, |
bool | add_common_pssh | ||
) |
server_url | is the Widevine common encryption server url. |
Definition at line 130 of file widevine_key_source.cc.
|
overridevirtual |
Fetch keys based on the specified encrypted media init data.
init_data_type | specifies the encrypted media init data type. |
init_data | contains the init data. |
Implements shaka::media::KeySource.
Definition at line 181 of file widevine_key_source.cc.
Status shaka::media::WidevineKeySource::FetchKeys | ( | const std::vector< uint8_t > & | content_id, |
const std::string & | policy | ||
) |
Fetch keys for CENC from the key server.
content_id | the unique id identify the content. |
policy | specifies the DRM content rights. |
Definition at line 158 of file widevine_key_source.cc.
|
overridevirtual |
Get encryption key of the specified track type at the specified index.
crypto_period_index | is the sequence number of the key rotation period for which the key is being retrieved. |
stream_label | is the label of stream for which retrieving the key. |
key | is a pointer to the EncryptionKey which will hold the retrieved key. Owner retains ownership, and may not be NULL. |
Implements shaka::media::KeySource.
Definition at line 264 of file widevine_key_source.cc.
|
overridevirtual |
Get encryption key of the specified stream label.
stream_label | is the label of stream for which retrieving the key. |
key | is a pointer to the EncryptionKey which will hold the retrieved key. Owner retains ownership, and may not be NULL. |
Implements shaka::media::KeySource.
Definition at line 240 of file widevine_key_source.cc.
|
overridevirtual |
Get the encryption key specified by the CENC key ID.
key_id | is the unique identifier for the key being retreived. |
key | is a pointer to the EncryptionKey which will hold the retrieved key. Owner retains ownership, and may not be NULL. |
Implements shaka::media::KeySource.
Definition at line 251 of file widevine_key_source.cc.
void shaka::media::WidevineKeySource::set_key_fetcher | ( | std::unique_ptr< KeyFetcher > | key_fetcher | ) |
Inject an KeyFetcher object, mainly used for testing.
key_fetcher | points to the KeyFetcher object to be injected. |
Definition at line 290 of file widevine_key_source.cc.
void shaka::media::WidevineKeySource::set_signer | ( | std::unique_ptr< RequestSigner > | signer | ) |
Set signer for the key source.
signer | signs the request message. |
Definition at line 286 of file widevine_key_source.cc.