diff options
| author | James Dong <jdong@google.com> | 2012-01-10 08:24:37 -0800 | 
|---|---|---|
| committer | James Dong <jdong@google.com> | 2012-01-12 16:25:12 -0800 | 
| commit | 9d2f386dd2885eaffa11fd494ae258bb09fe6397 (patch) | |
| tree | 382639f8cc7f1a3677589d7dfca37b667ea4261c /drm/drmserver | |
| parent | 83bc7f3cf78b28a818417f40a4f0c00593993366 (diff) | |
| download | frameworks_av-9d2f386dd2885eaffa11fd494ae258bb09fe6397.zip frameworks_av-9d2f386dd2885eaffa11fd494ae258bb09fe6397.tar.gz frameworks_av-9d2f386dd2885eaffa11fd494ae258bb09fe6397.tar.bz2  | |
Separate sniffing from session initialization
This avoid lengthy/duplicate sniffing for drm plugins when a decrypt session is opened
o The change is backward compatibile in that no update is required
  for existing drm plug-ins if they do not plan to provide separate
  sniffer/extractor
related-to-bug: 5725548
Change-Id: I7fc4caf82d77472da4e2bc7b5d31060fb54fd84c
Diffstat (limited to 'drm/drmserver')
| -rw-r--r-- | drm/drmserver/DrmManager.cpp | 11 | ||||
| -rw-r--r-- | drm/drmserver/DrmManagerService.cpp | 8 | 
2 files changed, 11 insertions, 8 deletions
diff --git a/drm/drmserver/DrmManager.cpp b/drm/drmserver/DrmManager.cpp index 3abf3d3..999295a 100644 --- a/drm/drmserver/DrmManager.cpp +++ b/drm/drmserver/DrmManager.cpp @@ -426,7 +426,9 @@ status_t DrmManager::getAllSupportInfo(      return DRM_NO_ERROR;  } -DecryptHandle* DrmManager::openDecryptSession(int uniqueId, int fd, off64_t offset, off64_t length) { +DecryptHandle* DrmManager::openDecryptSession( +        int uniqueId, int fd, off64_t offset, off64_t length, const char* mime) { +      Mutex::Autolock _l(mDecryptLock);      status_t result = DRM_ERROR_CANNOT_HANDLE;      Vector<String8> plugInIdList = mPlugInManager.getPlugInIdList(); @@ -438,7 +440,7 @@ DecryptHandle* DrmManager::openDecryptSession(int uniqueId, int fd, off64_t offs          for (unsigned int index = 0; index < plugInIdList.size(); index++) {              String8 plugInId = plugInIdList.itemAt(index);              IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId); -            result = rDrmEngine.openDecryptSession(uniqueId, handle, fd, offset, length); +            result = rDrmEngine.openDecryptSession(uniqueId, handle, fd, offset, length, mime);              if (DRM_NO_ERROR == result) {                  ++mDecryptSessionId; @@ -453,7 +455,8 @@ DecryptHandle* DrmManager::openDecryptSession(int uniqueId, int fd, off64_t offs      return handle;  } -DecryptHandle* DrmManager::openDecryptSession(int uniqueId, const char* uri) { +DecryptHandle* DrmManager::openDecryptSession( +        int uniqueId, const char* uri, const char* mime) {      Mutex::Autolock _l(mDecryptLock);      status_t result = DRM_ERROR_CANNOT_HANDLE;      Vector<String8> plugInIdList = mPlugInManager.getPlugInIdList(); @@ -465,7 +468,7 @@ DecryptHandle* DrmManager::openDecryptSession(int uniqueId, const char* uri) {          for (unsigned int index = 0; index < plugInIdList.size(); index++) {              String8 plugInId = plugInIdList.itemAt(index);              IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId); -            result = rDrmEngine.openDecryptSession(uniqueId, handle, uri); +            result = rDrmEngine.openDecryptSession(uniqueId, handle, uri, mime);              if (DRM_NO_ERROR == result) {                  ++mDecryptSessionId; diff --git a/drm/drmserver/DrmManagerService.cpp b/drm/drmserver/DrmManagerService.cpp index df17ac5..caeb026 100644 --- a/drm/drmserver/DrmManagerService.cpp +++ b/drm/drmserver/DrmManagerService.cpp @@ -208,20 +208,20 @@ status_t DrmManagerService::getAllSupportInfo(  }  DecryptHandle* DrmManagerService::openDecryptSession( -            int uniqueId, int fd, off64_t offset, off64_t length) { +            int uniqueId, int fd, off64_t offset, off64_t length, const char* mime) {      ALOGV("Entering DrmManagerService::openDecryptSession");      if (isProtectedCallAllowed()) { -        return mDrmManager->openDecryptSession(uniqueId, fd, offset, length); +        return mDrmManager->openDecryptSession(uniqueId, fd, offset, length, mime);      }      return NULL;  }  DecryptHandle* DrmManagerService::openDecryptSession( -            int uniqueId, const char* uri) { +            int uniqueId, const char* uri, const char* mime) {      ALOGV("Entering DrmManagerService::openDecryptSession with uri");      if (isProtectedCallAllowed()) { -        return mDrmManager->openDecryptSession(uniqueId, uri); +        return mDrmManager->openDecryptSession(uniqueId, uri, mime);      }      return NULL;  | 
