From 4b75a9c8b93a90749bc5d22912ad0d96c12f4ecf Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Fri, 6 Apr 2012 11:06:28 -0700 Subject: New API to support submitting encrypted buffers to the decoder. Change-Id: I69dd60e43078c4211c6123cf6e0ce90e676bf873 related-to-bug: 6275919 --- cmds/stagefright/codec.cpp | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'cmds') 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); -- cgit v1.1