Loading services/camera/libcameraservice/device3/Camera3StreamSplitter.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,13 @@ void Camera3StreamSplitter::onFrameAvailable(const BufferItem& /* item */) { "queueing buffer to output failed (%d)", status); } // If the queued buffer replaces a pending buffer in the async // queue, no onBufferReleased is called by the buffer queue. // Proactively trigger the callback to avoid buffer loss. if (queueOutput.bufferReplaced) { onBufferReleasedByOutputLocked(mOutputs[id]); } ALOGV("queued buffer %#" PRIx64 " to output %p", bufferItem.mGraphicBuffer->getId(), mOutputs[id].get()); } Loading @@ -335,6 +342,12 @@ void Camera3StreamSplitter::onBufferReleasedByOutput( ATRACE_CALL(); Mutex::Autolock lock(mMutex); onBufferReleasedByOutputLocked(from); } void Camera3StreamSplitter::onBufferReleasedByOutputLocked( const sp<IGraphicBufferProducer>& from) { sp<GraphicBuffer> buffer; sp<Fence> fence; status_t status = from->detachNextBuffer(&buffer, &fence); Loading services/camera/libcameraservice/device3/Camera3StreamSplitter.h +5 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,11 @@ private: // onFrameAvailable call to proceed. void onBufferReleasedByOutput(const sp<IGraphicBufferProducer>& from); // This is the implementation of onBufferReleasedByOutput without the mutex locked. // It could either be called from onBufferReleasedByOutput or from // onFrameAvailable when a buffer in the async buffer queue is overwritten. void onBufferReleasedByOutputLocked(const sp<IGraphicBufferProducer>& from); // When this is called, the splitter disconnects from (i.e., abandons) its // input queue and signals any waiting onFrameAvailable calls to wake up. // It still processes callbacks from other outputs, but only detaches their Loading Loading
services/camera/libcameraservice/device3/Camera3StreamSplitter.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,13 @@ void Camera3StreamSplitter::onFrameAvailable(const BufferItem& /* item */) { "queueing buffer to output failed (%d)", status); } // If the queued buffer replaces a pending buffer in the async // queue, no onBufferReleased is called by the buffer queue. // Proactively trigger the callback to avoid buffer loss. if (queueOutput.bufferReplaced) { onBufferReleasedByOutputLocked(mOutputs[id]); } ALOGV("queued buffer %#" PRIx64 " to output %p", bufferItem.mGraphicBuffer->getId(), mOutputs[id].get()); } Loading @@ -335,6 +342,12 @@ void Camera3StreamSplitter::onBufferReleasedByOutput( ATRACE_CALL(); Mutex::Autolock lock(mMutex); onBufferReleasedByOutputLocked(from); } void Camera3StreamSplitter::onBufferReleasedByOutputLocked( const sp<IGraphicBufferProducer>& from) { sp<GraphicBuffer> buffer; sp<Fence> fence; status_t status = from->detachNextBuffer(&buffer, &fence); Loading
services/camera/libcameraservice/device3/Camera3StreamSplitter.h +5 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,11 @@ private: // onFrameAvailable call to proceed. void onBufferReleasedByOutput(const sp<IGraphicBufferProducer>& from); // This is the implementation of onBufferReleasedByOutput without the mutex locked. // It could either be called from onBufferReleasedByOutput or from // onFrameAvailable when a buffer in the async buffer queue is overwritten. void onBufferReleasedByOutputLocked(const sp<IGraphicBufferProducer>& from); // When this is called, the splitter disconnects from (i.e., abandons) its // input queue and signals any waiting onFrameAvailable calls to wake up. // It still processes callbacks from other outputs, but only detaches their Loading