DASH Media Packaging SDK
|
A key source that uses fixed keys for encryption. More...
#include <fixed_key_source.h>
Public Member Functions | |
KeySource implementation overrides. | |
Status | FetchKeys (EmeInitDataType init_data_type, const std::vector< uint8_t > &init_data) 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 |
Static Public Member Functions | |
static std::unique_ptr < FixedKeySource > | CreateFromHexStrings (const std::string &key_id_hex, const std::string &key_hex, const std::string &pssh_boxes_hex, const std::string &iv_hex) |
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. | |
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_UHD1 = 3, TRACK_TYPE_UHD2 = 4, TRACK_TYPE_AUDIO = 5, TRACK_TYPE_UNSPECIFIED = 6, NUM_VALID_TRACK_TYPES = 6 } |
A key source that uses fixed keys for encryption.
Definition at line 27 of file fixed_key_source.h.
|
static |
Creates a new FixedKeySource from the given hex strings. Returns null if the strings are invalid.
key_id_hex | is the key id in hex string. |
key_hex | is the key in hex string. |
pssh_boxes_hex | is the pssh_boxes in hex string. |
iv_hex | is the IV in hex string. If not specified, a randomly generated IV with the default length will be used. Note: GetKey on the created key source will always return the same key for all track types. |
Definition at line 77 of file fixed_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 18 of file fixed_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 45 of file fixed_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 24 of file fixed_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 31 of file fixed_key_source.cc.