Loading services/camera/libcameraservice/device3/Camera3Device.cpp +12 −3 Original line number Diff line number Diff line Loading @@ -2326,8 +2326,12 @@ status_t Camera3Device::registerInFlight(uint32_t frameNumber, if (res < 0) return res; if (mInFlightMap.size() == 1) { // hold mLock to prevent race with disconnect Mutex::Autolock l(mLock); if (mStatusTracker != nullptr) { mStatusTracker->markComponentActive(mInFlightStatusId); } } return OK; } Loading @@ -2353,9 +2357,13 @@ void Camera3Device::removeInFlightMapEntryLocked(int idx) { // Indicate idle inFlightMap to the status tracker if (mInFlightMap.size() == 0) { // hold mLock to prevent race with disconnect Mutex::Autolock l(mLock); if (mStatusTracker != nullptr) { mStatusTracker->markComponentIdle(mInFlightStatusId, Fence::NO_FENCE); } } } void Camera3Device::removeInFlightRequestIfReadyLocked(int idx) { Loading Loading @@ -3590,7 +3598,8 @@ status_t Camera3Device::RequestThread::clear( // Abort the input buffers for reprocess requests. if ((*it)->mInputStream != NULL) { camera3_stream_buffer_t inputBuffer; status_t res = (*it)->mInputStream->getInputBuffer(&inputBuffer); status_t res = (*it)->mInputStream->getInputBuffer(&inputBuffer, /*respectHalLimit*/ false); if (res != OK) { ALOGW("%s: %d: couldn't get input buffer while clearing the request " "list: %s (%d)", __FUNCTION__, __LINE__, strerror(-res), res); Loading services/camera/libcameraservice/device3/Camera3Stream.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -544,7 +544,7 @@ status_t Camera3Stream::returnBuffer(const camera3_stream_buffer &buffer, return res; } status_t Camera3Stream::getInputBuffer(camera3_stream_buffer *buffer) { status_t Camera3Stream::getInputBuffer(camera3_stream_buffer *buffer, bool respectHalLimit) { ATRACE_CALL(); Mutex::Autolock l(mLock); status_t res = OK; Loading @@ -557,7 +557,7 @@ status_t Camera3Stream::getInputBuffer(camera3_stream_buffer *buffer) { } // Wait for new buffer returned back if we are running into the limit. if (getHandoutInputBufferCountLocked() == camera3_stream::max_buffers) { if (getHandoutInputBufferCountLocked() == camera3_stream::max_buffers && respectHalLimit) { ALOGV("%s: Already dequeued max input buffers (%d), wait for next returned one.", __FUNCTION__, camera3_stream::max_buffers); res = mInputBufferReturnedSignal.waitRelative(mLock, kWaitForBufferDuration); Loading services/camera/libcameraservice/device3/Camera3Stream.h +3 −1 Original line number Diff line number Diff line Loading @@ -308,8 +308,10 @@ class Camera3Stream : * For bidirectional streams, this method applies to the input-side * buffers. * * Normally this call will block until the handed out buffer count is less than the stream * max buffer count; if respectHalLimit is set to false, this is ignored. */ status_t getInputBuffer(camera3_stream_buffer *buffer); status_t getInputBuffer(camera3_stream_buffer *buffer, bool respectHalLimit = true); /** * Return a buffer to the stream after use by the HAL. Loading services/camera/libcameraservice/device3/Camera3StreamInterface.h +3 −1 Original line number Diff line number Diff line Loading @@ -232,8 +232,10 @@ class Camera3StreamInterface : public virtual RefBase { * For bidirectional streams, this method applies to the input-side * buffers. * * Normally this call will block until the handed out buffer count is less than the stream * max buffer count; if respectHalLimit is set to false, this is ignored. */ virtual status_t getInputBuffer(camera3_stream_buffer *buffer) = 0; virtual status_t getInputBuffer(camera3_stream_buffer *buffer, bool respectHalLimit = true) = 0; /** * Return a buffer to the stream after use by the HAL. Loading Loading
services/camera/libcameraservice/device3/Camera3Device.cpp +12 −3 Original line number Diff line number Diff line Loading @@ -2326,8 +2326,12 @@ status_t Camera3Device::registerInFlight(uint32_t frameNumber, if (res < 0) return res; if (mInFlightMap.size() == 1) { // hold mLock to prevent race with disconnect Mutex::Autolock l(mLock); if (mStatusTracker != nullptr) { mStatusTracker->markComponentActive(mInFlightStatusId); } } return OK; } Loading @@ -2353,9 +2357,13 @@ void Camera3Device::removeInFlightMapEntryLocked(int idx) { // Indicate idle inFlightMap to the status tracker if (mInFlightMap.size() == 0) { // hold mLock to prevent race with disconnect Mutex::Autolock l(mLock); if (mStatusTracker != nullptr) { mStatusTracker->markComponentIdle(mInFlightStatusId, Fence::NO_FENCE); } } } void Camera3Device::removeInFlightRequestIfReadyLocked(int idx) { Loading Loading @@ -3590,7 +3598,8 @@ status_t Camera3Device::RequestThread::clear( // Abort the input buffers for reprocess requests. if ((*it)->mInputStream != NULL) { camera3_stream_buffer_t inputBuffer; status_t res = (*it)->mInputStream->getInputBuffer(&inputBuffer); status_t res = (*it)->mInputStream->getInputBuffer(&inputBuffer, /*respectHalLimit*/ false); if (res != OK) { ALOGW("%s: %d: couldn't get input buffer while clearing the request " "list: %s (%d)", __FUNCTION__, __LINE__, strerror(-res), res); Loading
services/camera/libcameraservice/device3/Camera3Stream.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -544,7 +544,7 @@ status_t Camera3Stream::returnBuffer(const camera3_stream_buffer &buffer, return res; } status_t Camera3Stream::getInputBuffer(camera3_stream_buffer *buffer) { status_t Camera3Stream::getInputBuffer(camera3_stream_buffer *buffer, bool respectHalLimit) { ATRACE_CALL(); Mutex::Autolock l(mLock); status_t res = OK; Loading @@ -557,7 +557,7 @@ status_t Camera3Stream::getInputBuffer(camera3_stream_buffer *buffer) { } // Wait for new buffer returned back if we are running into the limit. if (getHandoutInputBufferCountLocked() == camera3_stream::max_buffers) { if (getHandoutInputBufferCountLocked() == camera3_stream::max_buffers && respectHalLimit) { ALOGV("%s: Already dequeued max input buffers (%d), wait for next returned one.", __FUNCTION__, camera3_stream::max_buffers); res = mInputBufferReturnedSignal.waitRelative(mLock, kWaitForBufferDuration); Loading
services/camera/libcameraservice/device3/Camera3Stream.h +3 −1 Original line number Diff line number Diff line Loading @@ -308,8 +308,10 @@ class Camera3Stream : * For bidirectional streams, this method applies to the input-side * buffers. * * Normally this call will block until the handed out buffer count is less than the stream * max buffer count; if respectHalLimit is set to false, this is ignored. */ status_t getInputBuffer(camera3_stream_buffer *buffer); status_t getInputBuffer(camera3_stream_buffer *buffer, bool respectHalLimit = true); /** * Return a buffer to the stream after use by the HAL. Loading
services/camera/libcameraservice/device3/Camera3StreamInterface.h +3 −1 Original line number Diff line number Diff line Loading @@ -232,8 +232,10 @@ class Camera3StreamInterface : public virtual RefBase { * For bidirectional streams, this method applies to the input-side * buffers. * * Normally this call will block until the handed out buffer count is less than the stream * max buffer count; if respectHalLimit is set to false, this is ignored. */ virtual status_t getInputBuffer(camera3_stream_buffer *buffer) = 0; virtual status_t getInputBuffer(camera3_stream_buffer *buffer, bool respectHalLimit = true) = 0; /** * Return a buffer to the stream after use by the HAL. Loading