Loading media/codec2/sfplugin/CCodecBufferChannel.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -649,7 +649,7 @@ status_t CCodecBufferChannel::attachEncryptedBuffers( return -ENOSYS; return -ENOSYS; } } // we are dealing with just one cryptoInfo or descrambler. // we are dealing with just one cryptoInfo or descrambler. std::unique_ptr<CodecCryptoInfo> info = std::move(cryptoInfos->value[0]); std::unique_ptr<CodecCryptoInfo> &info = cryptoInfos->value[0]; if (info == nullptr) { if (info == nullptr) { ALOGE("Cannot decrypt, CryptoInfos are null."); ALOGE("Cannot decrypt, CryptoInfos are null."); return -ENOSYS; return -ENOSYS; Loading Loading @@ -698,7 +698,7 @@ status_t CCodecBufferChannel::attachEncryptedBuffers( mDecryptDestination, mHeapSeqNum, &dst.nonsecureMemory); mDecryptDestination, mHeapSeqNum, &dst.nonsecureMemory); for (int i = 0; i < bufferInfos->value.size(); i++) { for (int i = 0; i < bufferInfos->value.size(); i++) { if (bufferInfos->value[i].mSize > 0) { if (bufferInfos->value[i].mSize > 0) { std::unique_ptr<CodecCryptoInfo> info = std::move(cryptoInfos->value[cryptoInfoIdx++]); std::unique_ptr<CodecCryptoInfo> &info = cryptoInfos->value[cryptoInfoIdx++]; src.offset = srcOffset; src.offset = srcOffset; src.size = bufferInfos->value[i].mSize; src.size = bufferInfos->value[i].mSize; result = mCrypto->decrypt( result = mCrypto->decrypt( Loading media/libstagefright/CryptoAsync.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -132,6 +132,9 @@ status_t CryptoAsync::decryptAndQueue(sp<AMessage> & msg) { } } if (err != OK) { if (err != OK) { std::list<sp<AMessage>> errorList; std::list<sp<AMessage>> errorList; if (buffer->meta()->findObject("cryptoInfos", &obj)) { msg->setObject("cryptoInfos", obj); } msg->removeEntryByName("buffer"); msg->removeEntryByName("buffer"); msg->setInt32("err", err); msg->setInt32("err", err); msg->setInt32("actionCode", ACTION_CODE_FATAL); msg->setInt32("actionCode", ACTION_CODE_FATAL); Loading media/libstagefright/MediaCodec.cpp +5 −1 Original line number Original line Diff line number Diff line Loading @@ -6631,7 +6631,11 @@ status_t MediaCodec::onQueueInputBuffer(const sp<AMessage> &msg) { && (mFlags & kFlagUseCryptoAsync)) { && (mFlags & kFlagUseCryptoAsync)) { // create error detail // create error detail sp<AMessage> cryptoErrorInfo = new AMessage(); sp<AMessage> cryptoErrorInfo = new AMessage(); if (msg->findObject("cryptoInfos", &obj)) { cryptoErrorInfo->setObject("cryptoInfos", obj); } else { buildCryptoInfoAMessage(cryptoErrorInfo, CryptoAsync::kActionDecrypt); buildCryptoInfoAMessage(cryptoErrorInfo, CryptoAsync::kActionDecrypt); } cryptoErrorInfo->setInt32("err", err); cryptoErrorInfo->setInt32("err", err); cryptoErrorInfo->setInt32("actionCode", ACTION_CODE_FATAL); cryptoErrorInfo->setInt32("actionCode", ACTION_CODE_FATAL); cryptoErrorInfo->setString("errorDetail", errorDetailMsg); cryptoErrorInfo->setString("errorDetail", errorDetailMsg); Loading Loading
media/codec2/sfplugin/CCodecBufferChannel.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -649,7 +649,7 @@ status_t CCodecBufferChannel::attachEncryptedBuffers( return -ENOSYS; return -ENOSYS; } } // we are dealing with just one cryptoInfo or descrambler. // we are dealing with just one cryptoInfo or descrambler. std::unique_ptr<CodecCryptoInfo> info = std::move(cryptoInfos->value[0]); std::unique_ptr<CodecCryptoInfo> &info = cryptoInfos->value[0]; if (info == nullptr) { if (info == nullptr) { ALOGE("Cannot decrypt, CryptoInfos are null."); ALOGE("Cannot decrypt, CryptoInfos are null."); return -ENOSYS; return -ENOSYS; Loading Loading @@ -698,7 +698,7 @@ status_t CCodecBufferChannel::attachEncryptedBuffers( mDecryptDestination, mHeapSeqNum, &dst.nonsecureMemory); mDecryptDestination, mHeapSeqNum, &dst.nonsecureMemory); for (int i = 0; i < bufferInfos->value.size(); i++) { for (int i = 0; i < bufferInfos->value.size(); i++) { if (bufferInfos->value[i].mSize > 0) { if (bufferInfos->value[i].mSize > 0) { std::unique_ptr<CodecCryptoInfo> info = std::move(cryptoInfos->value[cryptoInfoIdx++]); std::unique_ptr<CodecCryptoInfo> &info = cryptoInfos->value[cryptoInfoIdx++]; src.offset = srcOffset; src.offset = srcOffset; src.size = bufferInfos->value[i].mSize; src.size = bufferInfos->value[i].mSize; result = mCrypto->decrypt( result = mCrypto->decrypt( Loading
media/libstagefright/CryptoAsync.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -132,6 +132,9 @@ status_t CryptoAsync::decryptAndQueue(sp<AMessage> & msg) { } } if (err != OK) { if (err != OK) { std::list<sp<AMessage>> errorList; std::list<sp<AMessage>> errorList; if (buffer->meta()->findObject("cryptoInfos", &obj)) { msg->setObject("cryptoInfos", obj); } msg->removeEntryByName("buffer"); msg->removeEntryByName("buffer"); msg->setInt32("err", err); msg->setInt32("err", err); msg->setInt32("actionCode", ACTION_CODE_FATAL); msg->setInt32("actionCode", ACTION_CODE_FATAL); Loading
media/libstagefright/MediaCodec.cpp +5 −1 Original line number Original line Diff line number Diff line Loading @@ -6631,7 +6631,11 @@ status_t MediaCodec::onQueueInputBuffer(const sp<AMessage> &msg) { && (mFlags & kFlagUseCryptoAsync)) { && (mFlags & kFlagUseCryptoAsync)) { // create error detail // create error detail sp<AMessage> cryptoErrorInfo = new AMessage(); sp<AMessage> cryptoErrorInfo = new AMessage(); if (msg->findObject("cryptoInfos", &obj)) { cryptoErrorInfo->setObject("cryptoInfos", obj); } else { buildCryptoInfoAMessage(cryptoErrorInfo, CryptoAsync::kActionDecrypt); buildCryptoInfoAMessage(cryptoErrorInfo, CryptoAsync::kActionDecrypt); } cryptoErrorInfo->setInt32("err", err); cryptoErrorInfo->setInt32("err", err); cryptoErrorInfo->setInt32("actionCode", ACTION_CODE_FATAL); cryptoErrorInfo->setInt32("actionCode", ACTION_CODE_FATAL); cryptoErrorInfo->setString("errorDetail", errorDetailMsg); cryptoErrorInfo->setString("errorDetail", errorDetailMsg); Loading