43 ProtectionSystem protection_systems,
44 FourCC protection_scheme);
50 Status
FetchKeys(EmeInitDataType init_data_type,
51 const std::vector<uint8_t>& init_data)
override;
53 Status
GetKey(
const std::vector<uint8_t>& key_id,
56 int32_t crypto_period_duration_in_seconds,
57 const std::string& stream_label,
65 Status
FetchKeys(
const std::vector<uint8_t>& content_id,
66 const std::string& policy);
70 void set_signer(std::unique_ptr<RequestSigner> signer);
83 enable_entitlement_license_ = enable_entitlement_license;
91 Status GetKeyInternal(uint32_t crypto_period_index,
92 const std::string& stream_label,
99 Status FetchKeysInternal(
bool enable_key_rotation,
100 uint32_t first_crypto_period_index,
101 bool widevine_classic);
105 void FillRequest(
bool enable_key_rotation,
106 uint32_t first_crypto_period_index,
107 CommonEncryptionRequest* request);
110 Status GenerateKeyMessage(
const CommonEncryptionRequest& request,
111 std::string* message);
116 bool ExtractEncryptionKey(
bool enable_key_rotation,
117 bool widevine_classic,
118 const std::string& response,
119 bool* transient_error);
121 bool PushToKeyPool(EncryptionKeyMap* encryption_key_map);
124 bool generate_widevine_protection_system_ =
true;
129 std::unique_ptr<KeyFetcher> key_fetcher_;
130 std::string server_url_;
131 std::unique_ptr<RequestSigner> signer_;
132 std::unique_ptr<CommonEncryptionRequest> common_encryption_request_;
134 const int crypto_period_count_;
135 FourCC protection_scheme_ = FOURCC_NULL;
138 bool key_production_started_ =
false;
139 absl::Notification start_key_production_;
140 uint32_t first_crypto_period_index_ = 0;
141 int32_t crypto_period_duration_in_seconds_ = 0;
142 std::vector<uint8_t> group_id_;
143 bool enable_entitlement_license_ =
false;
144 std::unique_ptr<EncryptionKeyQueue> key_pool_;
146 EncryptionKeyMap encryption_key_map_;
147 Status common_encryption_request_status_;
149 std::thread key_production_thread_;