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_signer (scoped_ptr< RequestSigner > signer) |
void | set_key_fetcher (scoped_ptr< KeyFetcher > key_fetcher) |
KeySource implementation overrides. | |
Status | FetchKeys (const std::vector< uint8_t > &pssh_box) override |
Status | FetchKeys (const std::vector< std::vector< uint8_t >> &key_ids) override |
Status | FetchKeys (uint32_t asset_id) override |
Status | GetKey (TrackType track_type, EncryptionKey *key) override |
Status | GetKey (const std::vector< uint8_t > &key_id, EncryptionKey *key) override |
Status | GetCryptoPeriodKey (uint32_t crypto_period_index, TrackType track_type, EncryptionKey *key) override |
Protected Attributes | |
ClosureThread | key_production_thread_ |
Additional Inherited Members | |
Public Types inherited from shaka::media::KeySource | |
enum | TrackType { TRACK_TYPE_UNKNOWN = 0, TRACK_TYPE_SD = 1, TRACK_TYPE_HD = 2, TRACK_TYPE_AUDIO = 3, TRACK_TYPE_UNSPECIFIED = 4, NUM_VALID_TRACK_TYPES = 4 } |
Static Public Member Functions inherited from shaka::media::KeySource | |
static TrackType | GetTrackTypeFromString (const std::string &track_type_string) |
Convert string representation of track type to enum representation. | |
static std::string | TrackTypeToString (TrackType track_type) |
Convert TrackType to string. | |
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 137 of file widevine_key_source.cc.
|
overridevirtual |
Fetch keys for CENC from the key server.
pssh_box | The entire PSSH box for the content to be decrypted |
Implements shaka::media::KeySource.
Definition at line 175 of file widevine_key_source.cc.
|
overridevirtual |
Fetch keys for CENC from the key server.
key_ids | the key IDs for the keys to fetch from the server. |
Implements shaka::media::KeySource.
Definition at line 202 of file widevine_key_source.cc.
|
overridevirtual |
Fetch keys for WVM decryption from the key server.
asset_id | is the Widevine Classic asset ID for the content to be decrypted. |
Implements shaka::media::KeySource.
Definition at line 223 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 164 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. |
track_type | is the type of track 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 258 of file widevine_key_source.cc.
|
overridevirtual |
Get encryption key of the specified track type.
track_type | is the type of track 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 232 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 242 of file widevine_key_source.cc.
void shaka::media::WidevineKeySource::set_key_fetcher | ( | scoped_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 284 of file widevine_key_source.cc.
void shaka::media::WidevineKeySource::set_signer | ( | scoped_ptr< RequestSigner > | signer | ) |
Set signer for the key source.
signer | signs the request message. |
Definition at line 280 of file widevine_key_source.cc.