Loading media/codec2/components/aac/C2SoftAacDec.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -514,8 +514,8 @@ void C2SoftAacDec::drainRingBuffer( // TODO: error handling, proper usage, etc. C2MemoryUsage usage = { C2MemoryUsage::CPU_READ, C2MemoryUsage::CPU_WRITE }; c2_status_t err = pool->fetchLinearBlock( numSamples * sizeof(int16_t), usage, &block); size_t bufferSize = numSamples * sizeof(int16_t); c2_status_t err = pool->fetchLinearBlock(bufferSize, usage, &block); if (err != C2_OK) { ALOGD("failed to fetch a linear block (%d)", err); return std::bind(fillEmptyWork, _1, C2_NO_MEMORY); Loading @@ -529,7 +529,7 @@ void C2SoftAacDec::drainRingBuffer( mSignalledError = true; return std::bind(fillEmptyWork, _1, C2_CORRUPTED); } return [buffer = createLinearBuffer(block)]( return [buffer = createLinearBuffer(block, 0, bufferSize)]( const std::unique_ptr<C2Work> &work) { work->result = C2_OK; C2FrameData &output = work->worklets.front()->output; Loading media/codec2/components/amr_nb_wb/C2SoftAmrDec.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -361,7 +361,13 @@ void C2SoftAmrDec::process( work->worklets.front()->output.flags = work->input.flags; work->worklets.front()->output.buffers.clear(); work->worklets.front()->output.buffers.push_back(createLinearBuffer(block)); // we filled the output buffer to (intptr_t)output - (intptr_t)wView.data() // use calOutSize as that contains the expected number of samples ALOGD_IF(calOutSize != ((intptr_t)output - (intptr_t)wView.data()), "Expected %zu output bytes, but filled %lld", calOutSize, (long long)((intptr_t)output - (intptr_t)wView.data())); work->worklets.front()->output.buffers.push_back( createLinearBuffer(block, 0, calOutSize)); work->worklets.front()->output.ordinal = work->input.ordinal; if (eos) { mSignalledOutputEos = true; Loading media/codec2/components/base/SimpleC2Component.cpp +0 −10 Original line number Diff line number Diff line Loading @@ -591,21 +591,11 @@ bool SimpleC2Component::processQueue() { return hasQueuedWork; } std::shared_ptr<C2Buffer> SimpleC2Component::createLinearBuffer( const std::shared_ptr<C2LinearBlock> &block) { return createLinearBuffer(block, block->offset(), block->size()); } std::shared_ptr<C2Buffer> SimpleC2Component::createLinearBuffer( const std::shared_ptr<C2LinearBlock> &block, size_t offset, size_t size) { return C2Buffer::CreateLinearBuffer(block->share(offset, size, ::C2Fence())); } std::shared_ptr<C2Buffer> SimpleC2Component::createGraphicBuffer( const std::shared_ptr<C2GraphicBlock> &block) { return createGraphicBuffer(block, C2Rect(block->width(), block->height())); } std::shared_ptr<C2Buffer> SimpleC2Component::createGraphicBuffer( const std::shared_ptr<C2GraphicBlock> &block, const C2Rect &crop) { return C2Buffer::CreateGraphicBuffer(block->share(crop, ::C2Fence())); Loading media/codec2/components/base/include/SimpleC2Component.h +0 −6 Original line number Diff line number Diff line Loading @@ -139,15 +139,9 @@ protected: std::function<void(const std::unique_ptr<C2Work> &)> fillWork); std::shared_ptr<C2Buffer> createLinearBuffer( const std::shared_ptr<C2LinearBlock> &block); std::shared_ptr<C2Buffer> createLinearBuffer( const std::shared_ptr<C2LinearBlock> &block, size_t offset, size_t size); std::shared_ptr<C2Buffer> createGraphicBuffer( const std::shared_ptr<C2GraphicBlock> &block); std::shared_ptr<C2Buffer> createGraphicBuffer( const std::shared_ptr<C2GraphicBlock> &block, const C2Rect &crop); Loading media/codec2/components/g711/C2SoftG711Dec.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -199,7 +199,7 @@ void C2SoftG711Dec::process( work->worklets.front()->output.flags = work->input.flags; work->worklets.front()->output.buffers.clear(); work->worklets.front()->output.buffers.push_back(createLinearBuffer(block)); work->worklets.front()->output.buffers.push_back(createLinearBuffer(block, 0, outSize)); work->worklets.front()->output.ordinal = work->input.ordinal; if (eos) { Loading Loading
media/codec2/components/aac/C2SoftAacDec.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -514,8 +514,8 @@ void C2SoftAacDec::drainRingBuffer( // TODO: error handling, proper usage, etc. C2MemoryUsage usage = { C2MemoryUsage::CPU_READ, C2MemoryUsage::CPU_WRITE }; c2_status_t err = pool->fetchLinearBlock( numSamples * sizeof(int16_t), usage, &block); size_t bufferSize = numSamples * sizeof(int16_t); c2_status_t err = pool->fetchLinearBlock(bufferSize, usage, &block); if (err != C2_OK) { ALOGD("failed to fetch a linear block (%d)", err); return std::bind(fillEmptyWork, _1, C2_NO_MEMORY); Loading @@ -529,7 +529,7 @@ void C2SoftAacDec::drainRingBuffer( mSignalledError = true; return std::bind(fillEmptyWork, _1, C2_CORRUPTED); } return [buffer = createLinearBuffer(block)]( return [buffer = createLinearBuffer(block, 0, bufferSize)]( const std::unique_ptr<C2Work> &work) { work->result = C2_OK; C2FrameData &output = work->worklets.front()->output; Loading
media/codec2/components/amr_nb_wb/C2SoftAmrDec.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -361,7 +361,13 @@ void C2SoftAmrDec::process( work->worklets.front()->output.flags = work->input.flags; work->worklets.front()->output.buffers.clear(); work->worklets.front()->output.buffers.push_back(createLinearBuffer(block)); // we filled the output buffer to (intptr_t)output - (intptr_t)wView.data() // use calOutSize as that contains the expected number of samples ALOGD_IF(calOutSize != ((intptr_t)output - (intptr_t)wView.data()), "Expected %zu output bytes, but filled %lld", calOutSize, (long long)((intptr_t)output - (intptr_t)wView.data())); work->worklets.front()->output.buffers.push_back( createLinearBuffer(block, 0, calOutSize)); work->worklets.front()->output.ordinal = work->input.ordinal; if (eos) { mSignalledOutputEos = true; Loading
media/codec2/components/base/SimpleC2Component.cpp +0 −10 Original line number Diff line number Diff line Loading @@ -591,21 +591,11 @@ bool SimpleC2Component::processQueue() { return hasQueuedWork; } std::shared_ptr<C2Buffer> SimpleC2Component::createLinearBuffer( const std::shared_ptr<C2LinearBlock> &block) { return createLinearBuffer(block, block->offset(), block->size()); } std::shared_ptr<C2Buffer> SimpleC2Component::createLinearBuffer( const std::shared_ptr<C2LinearBlock> &block, size_t offset, size_t size) { return C2Buffer::CreateLinearBuffer(block->share(offset, size, ::C2Fence())); } std::shared_ptr<C2Buffer> SimpleC2Component::createGraphicBuffer( const std::shared_ptr<C2GraphicBlock> &block) { return createGraphicBuffer(block, C2Rect(block->width(), block->height())); } std::shared_ptr<C2Buffer> SimpleC2Component::createGraphicBuffer( const std::shared_ptr<C2GraphicBlock> &block, const C2Rect &crop) { return C2Buffer::CreateGraphicBuffer(block->share(crop, ::C2Fence())); Loading
media/codec2/components/base/include/SimpleC2Component.h +0 −6 Original line number Diff line number Diff line Loading @@ -139,15 +139,9 @@ protected: std::function<void(const std::unique_ptr<C2Work> &)> fillWork); std::shared_ptr<C2Buffer> createLinearBuffer( const std::shared_ptr<C2LinearBlock> &block); std::shared_ptr<C2Buffer> createLinearBuffer( const std::shared_ptr<C2LinearBlock> &block, size_t offset, size_t size); std::shared_ptr<C2Buffer> createGraphicBuffer( const std::shared_ptr<C2GraphicBlock> &block); std::shared_ptr<C2Buffer> createGraphicBuffer( const std::shared_ptr<C2GraphicBlock> &block, const C2Rect &crop); Loading
media/codec2/components/g711/C2SoftG711Dec.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -199,7 +199,7 @@ void C2SoftG711Dec::process( work->worklets.front()->output.flags = work->input.flags; work->worklets.front()->output.buffers.clear(); work->worklets.front()->output.buffers.push_back(createLinearBuffer(block)); work->worklets.front()->output.buffers.push_back(createLinearBuffer(block, 0, outSize)); work->worklets.front()->output.ordinal = work->input.ordinal; if (eos) { Loading