am 007788f0: Add CTS support for Widevine DRM plugin Fix for bug 3329779
* commit '007788f06079a4521a843ed098d689fceb147f22': Add CTS support for Widevine DRM plugin Fix for bug 3329779
This commit is contained in:
@@ -45,6 +45,8 @@ class WVDRMPluginAPI {
|
|||||||
virtual void CloseSession() = 0;
|
virtual void CloseSession() = 0;
|
||||||
virtual bool IsSupportedMediaType(const char *uri) = 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,
|
virtual bool AcquireDrmInfo(std::string &assetPath, WVCredentials &credentials,
|
||||||
std::string &dsPath,
|
std::string &dsPath,
|
||||||
const std::string &assetIdStr, const std::string &systemIdStr,
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case DrmInfoRequest::TYPE_REGISTRATION_INFO:
|
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: {
|
case DrmInfoRequest::TYPE_RIGHTS_ACQUISITION_PROGRESS_INFO: {
|
||||||
LOGE("onAcquireDrmInfo: Unsupported DrmInfoRequest type %d",
|
LOGE("onAcquireDrmInfo: Unsupported DrmInfoRequest type %d",
|
||||||
drmInfoRequest->getInfoType());
|
drmInfoRequest->getInfoType());
|
||||||
@@ -210,6 +241,9 @@ DrmInfoStatus* WVMDrmPlugin::onProcessDrmInfo(int uniqueId, const DrmInfo* drmIn
|
|||||||
|
|
||||||
if (mDrmPluginImpl->ProcessDrmInfo(assetPath))
|
if (mDrmPluginImpl->ProcessDrmInfo(assetPath))
|
||||||
status = DrmInfoStatus::STATUS_OK;
|
status = DrmInfoStatus::STATUS_OK;
|
||||||
|
} else if ((drmInfo->getInfoType() == DrmInfoRequest::TYPE_REGISTRATION_INFO) ||
|
||||||
|
(drmInfo->getInfoType() == DrmInfoRequest::TYPE_UNREGISTRATION_INFO)) {
|
||||||
|
status = DrmInfoStatus::STATUS_OK;
|
||||||
} else {
|
} else {
|
||||||
LOGE("onProcessDrmInfo : drmInfo type %d not supported", drmInfo->getInfoType());
|
LOGE("onProcessDrmInfo : drmInfo type %d not supported", drmInfo->getInfoType());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ LOCAL_SRC_FILES:= \
|
|||||||
|
|
||||||
LOCAL_C_INCLUDES+= \
|
LOCAL_C_INCLUDES+= \
|
||||||
bionic \
|
bionic \
|
||||||
vendor/widevine/proprietary/include \
|
|
||||||
vendor/widevine/proprietary/drmwvmplugin/include \
|
vendor/widevine/proprietary/drmwvmplugin/include \
|
||||||
vendor/widevine/proprietary/streamcontrol/include \
|
vendor/widevine/proprietary/streamcontrol/include \
|
||||||
external/stlport/stlport \
|
external/stlport/stlport \
|
||||||
|
|||||||
Binary file not shown.
@@ -6,7 +6,6 @@ LOCAL_SRC_FILES:= \
|
|||||||
|
|
||||||
LOCAL_C_INCLUDES+= \
|
LOCAL_C_INCLUDES+= \
|
||||||
bionic \
|
bionic \
|
||||||
vendor/widevine/proprietary/include \
|
|
||||||
external/stlport/stlport \
|
external/stlport/stlport \
|
||||||
vendor/widevine/proprietary/streamcontrol/include \
|
vendor/widevine/proprietary/streamcontrol/include \
|
||||||
vendor/widevine/proprietary/drmwvmplugin/include
|
vendor/widevine/proprietary/drmwvmplugin/include
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ LOCAL_SRC_FILES:= \
|
|||||||
|
|
||||||
LOCAL_C_INCLUDES+= \
|
LOCAL_C_INCLUDES+= \
|
||||||
bionic \
|
bionic \
|
||||||
vendor/widevine/proprietary/include \
|
vendor/widevine/proprietary/wvm/include \
|
||||||
external/stlport/stlport \
|
external/stlport/stlport \
|
||||||
frameworks/base/media/libstagefright
|
frameworks/base/media/libstagefright
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user