47 ProtectionSystem protection_systems,
48 FourCC protection_scheme);
54 Status
FetchKeys(EmeInitDataType init_data_type,
55 const std::vector<uint8_t>& init_data)
override;
57 Status
GetKey(
const std::vector<uint8_t>& key_id,
60 int32_t crypto_period_duration_in_seconds,
61 const std::string& stream_label,
69 Status
FetchKeys(
const std::vector<uint8_t>& content_id,
70 const std::string& policy);
74 void set_signer(std::unique_ptr<RequestSigner> signer);
87 enable_entitlement_license_ = enable_entitlement_license;
95 Status GetKeyInternal(uint32_t crypto_period_index,
96 const std::string& stream_label,
100 void FetchKeysTask();
103 Status FetchKeysInternal(
bool enable_key_rotation,
104 uint32_t first_crypto_period_index,
105 bool widevine_classic);
109 void FillRequest(
bool enable_key_rotation,
110 uint32_t first_crypto_period_index,
111 CommonEncryptionRequest* request);
114 Status GenerateKeyMessage(
const CommonEncryptionRequest& request,
115 std::string* message);
120 bool ExtractEncryptionKey(
bool enable_key_rotation,
121 bool widevine_classic,
122 const std::string& response,
123 bool* transient_error);
125 bool PushToKeyPool(EncryptionKeyMap* encryption_key_map);
128 bool generate_widevine_protection_system_ =
true;
133 std::unique_ptr<KeyFetcher> key_fetcher_;
134 std::string server_url_;
135 std::unique_ptr<RequestSigner> signer_;
136 std::unique_ptr<CommonEncryptionRequest> common_encryption_request_;
138 const int crypto_period_count_;
139 FourCC protection_scheme_ = FOURCC_NULL;
142 bool key_production_started_ =
false;
143 absl::Notification start_key_production_;
144 uint32_t first_crypto_period_index_ = 0;
145 int32_t crypto_period_duration_in_seconds_ = 0;
146 std::vector<uint8_t> group_id_;
147 bool enable_entitlement_license_ =
false;
148 std::unique_ptr<EncryptionKeyQueue> key_pool_;
150 EncryptionKeyMap encryption_key_map_;
151 Status common_encryption_request_status_;
153 std::thread key_production_thread_;