Refactor WvCdmEventListener and some cleanups
Bug: 19771437 It is a merge of below CLs from Widevine CDM repo: Clean up CdmSession and PolicyEngine testing injection https://widevine-internal-review.googlesource.com/#/c/13700 Refactor WvCdmEventListener handling https://widevine-internal-review.googlesource.com/#/c/13702 Change-Id: I356b90000c056113d394926862b859aab380d305
This commit is contained in:
@@ -38,16 +38,16 @@ bool WvContentDecryptionModule::IsWebm(const std::string& init_data_type) {
|
||||
}
|
||||
|
||||
CdmResponseType WvContentDecryptionModule::OpenSession(
|
||||
const CdmKeySystem& key_system,
|
||||
CdmClientPropertySet* property_set,
|
||||
CdmSessionId* session_id) {
|
||||
const CdmKeySystem& key_system, CdmClientPropertySet* property_set,
|
||||
WvCdmEventListener* event_listener, CdmSessionId* session_id) {
|
||||
if (property_set && property_set->is_session_sharing_enabled()) {
|
||||
AutoLock auto_lock(session_sharing_id_generation_lock_);
|
||||
if (property_set->session_sharing_id() == 0)
|
||||
property_set->set_session_sharing_id(GenerateSessionSharingId());
|
||||
}
|
||||
|
||||
return cdm_engine_->OpenSession(key_system, property_set, session_id);
|
||||
return cdm_engine_->OpenSession(key_system, property_set, event_listener,
|
||||
session_id);
|
||||
}
|
||||
|
||||
CdmResponseType WvContentDecryptionModule::CloseSession(
|
||||
@@ -69,9 +69,8 @@ CdmResponseType WvContentDecryptionModule::GenerateKeyRequest(
|
||||
std::string* server_url) {
|
||||
CdmResponseType sts;
|
||||
if (license_type == kLicenseTypeRelease) {
|
||||
sts = cdm_engine_->OpenKeySetSession(key_set_id, property_set);
|
||||
if (sts != NO_ERROR)
|
||||
return sts;
|
||||
sts = cdm_engine_->OpenKeySetSession(key_set_id, property_set, NULL);
|
||||
if (sts != NO_ERROR) return sts;
|
||||
}
|
||||
InitializationData initialization_data(init_data_type, init_data);
|
||||
sts = cdm_engine_->GenerateKeyRequest(session_id, key_set_id,
|
||||
@@ -195,16 +194,6 @@ CdmResponseType WvContentDecryptionModule::Decrypt(
|
||||
return cdm_engine_->Decrypt(local_session_id, parameters);
|
||||
}
|
||||
|
||||
bool WvContentDecryptionModule::AttachEventListener(
|
||||
const CdmSessionId& session_id, WvCdmEventListener* listener) {
|
||||
return cdm_engine_->AttachEventListener(session_id, listener);
|
||||
}
|
||||
|
||||
bool WvContentDecryptionModule::DetachEventListener(
|
||||
const CdmSessionId& session_id, WvCdmEventListener* listener) {
|
||||
return cdm_engine_->DetachEventListener(session_id, listener);
|
||||
}
|
||||
|
||||
void WvContentDecryptionModule::NotifyResolution(const CdmSessionId& session_id,
|
||||
uint32_t width,
|
||||
uint32_t height) {
|
||||
|
||||
Reference in New Issue
Block a user