summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2012-01-10 08:24:37 -0800
committerJames Dong <jdong@google.com>2012-01-12 16:25:12 -0800
commit9d2f386dd2885eaffa11fd494ae258bb09fe6397 (patch)
tree382639f8cc7f1a3677589d7dfca37b667ea4261c /include
parent83bc7f3cf78b28a818417f40a4f0c00593993366 (diff)
downloadframeworks_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 'include')
-rw-r--r--include/drm/DrmManagerClient.h6
-rw-r--r--include/media/stagefright/DataSource.h2
-rw-r--r--include/media/stagefright/FileSource.h2
-rw-r--r--include/media/stagefright/MediaExtractor.h4
4 files changed, 8 insertions, 6 deletions
diff --git a/include/drm/DrmManagerClient.h b/include/drm/DrmManagerClient.h
index b8fe46d..c47bbfb 100644
--- a/include/drm/DrmManagerClient.h
+++ b/include/drm/DrmManagerClient.h
@@ -66,19 +66,21 @@ 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 Mime type of the protected content if it is not NULL or empty
* @return
* Handle for the decryption session
*/
- sp<DecryptHandle> openDecryptSession(int fd, off64_t offset, off64_t length);
+ sp<DecryptHandle> openDecryptSession(int fd, off64_t offset, off64_t length, const char* mime);
/**
* Open the decrypt session to decrypt the given protected content
*
* @param[in] uri Path of the protected content to be decrypted
+ * @param[in] mime Mime type of the protected content if it is not NULL or empty
* @return
* Handle for the decryption session
*/
- sp<DecryptHandle> openDecryptSession(const char* uri);
+ sp<DecryptHandle> openDecryptSession(const char* uri, const char* mime);
/**
* Close the decrypt session for the given handle
diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h
index 713af92..00d583e 100644
--- a/include/media/stagefright/DataSource.h
+++ b/include/media/stagefright/DataSource.h
@@ -81,7 +81,7 @@ public:
static void RegisterDefaultSniffers();
// for DRM
- virtual sp<DecryptHandle> DrmInitialization() {
+ virtual sp<DecryptHandle> DrmInitialization(const char *mime = NULL) {
return NULL;
}
virtual void getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client) {};
diff --git a/include/media/stagefright/FileSource.h b/include/media/stagefright/FileSource.h
index 6cf86dc..d994cb3 100644
--- a/include/media/stagefright/FileSource.h
+++ b/include/media/stagefright/FileSource.h
@@ -38,7 +38,7 @@ public:
virtual status_t getSize(off64_t *size);
- virtual sp<DecryptHandle> DrmInitialization();
+ virtual sp<DecryptHandle> DrmInitialization(const char *mime);
virtual void getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client);
diff --git a/include/media/stagefright/MediaExtractor.h b/include/media/stagefright/MediaExtractor.h
index eb45237..94090ee 100644
--- a/include/media/stagefright/MediaExtractor.h
+++ b/include/media/stagefright/MediaExtractor.h
@@ -56,10 +56,10 @@ public:
virtual uint32_t flags() const;
// for DRM
- virtual void setDrmFlag(bool flag) {
+ void setDrmFlag(bool flag) {
mIsDrm = flag;
};
- virtual bool getDrmFlag() {
+ bool getDrmFlag() {
return mIsDrm;
}
virtual char* getDrmTrackInfo(size_t trackID, int *len) {