Loading media/codec2/sfplugin/CCodecBufferChannel.cpp +14 −6 Original line number Diff line number Diff line Loading @@ -1348,7 +1348,7 @@ status_t CCodecBufferChannel::start( // about buffers from the previous generation do not interfere with the // newly initialized pipeline capacity. { if (inputFormat || outputFormat) { Mutexed<PipelineWatcher>::Locked watcher(mPipelineWatcher); watcher->inputDelay(inputDelayValue) .pipelineDelay(pipelineDelayValue) Loading Loading @@ -1448,14 +1448,14 @@ status_t CCodecBufferChannel::requestInitialInputBuffers() { void CCodecBufferChannel::stop() { mSync.stop(); mFirstValidFrameIndex = mFrameIndex.load(std::memory_order_relaxed); if (mInputSurface != nullptr) { mInputSurface.reset(); } mPipelineWatcher.lock()->flush(); } void CCodecBufferChannel::reset() { stop(); if (mInputSurface != nullptr) { mInputSurface.reset(); } mPipelineWatcher.lock()->flush(); { Mutexed<Input>::Locked input(mInput); input->buffers.reset(new DummyInputBuffers("")); Loading Loading @@ -1483,8 +1483,10 @@ void CCodecBufferChannel::release() { void CCodecBufferChannel::flush(const std::list<std::unique_ptr<C2Work>> &flushedWork) { ALOGV("[%s] flush", mName); std::vector<uint64_t> indices; std::list<std::unique_ptr<C2Work>> configs; for (const std::unique_ptr<C2Work> &work : flushedWork) { indices.push_back(work->input.ordinal.frameIndex.peeku()); if (!(work->input.flags & C2FrameData::FLAG_CODEC_CONFIG)) { continue; } Loading @@ -1497,6 +1499,7 @@ void CCodecBufferChannel::flush(const std::list<std::unique_ptr<C2Work>> &flushe std::unique_ptr<C2Work> copy(new C2Work); copy->input.flags = C2FrameData::flags_t(work->input.flags | C2FrameData::FLAG_DROP_FRAME); copy->input.ordinal = work->input.ordinal; copy->input.ordinal.frameIndex = mFrameIndex++; copy->input.buffers.insert( copy->input.buffers.begin(), work->input.buffers.begin(), Loading Loading @@ -1525,7 +1528,12 @@ void CCodecBufferChannel::flush(const std::list<std::unique_ptr<C2Work>> &flushe output->buffers->flushStash(); } } mPipelineWatcher.lock()->flush(); { Mutexed<PipelineWatcher>::Locked watcher(mPipelineWatcher); for (uint64_t index : indices) { watcher->onWorkDone(index); } } } void CCodecBufferChannel::onWorkDone( Loading media/codec2/sfplugin/PipelineWatcher.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,7 @@ void PipelineWatcher::onWorkDone(uint64_t frameIndex) { } void PipelineWatcher::flush() { ALOGV("flush"); mFramesInPipeline.clear(); } Loading Loading
media/codec2/sfplugin/CCodecBufferChannel.cpp +14 −6 Original line number Diff line number Diff line Loading @@ -1348,7 +1348,7 @@ status_t CCodecBufferChannel::start( // about buffers from the previous generation do not interfere with the // newly initialized pipeline capacity. { if (inputFormat || outputFormat) { Mutexed<PipelineWatcher>::Locked watcher(mPipelineWatcher); watcher->inputDelay(inputDelayValue) .pipelineDelay(pipelineDelayValue) Loading Loading @@ -1448,14 +1448,14 @@ status_t CCodecBufferChannel::requestInitialInputBuffers() { void CCodecBufferChannel::stop() { mSync.stop(); mFirstValidFrameIndex = mFrameIndex.load(std::memory_order_relaxed); if (mInputSurface != nullptr) { mInputSurface.reset(); } mPipelineWatcher.lock()->flush(); } void CCodecBufferChannel::reset() { stop(); if (mInputSurface != nullptr) { mInputSurface.reset(); } mPipelineWatcher.lock()->flush(); { Mutexed<Input>::Locked input(mInput); input->buffers.reset(new DummyInputBuffers("")); Loading Loading @@ -1483,8 +1483,10 @@ void CCodecBufferChannel::release() { void CCodecBufferChannel::flush(const std::list<std::unique_ptr<C2Work>> &flushedWork) { ALOGV("[%s] flush", mName); std::vector<uint64_t> indices; std::list<std::unique_ptr<C2Work>> configs; for (const std::unique_ptr<C2Work> &work : flushedWork) { indices.push_back(work->input.ordinal.frameIndex.peeku()); if (!(work->input.flags & C2FrameData::FLAG_CODEC_CONFIG)) { continue; } Loading @@ -1497,6 +1499,7 @@ void CCodecBufferChannel::flush(const std::list<std::unique_ptr<C2Work>> &flushe std::unique_ptr<C2Work> copy(new C2Work); copy->input.flags = C2FrameData::flags_t(work->input.flags | C2FrameData::FLAG_DROP_FRAME); copy->input.ordinal = work->input.ordinal; copy->input.ordinal.frameIndex = mFrameIndex++; copy->input.buffers.insert( copy->input.buffers.begin(), work->input.buffers.begin(), Loading Loading @@ -1525,7 +1528,12 @@ void CCodecBufferChannel::flush(const std::list<std::unique_ptr<C2Work>> &flushe output->buffers->flushStash(); } } mPipelineWatcher.lock()->flush(); { Mutexed<PipelineWatcher>::Locked watcher(mPipelineWatcher); for (uint64_t index : indices) { watcher->onWorkDone(index); } } } void CCodecBufferChannel::onWorkDone( Loading
media/codec2/sfplugin/PipelineWatcher.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,7 @@ void PipelineWatcher::onWorkDone(uint64_t frameIndex) { } void PipelineWatcher::flush() { ALOGV("flush"); mFramesInPipeline.clear(); } Loading