summaryrefslogtreecommitdiffstats
path: root/drm/libdrmframework/plugins
diff options
context:
space:
mode:
authorTakeshi Aimi <aimitakeshi@gmail.com>2010-10-08 23:05:49 +0900
committerTakeshi Aimi <aimitakeshi@gmail.com>2010-11-02 08:06:06 +0900
commite943f84129326ab885cc7a69dcfa17f766b72b89 (patch)
tree45602605772fcd85d240cbfd900b82e0067453e9 /drm/libdrmframework/plugins
parentdcd25efb46c41c8d24a0a9cf61fb57f84149709e (diff)
downloadframeworks_av-e943f84129326ab885cc7a69dcfa17f766b72b89.zip
frameworks_av-e943f84129326ab885cc7a69dcfa17f766b72b89.tar.gz
frameworks_av-e943f84129326ab885cc7a69dcfa17f766b72b89.tar.bz2
Update of DRM framework
- Overload openDecryptSession() with uri parameter in order to accept URI of DRM content, Following API is added, DecryptHandle*openDecryptSession(const char* uri);. - Unify texisting three event types of processDrmInfo() so that caller of DRM framework does not have to handle many event types. - Let DrmManagerService call load/unload plugins API so that client of DRM framework does not have to manage plug-in load/unload. - Trivial fix in DrmManagerClient.java is also incorporated. Changes are made by Sony Corporation. Change-Id: If62b47fa0360718fdc943e6e6143671d7db26adc
Diffstat (limited to 'drm/libdrmframework/plugins')
-rw-r--r--drm/libdrmframework/plugins/common/include/DrmEngineBase.h15
-rw-r--r--drm/libdrmframework/plugins/common/include/IDrmEngine.h12
-rw-r--r--drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h3
-rw-r--r--drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp17
4 files changed, 41 insertions, 6 deletions
diff --git a/drm/libdrmframework/plugins/common/include/DrmEngineBase.h b/drm/libdrmframework/plugins/common/include/DrmEngineBase.h
index b355534..5851af5 100644
--- a/drm/libdrmframework/plugins/common/include/DrmEngineBase.h
+++ b/drm/libdrmframework/plugins/common/include/DrmEngineBase.h
@@ -80,6 +80,9 @@ public:
status_t openDecryptSession(
int uniqueId, DecryptHandle* decryptHandle, int fd, int offset, int length);
+ status_t openDecryptSession(
+ int uniqueId, DecryptHandle* decryptHandle, const char* uri);
+
status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle);
status_t initializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle,
@@ -355,6 +358,18 @@ protected:
int uniqueId, DecryptHandle* decryptHandle, int fd, int offset, int length) = 0;
/**
+ * Open the decrypt session to decrypt the given protected content
+ *
+ * @param[in] uniqueId Unique identifier for a session
+ * @param[in] decryptHandle Handle for the current decryption session
+ * @param[in] uri Path of the protected content to be decrypted
+ * @return
+ * DRM_ERROR_CANNOT_HANDLE for failure and DRM_NO_ERROR for success
+ */
+ virtual status_t onOpenDecryptSession(
+ int uniqueId, DecryptHandle* decryptHandle, const char* uri) = 0;
+
+ /**
* Close the decrypt session for the given handle
*
* @param[in] uniqueId Unique identifier for a session
diff --git a/drm/libdrmframework/plugins/common/include/IDrmEngine.h b/drm/libdrmframework/plugins/common/include/IDrmEngine.h
index b711500..cc03ef2 100644
--- a/drm/libdrmframework/plugins/common/include/IDrmEngine.h
+++ b/drm/libdrmframework/plugins/common/include/IDrmEngine.h
@@ -315,6 +315,18 @@ public:
int uniqueId, DecryptHandle* decryptHandle, int fd, int offset, int length) = 0;
/**
+ * Open the decrypt session to decrypt the given protected content
+ *
+ * @param[in] uniqueId Unique identifier for a session
+ * @param[in] decryptHandle Handle for the current decryption session
+ * @param[in] uri Path of the protected content to be decrypted
+ * @return
+ * DRM_ERROR_CANNOT_HANDLE for failure and DRM_NO_ERROR for success
+ */
+ virtual status_t openDecryptSession(
+ int uniqueId, DecryptHandle* decryptHandle, const char* uri) = 0;
+
+ /**
* Close the decrypt session for the given handle
*
* @param[in] uniqueId Unique identifier for a session
diff --git a/drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h b/drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h
index eed1628..ddb7fd3 100644
--- a/drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h
+++ b/drm/libdrmframework/plugins/passthru/include/DrmPassthruPlugIn.h
@@ -74,6 +74,9 @@ protected:
status_t onOpenDecryptSession(
int uniqueId, DecryptHandle* decryptHandle, int fd, int offset, int length);
+ status_t onOpenDecryptSession(
+ int uniqueId, DecryptHandle* decryptHandle, const char* uri);
+
status_t onCloseDecryptSession(int uniqueId, DecryptHandle* decryptHandle);
status_t onInitializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle,
diff --git a/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp b/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
index 4c7714d..41f8e91 100644
--- a/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
+++ b/drm/libdrmframework/plugins/passthru/src/DrmPassthruPlugIn.cpp
@@ -74,14 +74,14 @@ DrmInfoStatus* DrmPassthruPlugIn::onProcessDrmInfo(int uniqueId, const DrmInfo*
switch (drmInfo->getInfoType()) {
case DrmInfoRequest::TYPE_REGISTRATION_INFO: {
const DrmBuffer* emptyBuffer = new DrmBuffer();
- drmInfoStatus
- = new DrmInfoStatus(DrmInfoStatus::STATUS_OK, emptyBuffer, drmInfo->getMimeType());
+ drmInfoStatus = new DrmInfoStatus(DrmInfoStatus::STATUS_OK,
+ DrmInfoRequest::TYPE_REGISTRATION_INFO, emptyBuffer, drmInfo->getMimeType());
break;
}
case DrmInfoRequest::TYPE_UNREGISTRATION_INFO: {
const DrmBuffer* emptyBuffer = new DrmBuffer();
- drmInfoStatus
- = new DrmInfoStatus(DrmInfoStatus::STATUS_OK, emptyBuffer, drmInfo->getMimeType());
+ drmInfoStatus = new DrmInfoStatus(DrmInfoStatus::STATUS_OK,
+ DrmInfoRequest::TYPE_UNREGISTRATION_INFO, emptyBuffer, drmInfo->getMimeType());
break;
}
case DrmInfoRequest::TYPE_RIGHTS_ACQUISITION_INFO: {
@@ -91,8 +91,8 @@ DrmInfoStatus* DrmPassthruPlugIn::onProcessDrmInfo(int uniqueId, const DrmInfo*
data = new char[bufferSize];
memcpy(data, licenseString.string(), bufferSize);
const DrmBuffer* buffer = new DrmBuffer(data, bufferSize);
- drmInfoStatus
- = new DrmInfoStatus(DrmInfoStatus::STATUS_OK, buffer, drmInfo->getMimeType());
+ drmInfoStatus = new DrmInfoStatus(DrmInfoStatus::STATUS_OK,
+ DrmInfoRequest::TYPE_RIGHTS_ACQUISITION_INFO, buffer, drmInfo->getMimeType());
break;
}
}
@@ -243,6 +243,11 @@ status_t DrmPassthruPlugIn::onOpenDecryptSession(
return DRM_ERROR_CANNOT_HANDLE;
}
+status_t DrmPassthruPlugIn::onOpenDecryptSession(
+ int uniqueId, DecryptHandle* decryptHandle, const char* uri) {
+ return DRM_ERROR_CANNOT_HANDLE;
+}
+
status_t DrmPassthruPlugIn::onCloseDecryptSession(int uniqueId, DecryptHandle* decryptHandle) {
LOGD("DrmPassthruPlugIn::onCloseDecryptSession() : %d", uniqueId);
if (NULL != decryptHandle) {