Shaka Packager SDK
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
shaka::media::CpixKeySource Class Reference

#include <cpix_key_source.h>

Inheritance diagram for shaka::media::CpixKeySource:
shaka::media::KeySource

Public Member Functions

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, int32_t crypto_period_duration_in_seconds, const std::string &stream_label, EncryptionKey *key) override
 

Static Public Member Functions

static std::unique_ptr< CpixKeySourceCreate (const CpixEncryptionParams &cpix_params)
 
static std::unique_ptr< CpixKeySourceCreateWithFetcher (const CpixEncryptionParams &cpix_params, CpixFetcher *fetcher)
 
static std::unique_ptr< CpixKeySourceCreateForDecryption (const CpixEncryptionParams &cpix_params)
 

Detailed Description

A key source that uses keys from a CPIX (DASH-IF Content Protection Information Exchange) document. Keys are mapped to streams through the document's ContentKeyUsageRuleList: the intendedTrackType attribute is matched against the DRM label of the stream (e.g. AUDIO, SD, HD, UHD1). DRM signaling (PSSH) is taken from the document's DRMSystemList.

Definition at line 42 of file cpix_key_source.h.

Constructor & Destructor Documentation

◆ ~CpixKeySource()

shaka::media::CpixKeySource::~CpixKeySource ( )
override

Definition at line 613 of file cpix_key_source.cc.

Member Function Documentation

◆ Create()

std::unique_ptr< CpixKeySource > shaka::media::CpixKeySource::Create ( const CpixEncryptionParams &  cpix_params)
static

Creates a new CpixKeySource from the given parameters. Returns null if the document cannot be read or fetched, or is malformed. A key's commonEncryptionScheme binding is carried on the returned keys and enforced where the stream's actual protection scheme is known.

Parameters
cpix_paramscontains parameters to setup the key source.

Definition at line 669 of file cpix_key_source.cc.

◆ CreateForDecryption()

std::unique_ptr< CpixKeySource > shaka::media::CpixKeySource::CreateForDecryption ( const CpixEncryptionParams &  cpix_params)
static

Creates a new CpixKeySource for decryption. Keys are looked up by key ID, so the document's usage rules and commonEncryptionScheme binding are ignored. Returns null if the document cannot be read or fetched, or is malformed.

Parameters
cpix_paramscontains parameters to setup the key source.

Definition at line 681 of file cpix_key_source.cc.

◆ CreateWithFetcher()

std::unique_ptr< CpixKeySource > shaka::media::CpixKeySource::CreateWithFetcher ( const CpixEncryptionParams &  cpix_params,
CpixFetcher fetcher 
)
static

Same as above, with an injected document fetcher. Should be used for testing only.

Definition at line 675 of file cpix_key_source.cc.

◆ FetchKeys()

Status shaka::media::CpixKeySource::FetchKeys ( EmeInitDataType  init_data_type,
const std::vector< uint8_t > &  init_data 
)
overridevirtual

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.

Implements shaka::media::KeySource.

Definition at line 615 of file cpix_key_source.cc.

◆ GetCryptoPeriodKey()

Status shaka::media::CpixKeySource::GetCryptoPeriodKey ( uint32_t  crypto_period_index,
int32_t  crypto_period_duration_in_seconds,
const std::string &  stream_label,
EncryptionKey key 
)
overridevirtual

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.
crypto_period_duration_in_secondsis the duration of the crypto period in seconds.
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.

Implements shaka::media::KeySource.

Definition at line 656 of file cpix_key_source.cc.

◆ GetKey() [1/2]

Status shaka::media::CpixKeySource::GetKey ( const std::string &  stream_label,
EncryptionKey key 
)
overridevirtual

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.

Implements shaka::media::KeySource.

Definition at line 623 of file cpix_key_source.cc.

◆ GetKey() [2/2]

Status shaka::media::CpixKeySource::GetKey ( const std::vector< uint8_t > &  key_id,
EncryptionKey key 
)
overridevirtual

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.

Implements shaka::media::KeySource.

Definition at line 641 of file cpix_key_source.cc.


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