Loading media/libstagefright/ACodec.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -1039,7 +1039,10 @@ status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) { array[i] = {mBuffers[portIndex][i].mData, mBuffers[portIndex][i].mBufferID}; } if (portIndex == kPortIndexInput) { mBufferChannel->setInputBufferArray(array); err = mBufferChannel->setInputBufferArray(array); if (err != OK) { return err; } } else if (portIndex == kPortIndexOutput) { mBufferChannel->setOutputBufferArray(array); } else { Loading media/libstagefright/ACodecBufferChannel.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -284,7 +284,7 @@ sp<MemoryDealer> ACodecBufferChannel::makeMemoryDealer(size_t heapSize) { return dealer; } void ACodecBufferChannel::setInputBufferArray(const std::vector<BufferAndId> &array) { status_t ACodecBufferChannel::setInputBufferArray(const std::vector<BufferAndId> &array) { if (hasCryptoOrDescrambler()) { size_t totalSize = std::accumulate( array.begin(), array.end(), 0u, Loading @@ -311,11 +311,15 @@ void ACodecBufferChannel::setInputBufferArray(const std::vector<BufferAndId> &ar if (hasCryptoOrDescrambler()) { sharedEncryptedBuffer = mDealer->allocate(elem.mBuffer->capacity()); } if (elem.mBuffer->data() == NULL && sharedEncryptedBuffer == NULL) { return BAD_VALUE; } inputBuffers.emplace_back(elem.mBuffer, elem.mBufferId, sharedEncryptedBuffer); } std::atomic_store( &mInputBuffers, std::make_shared<const std::vector<const BufferInfo>>(inputBuffers)); return OK; } void ACodecBufferChannel::setOutputBufferArray(const std::vector<BufferAndId> &array) { Loading media/libstagefright/MediaCodec.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -734,6 +734,9 @@ status_t MediaCodec::configure( // XXX: save indication that it's crypto in some way... mAnalyticsItem->setInt32(kCodecCrypto, 1); } } else if (mFlags & kFlagIsSecure) { ALOGE("Crypto or descrambler should be given for secure codec"); return BAD_VALUE; } // save msg for reset Loading media/libstagefright/include/ACodecBufferChannel.h +2 −1 Original line number Diff line number Diff line Loading @@ -87,8 +87,9 @@ public: * * @param array Newly allocated buffers. Empty if buffers are * deallocated. * @return OK if no error. */ void setInputBufferArray(const std::vector<BufferAndId> &array); status_t setInputBufferArray(const std::vector<BufferAndId> &array); /** * Set output buffer array. * Loading Loading
media/libstagefright/ACodec.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -1039,7 +1039,10 @@ status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) { array[i] = {mBuffers[portIndex][i].mData, mBuffers[portIndex][i].mBufferID}; } if (portIndex == kPortIndexInput) { mBufferChannel->setInputBufferArray(array); err = mBufferChannel->setInputBufferArray(array); if (err != OK) { return err; } } else if (portIndex == kPortIndexOutput) { mBufferChannel->setOutputBufferArray(array); } else { Loading
media/libstagefright/ACodecBufferChannel.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -284,7 +284,7 @@ sp<MemoryDealer> ACodecBufferChannel::makeMemoryDealer(size_t heapSize) { return dealer; } void ACodecBufferChannel::setInputBufferArray(const std::vector<BufferAndId> &array) { status_t ACodecBufferChannel::setInputBufferArray(const std::vector<BufferAndId> &array) { if (hasCryptoOrDescrambler()) { size_t totalSize = std::accumulate( array.begin(), array.end(), 0u, Loading @@ -311,11 +311,15 @@ void ACodecBufferChannel::setInputBufferArray(const std::vector<BufferAndId> &ar if (hasCryptoOrDescrambler()) { sharedEncryptedBuffer = mDealer->allocate(elem.mBuffer->capacity()); } if (elem.mBuffer->data() == NULL && sharedEncryptedBuffer == NULL) { return BAD_VALUE; } inputBuffers.emplace_back(elem.mBuffer, elem.mBufferId, sharedEncryptedBuffer); } std::atomic_store( &mInputBuffers, std::make_shared<const std::vector<const BufferInfo>>(inputBuffers)); return OK; } void ACodecBufferChannel::setOutputBufferArray(const std::vector<BufferAndId> &array) { Loading
media/libstagefright/MediaCodec.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -734,6 +734,9 @@ status_t MediaCodec::configure( // XXX: save indication that it's crypto in some way... mAnalyticsItem->setInt32(kCodecCrypto, 1); } } else if (mFlags & kFlagIsSecure) { ALOGE("Crypto or descrambler should be given for secure codec"); return BAD_VALUE; } // save msg for reset Loading
media/libstagefright/include/ACodecBufferChannel.h +2 −1 Original line number Diff line number Diff line Loading @@ -87,8 +87,9 @@ public: * * @param array Newly allocated buffers. Empty if buffers are * deallocated. * @return OK if no error. */ void setInputBufferArray(const std::vector<BufferAndId> &array); status_t setInputBufferArray(const std::vector<BufferAndId> &array); /** * Set output buffer array. * Loading