summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorJeff Tinker <jtinker@google.com>2015-04-06 18:21:05 -0700
committerJeff Tinker <jtinker@google.com>2015-04-08 18:33:59 -0700
commitc481b5012a5f6cf72e5e93b36f1ed4c9169916f2 (patch)
treebbb7920204199b43cd24075d48b8fa387a43059f /include/media
parente41b5f31148f9cfb7316295c900c7d3c695510b2 (diff)
downloadframeworks_av-c481b5012a5f6cf72e5e93b36f1ed4c9169916f2.zip
frameworks_av-c481b5012a5f6cf72e5e93b36f1ed4c9169916f2.tar.gz
frameworks_av-c481b5012a5f6cf72e5e93b36f1ed4c9169916f2.tar.bz2
Pass crypto source data using a shared buffer
MediaCodec was using a binder transaction buffer to pass encryption source data for protected content. On some 4K content, the max binder transaction buffer size was being exceeded. This change uses a shared buffer for the encryption source data instead of a binder transaction buffer, which avoids the problem and may be more efficient. bug: 20027687 Change-Id: I36a24ebf600d7e1064b78e48b167fdc29b2c65e9
Diffstat (limited to 'include/media')
-rw-r--r--include/media/ICrypto.h3
-rw-r--r--include/media/stagefright/MediaCodec.h6
2 files changed, 7 insertions, 2 deletions
diff --git a/include/media/ICrypto.h b/include/media/ICrypto.h
index 07742ca..ac2b3ba 100644
--- a/include/media/ICrypto.h
+++ b/include/media/ICrypto.h
@@ -25,6 +25,7 @@
namespace android {
struct AString;
+struct IMemory;
struct ICrypto : public IInterface {
DECLARE_META_INTERFACE(Crypto);
@@ -48,7 +49,7 @@ struct ICrypto : public IInterface {
const uint8_t key[16],
const uint8_t iv[16],
CryptoPlugin::Mode mode,
- const void *srcPtr,
+ const sp<IMemory> &sharedBuffer, size_t offset,
const CryptoPlugin::SubSample *subSamples, size_t numSubSamples,
void *dstPtr,
AString *errorDetailMsg) = 0;
diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h
index d055341..3bc6391 100644
--- a/include/media/stagefright/MediaCodec.h
+++ b/include/media/stagefright/MediaCodec.h
@@ -30,8 +30,10 @@ struct AMessage;
struct AReplyToken;
struct AString;
struct CodecBase;
-struct ICrypto;
struct IBatteryStats;
+struct ICrypto;
+struct IMemory;
+struct MemoryDealer;
struct SoftwareRenderer;
struct Surface;
@@ -214,6 +216,7 @@ private:
uint32_t mBufferID;
sp<ABuffer> mData;
sp<ABuffer> mEncryptedData;
+ sp<IMemory> mSharedEncryptedBuffer;
sp<AMessage> mNotify;
sp<AMessage> mFormat;
bool mOwnedByClient;
@@ -232,6 +235,7 @@ private:
sp<AMessage> mOutputFormat;
sp<AMessage> mInputFormat;
sp<AMessage> mCallback;
+ sp<MemoryDealer> mDealer;
bool mBatteryStatNotified;
bool mIsVideo;