7 #ifndef PACKAGER_MEDIA_BASE_KEY_SOURCE_H_ 8 #define PACKAGER_MEDIA_BASE_KEY_SOURCE_H_ 15 #include "packager/media/base/protection_system_specific_info.h" 16 #include "packager/media/base/pssh_generator.h" 17 #include "packager/status.h" 24 enum class EmeInitDataType {
34 MAX = WIDEVINE_CLASSIC
41 std::vector<ProtectionSystemSpecificInfo> key_system_info;
42 std::vector<uint8_t> key_id;
43 std::vector<uint8_t> key;
44 std::vector<uint8_t> iv;
47 typedef std::map<std::string, std::unique_ptr<EncryptionKey>> EncryptionKeyMap;
52 explicit KeySource(
int protection_systems_flags);
60 virtual Status FetchKeys(EmeInitDataType init_data_type,
61 const std::vector<uint8_t>& init_data) = 0;
68 virtual Status GetKey(
const std::string& stream_label,
76 virtual Status GetKey(
const std::vector<uint8_t>& key_id,
86 virtual Status GetCryptoPeriodKey(uint32_t crypto_period_index,
87 const std::string& stream_label,
93 Status UpdateProtectionSystemInfo(EncryptionKeyMap* encryption_key_map);
96 std::vector<std::unique_ptr<PsshGenerator>> pssh_generators_;
104 #endif // PACKAGER_MEDIA_BASE_KEY_SOURCE_H_ All the methods that are virtual are virtual for mocking.