From d1ba6ed94543b6d2af666e01f4ffd29412511400 Mon Sep 17 00:00:00 2001 From: James Dong Date: Tue, 10 Jan 2012 08:24:37 -0800 Subject: 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 --- drm/libdrmframework/include/DrmManager.h | 5 +++-- drm/libdrmframework/include/DrmManagerClientImpl.h | 8 ++++++-- drm/libdrmframework/include/DrmManagerService.h | 6 ++++-- drm/libdrmframework/include/IDrmManagerService.h | 14 ++++++++++---- 4 files changed, 23 insertions(+), 10 deletions(-) (limited to 'drm/libdrmframework/include') diff --git a/drm/libdrmframework/include/DrmManager.h b/drm/libdrmframework/include/DrmManager.h index ac2b946..c9167d4 100644 --- a/drm/libdrmframework/include/DrmManager.h +++ b/drm/libdrmframework/include/DrmManager.h @@ -111,9 +111,10 @@ public: status_t getAllSupportInfo(int uniqueId, int* length, DrmSupportInfo** drmSupportInfoArray); - DecryptHandle* openDecryptSession(int uniqueId, int fd, off64_t offset, off64_t length); + DecryptHandle* openDecryptSession( + int uniqueId, int fd, off64_t offset, off64_t length, const char* mime); - DecryptHandle* openDecryptSession(int uniqueId, const char* uri); + DecryptHandle* openDecryptSession(int uniqueId, const char* uri, const char* mime); status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle); diff --git a/drm/libdrmframework/include/DrmManagerClientImpl.h b/drm/libdrmframework/include/DrmManagerClientImpl.h index e3338d9..2aa493f 100644 --- a/drm/libdrmframework/include/DrmManagerClientImpl.h +++ b/drm/libdrmframework/include/DrmManagerClientImpl.h @@ -300,20 +300,24 @@ public: * @param[in] fd File descriptor of the protected content to be decrypted * @param[in] offset Start position of the content * @param[in] length The length of the protected content + * @param[in] mime The mime type of the protected content if it is not NULL or empty * @return * Handle for the decryption session */ - sp openDecryptSession(int uniqueId, int fd, off64_t offset, off64_t length); + sp openDecryptSession( + int uniqueId, int fd, off64_t offset, off64_t length, const char* mime); /** * Open the decrypt session to decrypt the given protected content * * @param[in] uniqueId Unique identifier for a session * @param[in] uri Path of the protected content to be decrypted + * @param[in] mime The mime type of the protected content if it is not NULL or empty * @return * Handle for the decryption session */ - sp openDecryptSession(int uniqueId, const char* uri); + sp openDecryptSession( + int uniqueId, const char* uri, const char* mime); /** * Close the decrypt session for the given handle diff --git a/drm/libdrmframework/include/DrmManagerService.h b/drm/libdrmframework/include/DrmManagerService.h index 9cb5804..1a8c2ae 100644 --- a/drm/libdrmframework/include/DrmManagerService.h +++ b/drm/libdrmframework/include/DrmManagerService.h @@ -98,9 +98,11 @@ public: status_t getAllSupportInfo(int uniqueId, int* length, DrmSupportInfo** drmSupportInfoArray); - DecryptHandle* openDecryptSession(int uniqueId, int fd, off64_t offset, off64_t length); + DecryptHandle* openDecryptSession( + int uniqueId, int fd, off64_t offset, off64_t length, const char *mime); - DecryptHandle* openDecryptSession(int uniqueId, const char* uri); + DecryptHandle* openDecryptSession( + int uniqueId, const char* uri, const char* mime); status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle); diff --git a/drm/libdrmframework/include/IDrmManagerService.h b/drm/libdrmframework/include/IDrmManagerService.h index b9618bb..a7d21c5 100644 --- a/drm/libdrmframework/include/IDrmManagerService.h +++ b/drm/libdrmframework/include/IDrmManagerService.h @@ -139,9 +139,12 @@ public: virtual status_t getAllSupportInfo( int uniqueId, int* length, DrmSupportInfo** drmSupportInfoArray) = 0; - virtual DecryptHandle* openDecryptSession(int uniqueId, int fd, off64_t offset, off64_t length) = 0; + virtual DecryptHandle* openDecryptSession( + int uniqueId, int fd, off64_t offset, + off64_t length, const char* mime) = 0; - virtual DecryptHandle* openDecryptSession(int uniqueId, const char* uri) = 0; + virtual DecryptHandle* openDecryptSession( + int uniqueId, const char* uri, const char* mime) = 0; virtual status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle) = 0; @@ -222,9 +225,12 @@ public: virtual status_t getAllSupportInfo( int uniqueId, int* length, DrmSupportInfo** drmSupportInfoArray); - virtual DecryptHandle* openDecryptSession(int uniqueId, int fd, off64_t offset, off64_t length); + virtual DecryptHandle* openDecryptSession( + int uniqueId, int fd, off64_t offset, off64_t length, + const char* mime); - virtual DecryptHandle* openDecryptSession(int uniqueId, const char* uri); + virtual DecryptHandle* openDecryptSession( + int uniqueId, const char* uri, const char* mime); virtual status_t closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle); -- cgit v1.1