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 | d1ba6ed94543b6d2af666e01f4ffd29412511400 (patch) | |
tree | 10d0b29f0a9b7b08cccae0a907595cc8f96f3d4a /drm/common/DrmEngineBase.cpp | |
parent | 1f7b23dda211f419f0a140b871de44339c4a10c7 (diff) |
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/common/DrmEngineBase.cpp')
-rw-r--r-- | drm/common/DrmEngineBase.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drm/common/DrmEngineBase.cpp b/drm/common/DrmEngineBase.cpp index 9b16c3685442..1c345a2a2d61 100644 --- a/drm/common/DrmEngineBase.cpp +++ b/drm/common/DrmEngineBase.cpp @@ -120,13 +120,23 @@ DrmSupportInfo* DrmEngineBase::getSupportInfo(int uniqueId) { } status_t DrmEngineBase::openDecryptSession( - int uniqueId, DecryptHandle* decryptHandle, int fd, off64_t offset, off64_t length) { - return onOpenDecryptSession(uniqueId, decryptHandle, fd, offset, length); + int uniqueId, DecryptHandle* decryptHandle, + int fd, off64_t offset, off64_t length, const char* mime) { + + if (!mime || mime[0] == '\0') { + return onOpenDecryptSession(uniqueId, decryptHandle, fd, offset, length); + } + + return onOpenDecryptSession(uniqueId, decryptHandle, fd, offset, length, mime); } status_t DrmEngineBase::openDecryptSession( - int uniqueId, DecryptHandle* decryptHandle, const char* uri) { - return onOpenDecryptSession(uniqueId, decryptHandle, uri); + int uniqueId, DecryptHandle* decryptHandle, + const char* uri, const char* mime) { + if (!mime || mime[0] == '\0') { + return onOpenDecryptSession(uniqueId, decryptHandle, uri); + } + return onOpenDecryptSession(uniqueId, decryptHandle, uri, mime); } status_t DrmEngineBase::closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle) { |