summaryrefslogtreecommitdiffstats
path: root/media/libmedia/ICrypto.cpp
diff options
context:
space:
mode:
authorShivaprasad Hongal <shongal@codeaurora.org>2015-07-30 18:00:18 -0700
committerSatish Kamuju <skamuj@codeaurora.org>2015-10-06 17:37:32 +0530
commit1ee2a02ee471d8c5d7b3c3bd3ab720f3dcfea056 (patch)
tree9e6156dc3c8c52168fd56aa0f06b211c5fd36155 /media/libmedia/ICrypto.cpp
parentbc3028750d3438ebf108298e93f12de461f56430 (diff)
downloadframeworks_av-1ee2a02ee471d8c5d7b3c3bd3ab720f3dcfea056.zip
frameworks_av-1ee2a02ee471d8c5d7b3c3bd3ab720f3dcfea056.tar.gz
frameworks_av-1ee2a02ee471d8c5d7b3c3bd3ab720f3dcfea056.tar.bz2
Stagefright: Enable custom allocation mode.
Enable custom allocation mode Change-Id: Idf3f6c0eb9d17d361d2e5b6c36b1fe7586236565
Diffstat (limited to 'media/libmedia/ICrypto.cpp')
-rw-r--r--media/libmedia/ICrypto.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/media/libmedia/ICrypto.cpp b/media/libmedia/ICrypto.cpp
index 9f65bde..f80357f 100644
--- a/media/libmedia/ICrypto.cpp
+++ b/media/libmedia/ICrypto.cpp
@@ -24,6 +24,7 @@
#include <media/stagefright/MediaErrors.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/AString.h>
+#include <media/AVMediaExtensions.h>
namespace android {
@@ -136,6 +137,7 @@ struct BpCrypto : public BpInterface<ICrypto> {
if (secure) {
data.writeInt64(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(dstPtr)));
+ AVMediaUtils::get()->writeCustomData(&data, dstPtr);
}
remote()->transact(DECRYPT, data, &reply);
@@ -297,6 +299,7 @@ status_t BnCrypto::onTransact(
void *secureBufferId, *dstPtr;
if (secure) {
secureBufferId = reinterpret_cast<void *>(static_cast<uintptr_t>(data.readInt64()));
+ AVMediaUtils::get()->readCustomData(&data, &secureBufferId);
} else {
dstPtr = malloc(totalSize);
CHECK(dstPtr != NULL);
@@ -332,6 +335,8 @@ status_t BnCrypto::onTransact(
}
free(dstPtr);
dstPtr = NULL;
+ } else {
+ AVMediaUtils::get()->closeFileDescriptor(dstPtr);
}
delete[] subSamples;