44 ProtectionSystem protection_systems,
45 FourCC protection_scheme);
51 Status
FetchKeys(EmeInitDataType init_data_type,
52 const std::vector<uint8_t>& init_data)
override;
54 Status
GetKey(
const std::vector<uint8_t>& key_id,
57 int32_t crypto_period_duration_in_seconds,
58 const std::string& stream_label,
66 Status
FetchKeys(
const std::vector<uint8_t>& content_id,
67 const std::string& policy);
71 void set_signer(std::unique_ptr<RequestSigner> signer);
84 enable_entitlement_license_ = enable_entitlement_license;
92 Status GetKeyInternal(uint32_t crypto_period_index,
93 const std::string& stream_label,
100 Status FetchKeysInternal(
bool enable_key_rotation,
101 uint32_t first_crypto_period_index,
102 bool widevine_classic);
106 void FillRequest(
bool enable_key_rotation,
107 uint32_t first_crypto_period_index,
108 CommonEncryptionRequest* request);
111 Status GenerateKeyMessage(
const CommonEncryptionRequest& request,
112 std::string* message);
117 bool ExtractEncryptionKey(
bool enable_key_rotation,
118 bool widevine_classic,
119 const std::string& response,
120 bool* transient_error);
122 bool PushToKeyPool(EncryptionKeyMap* encryption_key_map);
125 bool generate_widevine_protection_system_ =
true;
130 std::unique_ptr<KeyFetcher> key_fetcher_;
131 std::string server_url_;
132 std::unique_ptr<RequestSigner> signer_;
133 std::unique_ptr<CommonEncryptionRequest> common_encryption_request_;
135 const int crypto_period_count_;
136 FourCC protection_scheme_ = FOURCC_NULL;
139 bool key_production_started_ =
false;
140 absl::Notification start_key_production_;
141 uint32_t first_crypto_period_index_ = 0;
142 int32_t crypto_period_duration_in_seconds_ = 0;
143 std::vector<uint8_t> group_id_;
144 bool enable_entitlement_license_ =
false;
145 std::unique_ptr<EncryptionKeyQueue> key_pool_;
147 EncryptionKeyMap encryption_key_map_;
148 Status common_encryption_request_status_;
150 std::thread key_production_thread_;