summaryrefslogtreecommitdiffstats
path: root/drm/drmserver/DrmManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drm/drmserver/DrmManager.cpp')
-rw-r--r--drm/drmserver/DrmManager.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/drm/drmserver/DrmManager.cpp b/drm/drmserver/DrmManager.cpp
index 999295a..737edab 100644
--- a/drm/drmserver/DrmManager.cpp
+++ b/drm/drmserver/DrmManager.cpp
@@ -484,6 +484,36 @@ DecryptHandle* DrmManager::openDecryptSession(
return handle;
}
+DecryptHandle* DrmManager::openDecryptSession(
+ int uniqueId, const DrmBuffer& buf, const String8& mimeType) {
+ Mutex::Autolock _l(mDecryptLock);
+ status_t result = DRM_ERROR_CANNOT_HANDLE;
+ Vector<String8> plugInIdList = mPlugInManager.getPlugInIdList();
+
+ DecryptHandle* handle = new DecryptHandle();
+ if (NULL != handle) {
+ handle->decryptId = mDecryptSessionId + 1;
+
+ for (size_t index = 0; index < plugInIdList.size(); index++) {
+ String8 plugInId = plugInIdList.itemAt(index);
+ IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
+ result = rDrmEngine.openDecryptSession(uniqueId, handle, buf, mimeType);
+
+ if (DRM_NO_ERROR == result) {
+ ++mDecryptSessionId;
+ mDecryptSessionMap.add(mDecryptSessionId, &rDrmEngine);
+ break;
+ }
+ }
+ }
+ if (DRM_NO_ERROR != result) {
+ delete handle;
+ handle = NULL;
+ ALOGV("DrmManager::openDecryptSession: no capable plug-in found");
+ }
+ return handle;
+}
+
status_t DrmManager::closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle) {
Mutex::Autolock _l(mDecryptLock);
status_t result = DRM_ERROR_UNKNOWN;