diff --git a/proprietary/drmwvmplugin/include/WVDRMPluginAPI.h b/proprietary/drmwvmplugin/include/WVDRMPluginAPI.h index dfe46bcd..88c70493 100644 --- a/proprietary/drmwvmplugin/include/WVDRMPluginAPI.h +++ b/proprietary/drmwvmplugin/include/WVDRMPluginAPI.h @@ -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, diff --git a/proprietary/drmwvmplugin/lib/libwvdrm.so b/proprietary/drmwvmplugin/lib/libwvdrm.so index 57f0d3e2..ca24df1b 100644 Binary files a/proprietary/drmwvmplugin/lib/libwvdrm.so and b/proprietary/drmwvmplugin/lib/libwvdrm.so differ diff --git a/proprietary/drmwvmplugin/src/WVMDrmPlugin.cpp b/proprietary/drmwvmplugin/src/WVMDrmPlugin.cpp index e0959df6..13d0d7e4 100644 --- a/proprietary/drmwvmplugin/src/WVMDrmPlugin.cpp +++ b/proprietary/drmwvmplugin/src/WVMDrmPlugin.cpp @@ -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()); } diff --git a/proprietary/drmwvmplugin/test/Android.mk b/proprietary/drmwvmplugin/test/Android.mk index 791c4acf..eac23d3e 100644 --- a/proprietary/drmwvmplugin/test/Android.mk +++ b/proprietary/drmwvmplugin/test/Android.mk @@ -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 \ diff --git a/proprietary/streamcontrol/lib/libWVStreamControlAPI.so b/proprietary/streamcontrol/lib/libWVStreamControlAPI.so index cc82ae1f..1bc15132 100644 Binary files a/proprietary/streamcontrol/lib/libWVStreamControlAPI.so and b/proprietary/streamcontrol/lib/libWVStreamControlAPI.so differ diff --git a/proprietary/streamcontrol/test/Android.mk b/proprietary/streamcontrol/test/Android.mk index 0ae11485..a125254b 100644 --- a/proprietary/streamcontrol/test/Android.mk +++ b/proprietary/streamcontrol/test/Android.mk @@ -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 diff --git a/proprietary/wvm/test/Android.mk b/proprietary/wvm/test/Android.mk index dc237def..8c7ad396 100644 --- a/proprietary/wvm/test/Android.mk +++ b/proprietary/wvm/test/Android.mk @@ -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