Loading services/camera/libcameraservice/device3/Camera3Device.cpp +10 −7 Original line number Diff line number Diff line Loading @@ -4891,6 +4891,15 @@ status_t Camera3Device::RequestThread::prepareHalRequests() { captureRequest->mOutputStreams.size()); halRequest->output_buffers = outputBuffers->array(); std::set<String8> requestedPhysicalCameras; sp<Camera3Device> parent = mParent.promote(); if (parent == NULL) { // Should not happen, and nowhere to send errors to, so just log it CLOGE("RequestThread: Parent is gone"); return INVALID_OPERATION; } nsecs_t waitDuration = kBaseGetBufferWait + parent->getExpectedInFlightDuration(); for (size_t j = 0; j < captureRequest->mOutputStreams.size(); j++) { sp<Camera3OutputStreamInterface> outputStream = captureRequest->mOutputStreams.editItemAt(j); Loading @@ -4911,6 +4920,7 @@ status_t Camera3Device::RequestThread::prepareHalRequests() { } res = outputStream->getBuffer(&outputBuffers->editItemAt(j), waitDuration, captureRequest->mOutputSurfaces[j]); if (res != OK) { // Can't get output buffer from gralloc queue - this could be due to Loading @@ -4937,13 +4947,6 @@ status_t Camera3Device::RequestThread::prepareHalRequests() { totalNumBuffers += halRequest->num_output_buffers; // Log request in the in-flight queue sp<Camera3Device> parent = mParent.promote(); if (parent == NULL) { // Should not happen, and nowhere to send errors to, so just log it CLOGE("RequestThread: Parent is gone"); return INVALID_OPERATION; } // If this request list is for constrained high speed recording (not // preview), and the current request is not the last one in the batch, // do not send callback to the app. Loading services/camera/libcameraservice/device3/Camera3Device.h +1 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,7 @@ class Camera3Device : static const size_t kInFlightWarnLimitHighSpeed = 256; // batch size 32 * pipe depth 8 static const nsecs_t kDefaultExpectedDuration = 100000000; // 100 ms static const nsecs_t kMinInflightDuration = 5000000000; // 5 s static const nsecs_t kBaseGetBufferWait = 3000000000; // 3 sec. // SCHED_FIFO priority for request submission thread in HFR mode static const int kRequestThreadPriority = 1; Loading services/camera/libcameraservice/device3/Camera3Stream.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -577,6 +577,7 @@ status_t Camera3Stream::tearDown() { } status_t Camera3Stream::getBuffer(camera3_stream_buffer *buffer, nsecs_t waitBufferTimeout, const std::vector<size_t>& surface_ids) { ATRACE_CALL(); Mutex::Autolock l(mLock); Loading @@ -594,13 +595,16 @@ status_t Camera3Stream::getBuffer(camera3_stream_buffer *buffer, ALOGV("%s: Already dequeued max output buffers (%d), wait for next returned one.", __FUNCTION__, camera3_stream::max_buffers); nsecs_t waitStart = systemTime(SYSTEM_TIME_MONOTONIC); res = mOutputBufferReturnedSignal.waitRelative(mLock, kWaitForBufferDuration); if (waitBufferTimeout < kWaitForBufferDuration) { waitBufferTimeout = kWaitForBufferDuration; } res = mOutputBufferReturnedSignal.waitRelative(mLock, waitBufferTimeout); nsecs_t waitEnd = systemTime(SYSTEM_TIME_MONOTONIC); mBufferLimitLatency.add(waitStart, waitEnd); if (res != OK) { if (res == TIMED_OUT) { ALOGE("%s: wait for output buffer return timed out after %lldms (max_buffers %d)", __FUNCTION__, kWaitForBufferDuration / 1000000LL, __FUNCTION__, waitBufferTimeout / 1000000LL, camera3_stream::max_buffers); } return res; Loading services/camera/libcameraservice/device3/Camera3Stream.h +1 −0 Original line number Diff line number Diff line Loading @@ -311,6 +311,7 @@ class Camera3Stream : * */ status_t getBuffer(camera3_stream_buffer *buffer, nsecs_t waitBufferTimeout, const std::vector<size_t>& surface_ids = std::vector<size_t>()); /** Loading services/camera/libcameraservice/device3/Camera3StreamInterface.h +1 −0 Original line number Diff line number Diff line Loading @@ -237,6 +237,7 @@ class Camera3StreamInterface : public virtual RefBase { * */ virtual status_t getBuffer(camera3_stream_buffer *buffer, nsecs_t waitBufferTimeout, const std::vector<size_t>& surface_ids = std::vector<size_t>()) = 0; /** Loading Loading
services/camera/libcameraservice/device3/Camera3Device.cpp +10 −7 Original line number Diff line number Diff line Loading @@ -4891,6 +4891,15 @@ status_t Camera3Device::RequestThread::prepareHalRequests() { captureRequest->mOutputStreams.size()); halRequest->output_buffers = outputBuffers->array(); std::set<String8> requestedPhysicalCameras; sp<Camera3Device> parent = mParent.promote(); if (parent == NULL) { // Should not happen, and nowhere to send errors to, so just log it CLOGE("RequestThread: Parent is gone"); return INVALID_OPERATION; } nsecs_t waitDuration = kBaseGetBufferWait + parent->getExpectedInFlightDuration(); for (size_t j = 0; j < captureRequest->mOutputStreams.size(); j++) { sp<Camera3OutputStreamInterface> outputStream = captureRequest->mOutputStreams.editItemAt(j); Loading @@ -4911,6 +4920,7 @@ status_t Camera3Device::RequestThread::prepareHalRequests() { } res = outputStream->getBuffer(&outputBuffers->editItemAt(j), waitDuration, captureRequest->mOutputSurfaces[j]); if (res != OK) { // Can't get output buffer from gralloc queue - this could be due to Loading @@ -4937,13 +4947,6 @@ status_t Camera3Device::RequestThread::prepareHalRequests() { totalNumBuffers += halRequest->num_output_buffers; // Log request in the in-flight queue sp<Camera3Device> parent = mParent.promote(); if (parent == NULL) { // Should not happen, and nowhere to send errors to, so just log it CLOGE("RequestThread: Parent is gone"); return INVALID_OPERATION; } // If this request list is for constrained high speed recording (not // preview), and the current request is not the last one in the batch, // do not send callback to the app. Loading
services/camera/libcameraservice/device3/Camera3Device.h +1 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,7 @@ class Camera3Device : static const size_t kInFlightWarnLimitHighSpeed = 256; // batch size 32 * pipe depth 8 static const nsecs_t kDefaultExpectedDuration = 100000000; // 100 ms static const nsecs_t kMinInflightDuration = 5000000000; // 5 s static const nsecs_t kBaseGetBufferWait = 3000000000; // 3 sec. // SCHED_FIFO priority for request submission thread in HFR mode static const int kRequestThreadPriority = 1; Loading
services/camera/libcameraservice/device3/Camera3Stream.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -577,6 +577,7 @@ status_t Camera3Stream::tearDown() { } status_t Camera3Stream::getBuffer(camera3_stream_buffer *buffer, nsecs_t waitBufferTimeout, const std::vector<size_t>& surface_ids) { ATRACE_CALL(); Mutex::Autolock l(mLock); Loading @@ -594,13 +595,16 @@ status_t Camera3Stream::getBuffer(camera3_stream_buffer *buffer, ALOGV("%s: Already dequeued max output buffers (%d), wait for next returned one.", __FUNCTION__, camera3_stream::max_buffers); nsecs_t waitStart = systemTime(SYSTEM_TIME_MONOTONIC); res = mOutputBufferReturnedSignal.waitRelative(mLock, kWaitForBufferDuration); if (waitBufferTimeout < kWaitForBufferDuration) { waitBufferTimeout = kWaitForBufferDuration; } res = mOutputBufferReturnedSignal.waitRelative(mLock, waitBufferTimeout); nsecs_t waitEnd = systemTime(SYSTEM_TIME_MONOTONIC); mBufferLimitLatency.add(waitStart, waitEnd); if (res != OK) { if (res == TIMED_OUT) { ALOGE("%s: wait for output buffer return timed out after %lldms (max_buffers %d)", __FUNCTION__, kWaitForBufferDuration / 1000000LL, __FUNCTION__, waitBufferTimeout / 1000000LL, camera3_stream::max_buffers); } return res; Loading
services/camera/libcameraservice/device3/Camera3Stream.h +1 −0 Original line number Diff line number Diff line Loading @@ -311,6 +311,7 @@ class Camera3Stream : * */ status_t getBuffer(camera3_stream_buffer *buffer, nsecs_t waitBufferTimeout, const std::vector<size_t>& surface_ids = std::vector<size_t>()); /** Loading
services/camera/libcameraservice/device3/Camera3StreamInterface.h +1 −0 Original line number Diff line number Diff line Loading @@ -237,6 +237,7 @@ class Camera3StreamInterface : public virtual RefBase { * */ virtual status_t getBuffer(camera3_stream_buffer *buffer, nsecs_t waitBufferTimeout, const std::vector<size_t>& surface_ids = std::vector<size_t>()) = 0; /** Loading