Shaka Packager SDK
Public Member Functions | Protected Member Functions | List of all members
shaka::media::KeySource Class Referenceabstract

KeySource is responsible for encryption key acquisition. More...

#include <key_source.h>

Inheritance diagram for shaka::media::KeySource:
shaka::media::PlayReadyKeySource shaka::media::RawKeySource shaka::media::WidevineKeySource

Public Member Functions

 KeySource (int protection_systems_flags, FourCC protection_scheme)
 
virtual Status FetchKeys (EmeInitDataType init_data_type, const std::vector< uint8_t > &init_data)=0
 
virtual Status GetKey (const std::string &stream_label, EncryptionKey *key)=0
 
virtual Status GetKey (const std::vector< uint8_t > &key_id, EncryptionKey *key)=0
 
virtual Status GetCryptoPeriodKey (uint32_t crypto_period_index, const std::string &stream_label, EncryptionKey *key)=0
 

Protected Member Functions

Status UpdateProtectionSystemInfo (EncryptionKeyMap *encryption_key_map)
 

Detailed Description

KeySource is responsible for encryption key acquisition.

Definition at line 48 of file key_source.h.

Member Function Documentation

◆ FetchKeys()

virtual Status shaka::media::KeySource::FetchKeys ( EmeInitDataType  init_data_type,
const std::vector< uint8_t > &  init_data 
)
pure virtual

Fetch keys based on the specified encrypted media init data.

Parameters
init_data_typespecifies the encrypted media init data type.
init_datacontains the init data.
Returns
OK on success, an error status otherwise.

Implemented in shaka::media::PlayReadyKeySource, shaka::media::WidevineKeySource, and shaka::media::RawKeySource.

◆ GetCryptoPeriodKey()

virtual Status shaka::media::KeySource::GetCryptoPeriodKey ( uint32_t  crypto_period_index,
const std::string &  stream_label,
EncryptionKey key 
)
pure virtual

Get encryption key of the specified track type at the specified index.

Parameters
crypto_period_indexis the sequence number of the key rotation period for which the key is being retrieved.
stream_labelis the label of stream for which retrieving the key.
keyis a pointer to the EncryptionKey which will hold the retrieved key. Owner retains ownership, and may not be NULL.
Returns
OK on success, an error status otherwise.

Implemented in shaka::media::PlayReadyKeySource, shaka::media::WidevineKeySource, and shaka::media::RawKeySource.

◆ GetKey() [1/2]

virtual Status shaka::media::KeySource::GetKey ( const std::string &  stream_label,
EncryptionKey key 
)
pure virtual

Get encryption key of the specified stream label.

Parameters
stream_labelis the label of stream for which retrieving the key.
keyis a pointer to the EncryptionKey which will hold the retrieved key. Owner retains ownership, and may not be NULL.
Returns
OK on success, an error status otherwise.

Implemented in shaka::media::PlayReadyKeySource, shaka::media::WidevineKeySource, and shaka::media::RawKeySource.

◆ GetKey() [2/2]

virtual Status shaka::media::KeySource::GetKey ( const std::vector< uint8_t > &  key_id,
EncryptionKey key 
)
pure virtual

Get the encryption key specified by the CENC key ID.

Parameters
key_idis the unique identifier for the key being retreived.
keyis a pointer to the EncryptionKey which will hold the retrieved key. Owner retains ownership, and may not be NULL.
Returns
OK on success, or an error status otherwise.

Implemented in shaka::media::PlayReadyKeySource, shaka::media::WidevineKeySource, and shaka::media::RawKeySource.

◆ UpdateProtectionSystemInfo()

Status shaka::media::KeySource::UpdateProtectionSystemInfo ( EncryptionKeyMap *  encryption_key_map)
protected

Update the protection sysmtem specific info for the encryption keys.

Parameters
encryption_key_mapis a map of encryption keys for all tracks.

Definition at line 39 of file key_source.cc.


The documentation for this class was generated from the following files: