7 #ifndef PACKAGER_MEDIA_BASE_KEY_SOURCE_H_ 8 #define PACKAGER_MEDIA_BASE_KEY_SOURCE_H_ 15 #include "packager/media/base/fourccs.h" 16 #include "packager/media/base/protection_system_specific_info.h" 17 #include "packager/media/base/pssh_generator.h" 18 #include "packager/status.h" 25 enum class EmeInitDataType {
35 MAX = WIDEVINE_CLASSIC
39 std::vector<ProtectionSystemSpecificInfo> key_system_info;
40 std::vector<uint8_t> key_id;
41 std::vector<uint8_t> key;
42 std::vector<uint8_t> iv;
45 typedef std::map<std::string, std::unique_ptr<EncryptionKey>> EncryptionKeyMap;
50 KeySource(
int protection_systems_flags, FourCC protection_scheme);
58 virtual Status FetchKeys(EmeInitDataType init_data_type,
59 const std::vector<uint8_t>& init_data) = 0;
66 virtual Status GetKey(
const std::string& stream_label,
74 virtual Status GetKey(
const std::vector<uint8_t>& key_id,
86 virtual Status GetCryptoPeriodKey(uint32_t crypto_period_index,
87 uint32_t crypto_period_duration_in_seconds,
88 const std::string& stream_label,
94 Status UpdateProtectionSystemInfo(EncryptionKeyMap* encryption_key_map);
97 std::vector<std::unique_ptr<PsshGenerator>> pssh_generators_;
98 std::vector<std::vector<uint8_t>> no_pssh_systems_;
106 #endif // PACKAGER_MEDIA_BASE_KEY_SOURCE_H_ All the methods that are virtual are virtual for mocking.