summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-04-06 11:06:28 -0700
committerAndreas Huber <andih@google.com>2012-04-06 12:16:27 -0700
commit4b75a9c8b93a90749bc5d22912ad0d96c12f4ecf (patch)
treeae217f5c50a37349dce944c5d8a065a8740c88a9 /cmds
parent3f502bfc6d04d08369cf147284c5c4c2ac7c9a0e (diff)
downloadframeworks_av-4b75a9c8b93a90749bc5d22912ad0d96c12f4ecf.zip
frameworks_av-4b75a9c8b93a90749bc5d22912ad0d96c12f4ecf.tar.gz
frameworks_av-4b75a9c8b93a90749bc5d22912ad0d96c12f4ecf.tar.bz2
New API to support submitting encrypted buffers to the decoder.
Change-Id: I69dd60e43078c4211c6123cf6e0ce90e676bf873 related-to-bug: 6275919
Diffstat (limited to 'cmds')
-rw-r--r--cmds/stagefright/codec.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/cmds/stagefright/codec.cpp b/cmds/stagefright/codec.cpp
index 5cbfbfe..ece3c09 100644
--- a/cmds/stagefright/codec.cpp
+++ b/cmds/stagefright/codec.cpp
@@ -296,15 +296,28 @@ static int decode(
if (sampleFlags & NuMediaExtractor::SAMPLE_FLAG_ENCRYPTED) {
CHECK(decryptInputBuffers);
- bufferFlags |= MediaCodec::BUFFER_FLAG_ENCRYPTED;
- }
+ CryptoPlugin::SubSample ss;
+ ss.mNumBytesOfClearData = 0;
+ ss.mNumBytesOfEncryptedData = buffer->size();
- err = state->mCodec->queueInputBuffer(
- index,
- 0 /* offset */,
- buffer->size(),
- timeUs,
- bufferFlags);
+ err = state->mCodec->queueSecureInputBuffer(
+ index,
+ 0 /* offset */,
+ &ss,
+ 1 /* numSubSamples */,
+ NULL /* key */,
+ NULL /* iv */,
+ CryptoPlugin::kMode_AES_WV,
+ timeUs,
+ bufferFlags);
+ } else {
+ err = state->mCodec->queueInputBuffer(
+ index,
+ 0 /* offset */,
+ buffer->size(),
+ timeUs,
+ bufferFlags);
+ }
CHECK_EQ(err, (status_t)OK);