Add CTS support for Widevine DRM plugin

Fix for bug 3329779

Change-Id: I2e44bea50c31e7c70162c8cb0496fde30e62c2dd
This commit is contained in:
Gloria Wang
2011-03-07 11:44:00 -08:00
parent 7e8c3b616e
commit 007788f060
7 changed files with 38 additions and 4 deletions

View File

@@ -176,7 +176,38 @@ DrmInfo* WVMDrmPlugin::onAcquireDrmInfo(int uniqueId, const DrmInfoRequest* drmI
break;
}
case DrmInfoRequest::TYPE_REGISTRATION_INFO:
case DrmInfoRequest::TYPE_UNREGISTRATION_INFO:
case DrmInfoRequest::TYPE_UNREGISTRATION_INFO: {
// creates a data store object per each portal
std::string assetDbPath = drmInfoRequest->get(String8("WVAssetDBPathKey")).string();
std::string portal = drmInfoRequest->get(String8("WVPortalKey")).string();
if (portal.size() == 0) {
LOGE("onAcquireDrmInfo: Must specify portal string for registration operations");
return NULL;
}
if (drmInfoRequest->getInfoType()==DrmInfoRequest::TYPE_REGISTRATION_INFO) {
if (!mDrmPluginImpl->RegisterDrmInfo(portal, assetDbPath)) {
LOGE("onAcquireDrmInfo: RegisterDrmInfo failed");
return NULL;
}
} else {
if (!mDrmPluginImpl->UnregisterDrmInfo(portal, assetDbPath)) {
LOGE("onAcquireDrmInfo: UnregisterDrmInfo failed");
return NULL;
}
}
String8 dataString("dummy_acquistion_string");
int length = dataString.length();
char* data = NULL;
data = new char[length];
memcpy(data, dataString.string(), length);
drmInfo = new DrmInfo(drmInfoRequest->getInfoType(),
DrmBuffer(data, length), drmInfoRequest->getMimeType());
break;
}
case DrmInfoRequest::TYPE_RIGHTS_ACQUISITION_PROGRESS_INFO: {
LOGE("onAcquireDrmInfo: Unsupported DrmInfoRequest type %d",
drmInfoRequest->getInfoType());
@@ -210,6 +241,9 @@ DrmInfoStatus* WVMDrmPlugin::onProcessDrmInfo(int uniqueId, const DrmInfo* drmIn
if (mDrmPluginImpl->ProcessDrmInfo(assetPath))
status = DrmInfoStatus::STATUS_OK;
} else if ((drmInfo->getInfoType() == DrmInfoRequest::TYPE_REGISTRATION_INFO) ||
(drmInfo->getInfoType() == DrmInfoRequest::TYPE_UNREGISTRATION_INFO)) {
status = DrmInfoStatus::STATUS_OK;
} else {
LOGE("onProcessDrmInfo : drmInfo type %d not supported", drmInfo->getInfoType());
}