42 ProtectionSystem protection_systems,
43 FourCC protection_scheme);
49 Status
FetchKeys(EmeInitDataType init_data_type,
50 const std::vector<uint8_t>& init_data)
override;
52 Status
GetKey(
const std::vector<uint8_t>& key_id,
55 int32_t crypto_period_duration_in_seconds,
56 const std::string& stream_label,
64 Status
FetchKeys(
const std::vector<uint8_t>& content_id,
65 const std::string& policy);
69 void set_signer(std::unique_ptr<RequestSigner> signer);
82 enable_entitlement_license_ = enable_entitlement_license;
90 Status GetKeyInternal(uint32_t crypto_period_index,
91 const std::string& stream_label,
98 Status FetchKeysInternal(
bool enable_key_rotation,
99 uint32_t first_crypto_period_index,
100 bool widevine_classic);
104 void FillRequest(
bool enable_key_rotation,
105 uint32_t first_crypto_period_index,
106 CommonEncryptionRequest* request);
109 Status GenerateKeyMessage(
const CommonEncryptionRequest& request,
110 std::string* message);
115 bool ExtractEncryptionKey(
bool enable_key_rotation,
116 bool widevine_classic,
117 const std::string& response,
118 bool* transient_error);
120 bool PushToKeyPool(EncryptionKeyMap* encryption_key_map);
123 bool generate_widevine_protection_system_ =
true;
128 std::unique_ptr<KeyFetcher> key_fetcher_;
129 std::string server_url_;
130 std::unique_ptr<RequestSigner> signer_;
131 std::unique_ptr<CommonEncryptionRequest> common_encryption_request_;
133 const int crypto_period_count_;
134 FourCC protection_scheme_ = FOURCC_NULL;
137 bool key_production_started_ =
false;
138 absl::Notification start_key_production_;
139 uint32_t first_crypto_period_index_ = 0;
140 int32_t crypto_period_duration_in_seconds_ = 0;
141 std::vector<uint8_t> group_id_;
142 bool enable_entitlement_license_ =
false;
143 std::unique_ptr<EncryptionKeyQueue> key_pool_;
145 EncryptionKeyMap encryption_key_map_;
146 Status common_encryption_request_status_;
148 std::thread key_production_thread_;