DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Static Public 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::FixedKeySource shaka::media::PlayReadyKeySource shaka::media::WidevineKeySource

Public Types

enum  TrackType {
  TRACK_TYPE_UNKNOWN = 0, TRACK_TYPE_SD = 1, TRACK_TYPE_HD = 2, TRACK_TYPE_UHD1 = 3,
  TRACK_TYPE_UHD2 = 4, TRACK_TYPE_AUDIO = 5, TRACK_TYPE_UNSPECIFIED = 6, NUM_VALID_TRACK_TYPES = 6
}
 

Public Member Functions

virtual Status FetchKeys (const std::vector< uint8_t > &pssh_box)=0
 
virtual Status FetchKeys (const std::vector< std::vector< uint8_t >> &key_ids)=0
 
virtual Status FetchKeys (uint32_t asset_id)=0
 
virtual Status GetKey (TrackType track_type, EncryptionKey *key)=0
 
virtual Status GetKey (const std::vector< uint8_t > &key_id, EncryptionKey *key)=0
 
virtual Status GetCryptoPeriodKey (uint32_t crypto_period_index, TrackType track_type, EncryptionKey *key)=0
 

Static Public Member Functions

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.
 

Detailed Description

KeySource is responsible for encryption key acquisition.

Definition at line 30 of file key_source.h.

Member Function Documentation

virtual Status shaka::media::KeySource::FetchKeys ( const std::vector< uint8_t > &  pssh_box)
pure virtual

Fetch keys for CENC from the key server.

Parameters
pssh_boxThe entire PSSH box for the content to be decrypted
Returns
OK on success, an error status otherwise.

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

virtual Status shaka::media::KeySource::FetchKeys ( const std::vector< std::vector< uint8_t >> &  key_ids)
pure virtual

Fetch keys for CENC from the key server.

Parameters
key_idsthe key IDs for the keys to fetch from the server.
Returns
OK on success, an error status otherwise.

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

virtual Status shaka::media::KeySource::FetchKeys ( uint32_t  asset_id)
pure virtual

Fetch keys for WVM decryption from the key server.

Parameters
asset_idis the Widevine Classic asset ID for the content to be decrypted.
Returns
OK on success, an error status otherwise.

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

virtual Status shaka::media::KeySource::GetCryptoPeriodKey ( uint32_t  crypto_period_index,
TrackType  track_type,
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.
track_typeis the type of track 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::FixedKeySource.

virtual Status shaka::media::KeySource::GetKey ( TrackType  track_type,
EncryptionKey key 
)
pure virtual

Get encryption key of the specified track type.

Parameters
track_typeis the type of track 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::FixedKeySource.

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::FixedKeySource.


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