Add CTS support for Widevine DRM plugin
Fix for bug 3329779 Change-Id: I2e44bea50c31e7c70162c8cb0496fde30e62c2dd
This commit is contained in:
@@ -45,6 +45,8 @@ class WVDRMPluginAPI {
|
||||
virtual void CloseSession() = 0;
|
||||
virtual bool IsSupportedMediaType(const char *uri) = 0;
|
||||
|
||||
virtual bool RegisterDrmInfo(std::string &portal, std::string &dsPath) = 0;
|
||||
virtual bool UnregisterDrmInfo(std::string &portal, std::string &dsPath) = 0;
|
||||
virtual bool AcquireDrmInfo(std::string &assetPath, WVCredentials &credentials,
|
||||
std::string &dsPath,
|
||||
const std::string &assetIdStr, const std::string &systemIdStr,
|
||||
|
||||
Binary file not shown.
@@ -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());
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ LOCAL_SRC_FILES:= \
|
||||
|
||||
LOCAL_C_INCLUDES+= \
|
||||
bionic \
|
||||
vendor/widevine/proprietary/include \
|
||||
vendor/widevine/proprietary/drmwvmplugin/include \
|
||||
vendor/widevine/proprietary/streamcontrol/include \
|
||||
external/stlport/stlport \
|
||||
|
||||
Binary file not shown.
@@ -6,7 +6,6 @@ LOCAL_SRC_FILES:= \
|
||||
|
||||
LOCAL_C_INCLUDES+= \
|
||||
bionic \
|
||||
vendor/widevine/proprietary/include \
|
||||
external/stlport/stlport \
|
||||
vendor/widevine/proprietary/streamcontrol/include \
|
||||
vendor/widevine/proprietary/drmwvmplugin/include
|
||||
|
||||
@@ -6,7 +6,7 @@ LOCAL_SRC_FILES:= \
|
||||
|
||||
LOCAL_C_INCLUDES+= \
|
||||
bionic \
|
||||
vendor/widevine/proprietary/include \
|
||||
vendor/widevine/proprietary/wvm/include \
|
||||
external/stlport/stlport \
|
||||
frameworks/base/media/libstagefright
|
||||
|
||||
|
||||
Reference in New Issue
Block a user