Loading services/camera/libcameraservice/device3/Camera3StreamSplitter.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -474,17 +474,18 @@ status_t Camera3StreamSplitter::attachBufferToOutputs(ANativeWindowBuffer* anb, mMutex.unlock(); res = surface->attachBuffer(anb); mMutex.lock(); //During buffer attach 'mMutex' is not held which makes the removal of //"surface" possible. Check whether this is the case and continue. if (surface.get() == nullptr) { res = OK; continue; } if (res != OK) { SP_LOGE("%s: Cannot attachBuffer from GraphicBufferProducer %p: %s (%d)", __FUNCTION__, surface.get(), strerror(-res), res); // TODO: might need to detach/cleanup the already attached buffers before return? return res; } //During buffer attach 'mMutex' is not held which makes the removal of //"gbp" possible. Check whether this is the case and continue. if (mHeldBuffers[surface] == nullptr) { continue; } mHeldBuffers[surface]->insert(gb); SP_LOGV("%s: Attached buffer %p on output %p.", __FUNCTION__, gb.get(), surface.get()); } Loading services/camera/libcameraservice/device3/deprecated/DeprecatedCamera3StreamSplitter.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -474,6 +474,12 @@ status_t DeprecatedCamera3StreamSplitter::attachBufferToOutputs( mMutex.unlock(); res = gbp->attachBuffer(&slot, gb); mMutex.lock(); // During buffer attach 'mMutex' is not held which makes the removal of //"gbp" possible. Check whether this is the case and continue. if (gbp.get() == nullptr) { res = OK; continue; } if (res != OK) { SP_LOGE("%s: Cannot attachBuffer from GraphicBufferProducer %p: %s (%d)", __FUNCTION__, gbp.get(), strerror(-res), res); Loading @@ -485,11 +491,6 @@ status_t DeprecatedCamera3StreamSplitter::attachBufferToOutputs( __FUNCTION__, slot, BufferQueue::NUM_BUFFER_SLOTS); return BAD_VALUE; } // During buffer attach 'mMutex' is not held which makes the removal of //"gbp" possible. Check whether this is the case and continue. if (mOutputSlots[gbp] == nullptr) { continue; } auto& outputSlots = *mOutputSlots[gbp]; if (static_cast<size_t>(slot + 1) > outputSlots.size()) { outputSlots.resize(slot + 1); Loading Loading
services/camera/libcameraservice/device3/Camera3StreamSplitter.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -474,17 +474,18 @@ status_t Camera3StreamSplitter::attachBufferToOutputs(ANativeWindowBuffer* anb, mMutex.unlock(); res = surface->attachBuffer(anb); mMutex.lock(); //During buffer attach 'mMutex' is not held which makes the removal of //"surface" possible. Check whether this is the case and continue. if (surface.get() == nullptr) { res = OK; continue; } if (res != OK) { SP_LOGE("%s: Cannot attachBuffer from GraphicBufferProducer %p: %s (%d)", __FUNCTION__, surface.get(), strerror(-res), res); // TODO: might need to detach/cleanup the already attached buffers before return? return res; } //During buffer attach 'mMutex' is not held which makes the removal of //"gbp" possible. Check whether this is the case and continue. if (mHeldBuffers[surface] == nullptr) { continue; } mHeldBuffers[surface]->insert(gb); SP_LOGV("%s: Attached buffer %p on output %p.", __FUNCTION__, gb.get(), surface.get()); } Loading
services/camera/libcameraservice/device3/deprecated/DeprecatedCamera3StreamSplitter.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -474,6 +474,12 @@ status_t DeprecatedCamera3StreamSplitter::attachBufferToOutputs( mMutex.unlock(); res = gbp->attachBuffer(&slot, gb); mMutex.lock(); // During buffer attach 'mMutex' is not held which makes the removal of //"gbp" possible. Check whether this is the case and continue. if (gbp.get() == nullptr) { res = OK; continue; } if (res != OK) { SP_LOGE("%s: Cannot attachBuffer from GraphicBufferProducer %p: %s (%d)", __FUNCTION__, gbp.get(), strerror(-res), res); Loading @@ -485,11 +491,6 @@ status_t DeprecatedCamera3StreamSplitter::attachBufferToOutputs( __FUNCTION__, slot, BufferQueue::NUM_BUFFER_SLOTS); return BAD_VALUE; } // During buffer attach 'mMutex' is not held which makes the removal of //"gbp" possible. Check whether this is the case and continue. if (mOutputSlots[gbp] == nullptr) { continue; } auto& outputSlots = *mOutputSlots[gbp]; if (static_cast<size_t>(slot + 1) > outputSlots.size()) { outputSlots.resize(slot + 1); Loading