Loading services/camera/libcameraservice/device3/Camera3Device.cpp +50 −47 Original line number Original line Diff line number Diff line Loading @@ -240,6 +240,7 @@ status_t Camera3Device::disconnect() { status_t res = OK; status_t res = OK; std::vector<wp<Camera3StreamInterface>> streams; std::vector<wp<Camera3StreamInterface>> streams; nsecs_t maxExpectedDuration = getExpectedInFlightDuration(); { { Mutex::Autolock l(mLock); Mutex::Autolock l(mLock); if (mStatus == STATUS_UNINITIALIZED) return res; if (mStatus == STATUS_UNINITIALIZED) return res; Loading @@ -251,7 +252,6 @@ status_t Camera3Device::disconnect() { SET_ERR_L("Can't stop streaming"); SET_ERR_L("Can't stop streaming"); // Continue to close device even in case of error // Continue to close device even in case of error } else { } else { nsecs_t maxExpectedDuration = getExpectedInFlightDurationLocked(); res = waitUntilStateThenRelock(/*active*/ false, maxExpectedDuration); res = waitUntilStateThenRelock(/*active*/ false, maxExpectedDuration); if (res != OK) { if (res != OK) { SET_ERR_L("Timeout waiting for HAL to drain (% " PRIi64 " ns)", SET_ERR_L("Timeout waiting for HAL to drain (% " PRIi64 " ns)", Loading Loading @@ -311,7 +311,6 @@ status_t Camera3Device::disconnect() { { { Mutex::Autolock l(mLock); Mutex::Autolock l(mLock); mExpectedInflightDuration = 0; mInterface->clear(); mInterface->clear(); mOutputStreams.clear(); mOutputStreams.clear(); mInputStream.clear(); mInputStream.clear(); Loading Loading @@ -1142,6 +1141,7 @@ status_t Camera3Device::createInputStream( uint32_t width, uint32_t height, int format, int *id) { uint32_t width, uint32_t height, int format, int *id) { ATRACE_CALL(); ATRACE_CALL(); Mutex::Autolock il(mInterfaceLock); Mutex::Autolock il(mInterfaceLock); nsecs_t maxExpectedDuration = getExpectedInFlightDuration(); Mutex::Autolock l(mLock); Mutex::Autolock l(mLock); ALOGV("Camera %s: Creating new input stream %d: %d x %d, format %d", ALOGV("Camera %s: Creating new input stream %d: %d x %d, format %d", mId.string(), mNextStreamId, width, height, format); mId.string(), mNextStreamId, width, height, format); Loading @@ -1162,7 +1162,7 @@ status_t Camera3Device::createInputStream( break; break; case STATUS_ACTIVE: case STATUS_ACTIVE: ALOGV("%s: Stopping activity to reconfigure streams", __FUNCTION__); ALOGV("%s: Stopping activity to reconfigure streams", __FUNCTION__); res = internalPauseAndWaitLocked(); res = internalPauseAndWaitLocked(maxExpectedDuration); if (res != OK) { if (res != OK) { SET_ERR_L("Can't pause captures to reconfigure streams!"); SET_ERR_L("Can't pause captures to reconfigure streams!"); return res; return res; Loading Loading @@ -1229,6 +1229,7 @@ status_t Camera3Device::createStream(const std::vector<sp<Surface>>& consumers, int streamSetId, bool isShared, uint32_t consumerUsage) { int streamSetId, bool isShared, uint32_t consumerUsage) { ATRACE_CALL(); ATRACE_CALL(); Mutex::Autolock il(mInterfaceLock); Mutex::Autolock il(mInterfaceLock); nsecs_t maxExpectedDuration = getExpectedInFlightDuration(); Mutex::Autolock l(mLock); Mutex::Autolock l(mLock); ALOGV("Camera %s: Creating new stream %d: %d x %d, format %d, dataspace %d rotation %d" ALOGV("Camera %s: Creating new stream %d: %d x %d, format %d, dataspace %d rotation %d" " consumer usage 0x%x, isShared %d", mId.string(), mNextStreamId, width, height, format, " consumer usage 0x%x, isShared %d", mId.string(), mNextStreamId, width, height, format, Loading @@ -1250,7 +1251,7 @@ status_t Camera3Device::createStream(const std::vector<sp<Surface>>& consumers, break; break; case STATUS_ACTIVE: case STATUS_ACTIVE: ALOGV("%s: Stopping activity to reconfigure streams", __FUNCTION__); ALOGV("%s: Stopping activity to reconfigure streams", __FUNCTION__); res = internalPauseAndWaitLocked(); res = internalPauseAndWaitLocked(maxExpectedDuration); if (res != OK) { if (res != OK) { SET_ERR_L("Can't pause captures to reconfigure streams!"); SET_ERR_L("Can't pause captures to reconfigure streams!"); return res; return res; Loading Loading @@ -1501,8 +1502,9 @@ status_t Camera3Device::createDefaultRequest(int templateId, } } Mutex::Autolock il(mInterfaceLock); Mutex::Autolock il(mInterfaceLock); Mutex::Autolock l(mLock); { Mutex::Autolock l(mLock); switch (mStatus) { switch (mStatus) { case STATUS_ERROR: case STATUS_ERROR: CLOGE("Device has encountered a serious error"); CLOGE("Device has encountered a serious error"); Loading @@ -1524,10 +1526,14 @@ status_t Camera3Device::createDefaultRequest(int templateId, *request = mRequestTemplateCache[templateId]; *request = mRequestTemplateCache[templateId]; return OK; return OK; } } } camera_metadata_t *rawRequest; camera_metadata_t *rawRequest; status_t res = mInterface->constructDefaultRequestSettings( status_t res = mInterface->constructDefaultRequestSettings( (camera3_request_template_t) templateId, &rawRequest); (camera3_request_template_t) templateId, &rawRequest); { Mutex::Autolock l(mLock); if (res == BAD_VALUE) { if (res == BAD_VALUE) { ALOGI("%s: template %d is not supported on this camera device", ALOGI("%s: template %d is not supported on this camera device", __FUNCTION__, templateId); __FUNCTION__, templateId); Loading @@ -1542,18 +1548,20 @@ status_t Camera3Device::createDefaultRequest(int templateId, mRequestTemplateCache[templateId].acquire(rawRequest); mRequestTemplateCache[templateId].acquire(rawRequest); *request = mRequestTemplateCache[templateId]; *request = mRequestTemplateCache[templateId]; } return OK; return OK; } } status_t Camera3Device::waitUntilDrained() { status_t Camera3Device::waitUntilDrained() { ATRACE_CALL(); ATRACE_CALL(); Mutex::Autolock il(mInterfaceLock); Mutex::Autolock il(mInterfaceLock); nsecs_t maxExpectedDuration = getExpectedInFlightDuration(); Mutex::Autolock l(mLock); Mutex::Autolock l(mLock); return waitUntilDrainedLocked(); return waitUntilDrainedLocked(maxExpectedDuration); } } status_t Camera3Device::waitUntilDrainedLocked() { status_t Camera3Device::waitUntilDrainedLocked(nsecs_t maxExpectedDuration) { switch (mStatus) { switch (mStatus) { case STATUS_UNINITIALIZED: case STATUS_UNINITIALIZED: case STATUS_UNCONFIGURED: case STATUS_UNCONFIGURED: Loading @@ -1569,9 +1577,6 @@ status_t Camera3Device::waitUntilDrainedLocked() { SET_ERR_L("Unexpected status: %d",mStatus); SET_ERR_L("Unexpected status: %d",mStatus); return INVALID_OPERATION; return INVALID_OPERATION; } } nsecs_t maxExpectedDuration = getExpectedInFlightDurationLocked(); ALOGV("%s: Camera %s: Waiting until idle (%" PRIi64 "ns)", __FUNCTION__, mId.string(), ALOGV("%s: Camera %s: Waiting until idle (%" PRIi64 "ns)", __FUNCTION__, mId.string(), maxExpectedDuration); maxExpectedDuration); status_t res = waitUntilStateThenRelock(/*active*/ false, maxExpectedDuration); status_t res = waitUntilStateThenRelock(/*active*/ false, maxExpectedDuration); Loading @@ -1590,11 +1595,10 @@ void Camera3Device::internalUpdateStatusLocked(Status status) { } } // Pause to reconfigure // Pause to reconfigure status_t Camera3Device::internalPauseAndWaitLocked() { status_t Camera3Device::internalPauseAndWaitLocked(nsecs_t maxExpectedDuration) { mRequestThread->setPaused(true); mRequestThread->setPaused(true); mPauseStateNotify = true; mPauseStateNotify = true; nsecs_t maxExpectedDuration = getExpectedInFlightDurationLocked(); ALOGV("%s: Camera %s: Internal wait until idle (% " PRIi64 " ns)", __FUNCTION__, mId.string(), ALOGV("%s: Camera %s: Internal wait until idle (% " PRIi64 " ns)", __FUNCTION__, mId.string(), maxExpectedDuration); maxExpectedDuration); status_t res = waitUntilStateThenRelock(/*active*/ false, maxExpectedDuration); status_t res = waitUntilStateThenRelock(/*active*/ false, maxExpectedDuration); Loading Loading @@ -2384,9 +2388,7 @@ status_t Camera3Device::registerInFlight(uint32_t frameNumber, } } } } Mutex::Autolock ml(mLock); mExpectedInflightDuration += maxExpectedDuration; mExpectedInflightDuration += maxExpectedDuration; return OK; return OK; } } Loading Loading @@ -2418,7 +2420,6 @@ void Camera3Device::removeInFlightMapEntryLocked(int idx) { mStatusTracker->markComponentIdle(mInFlightStatusId, Fence::NO_FENCE); mStatusTracker->markComponentIdle(mInFlightStatusId, Fence::NO_FENCE); } } } } Mutex::Autolock l(mLock); mExpectedInflightDuration -= duration; mExpectedInflightDuration -= duration; } } Loading Loading @@ -2500,6 +2501,7 @@ void Camera3Device::flushInflightRequests() { request.pendingOutputBuffers.size(), 0); request.pendingOutputBuffers.size(), 0); } } mInFlightMap.clear(); mInFlightMap.clear(); mExpectedInflightDuration = 0; } } // Then return all inflight buffers not returned by HAL // Then return all inflight buffers not returned by HAL Loading Loading @@ -4294,7 +4296,8 @@ bool Camera3Device::RequestThread::isStreamPending( return false; return false; } } nsecs_t Camera3Device::getExpectedInFlightDurationLocked() { nsecs_t Camera3Device::getExpectedInFlightDuration() { Mutex::Autolock al(mInFlightLock); return mExpectedInflightDuration > kMinInflightDuration ? return mExpectedInflightDuration > kMinInflightDuration ? mExpectedInflightDuration : kMinInflightDuration; mExpectedInflightDuration : kMinInflightDuration; } } Loading services/camera/libcameraservice/device3/Camera3Device.h +8 −5 Original line number Original line Diff line number Diff line Loading @@ -486,7 +486,7 @@ class Camera3Device : * CameraDeviceBase interface we shouldn't need to. * CameraDeviceBase interface we shouldn't need to. * Must be called with mLock and mInterfaceLock both held. * Must be called with mLock and mInterfaceLock both held. */ */ status_t internalPauseAndWaitLocked(); status_t internalPauseAndWaitLocked(nsecs_t maxExpectedDuration); /** /** * Resume work after internalPauseAndWaitLocked() * Resume work after internalPauseAndWaitLocked() Loading @@ -512,7 +512,7 @@ class Camera3Device : * * * Need to be called with mLock and mInterfaceLock held. * Need to be called with mLock and mInterfaceLock held. */ */ status_t waitUntilDrainedLocked(); status_t waitUntilDrainedLocked(nsecs_t maxExpectedDuration); /** /** * Do common work for setting up a streaming or single capture request. * Do common work for setting up a streaming or single capture request. Loading Loading @@ -915,11 +915,14 @@ class Camera3Device : // Map from frame number to the in-flight request state // Map from frame number to the in-flight request state typedef KeyedVector<uint32_t, InFlightRequest> InFlightMap; typedef KeyedVector<uint32_t, InFlightRequest> InFlightMap; nsecs_t mExpectedInflightDuration = 0; Mutex mInFlightLock; // Protects mInFlightMap Mutex mInFlightLock; // Protects mInFlightMap and // mExpectedInflightDuration InFlightMap mInFlightMap; InFlightMap mInFlightMap; nsecs_t mExpectedInflightDuration = 0; int mInFlightStatusId; int mInFlightStatusId; status_t registerInFlight(uint32_t frameNumber, status_t registerInFlight(uint32_t frameNumber, int32_t numBuffers, CaptureResultExtras resultExtras, bool hasInput, int32_t numBuffers, CaptureResultExtras resultExtras, bool hasInput, bool callback, nsecs_t maxExpectedDuration); bool callback, nsecs_t maxExpectedDuration); Loading @@ -928,7 +931,7 @@ class Camera3Device : * Returns the maximum expected time it'll take for all currently in-flight * Returns the maximum expected time it'll take for all currently in-flight * requests to complete, based on their settings * requests to complete, based on their settings */ */ nsecs_t getExpectedInFlightDurationLocked(); nsecs_t getExpectedInFlightDuration(); /** /** * Tracking for idle detection * Tracking for idle detection Loading Loading
services/camera/libcameraservice/device3/Camera3Device.cpp +50 −47 Original line number Original line Diff line number Diff line Loading @@ -240,6 +240,7 @@ status_t Camera3Device::disconnect() { status_t res = OK; status_t res = OK; std::vector<wp<Camera3StreamInterface>> streams; std::vector<wp<Camera3StreamInterface>> streams; nsecs_t maxExpectedDuration = getExpectedInFlightDuration(); { { Mutex::Autolock l(mLock); Mutex::Autolock l(mLock); if (mStatus == STATUS_UNINITIALIZED) return res; if (mStatus == STATUS_UNINITIALIZED) return res; Loading @@ -251,7 +252,6 @@ status_t Camera3Device::disconnect() { SET_ERR_L("Can't stop streaming"); SET_ERR_L("Can't stop streaming"); // Continue to close device even in case of error // Continue to close device even in case of error } else { } else { nsecs_t maxExpectedDuration = getExpectedInFlightDurationLocked(); res = waitUntilStateThenRelock(/*active*/ false, maxExpectedDuration); res = waitUntilStateThenRelock(/*active*/ false, maxExpectedDuration); if (res != OK) { if (res != OK) { SET_ERR_L("Timeout waiting for HAL to drain (% " PRIi64 " ns)", SET_ERR_L("Timeout waiting for HAL to drain (% " PRIi64 " ns)", Loading Loading @@ -311,7 +311,6 @@ status_t Camera3Device::disconnect() { { { Mutex::Autolock l(mLock); Mutex::Autolock l(mLock); mExpectedInflightDuration = 0; mInterface->clear(); mInterface->clear(); mOutputStreams.clear(); mOutputStreams.clear(); mInputStream.clear(); mInputStream.clear(); Loading Loading @@ -1142,6 +1141,7 @@ status_t Camera3Device::createInputStream( uint32_t width, uint32_t height, int format, int *id) { uint32_t width, uint32_t height, int format, int *id) { ATRACE_CALL(); ATRACE_CALL(); Mutex::Autolock il(mInterfaceLock); Mutex::Autolock il(mInterfaceLock); nsecs_t maxExpectedDuration = getExpectedInFlightDuration(); Mutex::Autolock l(mLock); Mutex::Autolock l(mLock); ALOGV("Camera %s: Creating new input stream %d: %d x %d, format %d", ALOGV("Camera %s: Creating new input stream %d: %d x %d, format %d", mId.string(), mNextStreamId, width, height, format); mId.string(), mNextStreamId, width, height, format); Loading @@ -1162,7 +1162,7 @@ status_t Camera3Device::createInputStream( break; break; case STATUS_ACTIVE: case STATUS_ACTIVE: ALOGV("%s: Stopping activity to reconfigure streams", __FUNCTION__); ALOGV("%s: Stopping activity to reconfigure streams", __FUNCTION__); res = internalPauseAndWaitLocked(); res = internalPauseAndWaitLocked(maxExpectedDuration); if (res != OK) { if (res != OK) { SET_ERR_L("Can't pause captures to reconfigure streams!"); SET_ERR_L("Can't pause captures to reconfigure streams!"); return res; return res; Loading Loading @@ -1229,6 +1229,7 @@ status_t Camera3Device::createStream(const std::vector<sp<Surface>>& consumers, int streamSetId, bool isShared, uint32_t consumerUsage) { int streamSetId, bool isShared, uint32_t consumerUsage) { ATRACE_CALL(); ATRACE_CALL(); Mutex::Autolock il(mInterfaceLock); Mutex::Autolock il(mInterfaceLock); nsecs_t maxExpectedDuration = getExpectedInFlightDuration(); Mutex::Autolock l(mLock); Mutex::Autolock l(mLock); ALOGV("Camera %s: Creating new stream %d: %d x %d, format %d, dataspace %d rotation %d" ALOGV("Camera %s: Creating new stream %d: %d x %d, format %d, dataspace %d rotation %d" " consumer usage 0x%x, isShared %d", mId.string(), mNextStreamId, width, height, format, " consumer usage 0x%x, isShared %d", mId.string(), mNextStreamId, width, height, format, Loading @@ -1250,7 +1251,7 @@ status_t Camera3Device::createStream(const std::vector<sp<Surface>>& consumers, break; break; case STATUS_ACTIVE: case STATUS_ACTIVE: ALOGV("%s: Stopping activity to reconfigure streams", __FUNCTION__); ALOGV("%s: Stopping activity to reconfigure streams", __FUNCTION__); res = internalPauseAndWaitLocked(); res = internalPauseAndWaitLocked(maxExpectedDuration); if (res != OK) { if (res != OK) { SET_ERR_L("Can't pause captures to reconfigure streams!"); SET_ERR_L("Can't pause captures to reconfigure streams!"); return res; return res; Loading Loading @@ -1501,8 +1502,9 @@ status_t Camera3Device::createDefaultRequest(int templateId, } } Mutex::Autolock il(mInterfaceLock); Mutex::Autolock il(mInterfaceLock); Mutex::Autolock l(mLock); { Mutex::Autolock l(mLock); switch (mStatus) { switch (mStatus) { case STATUS_ERROR: case STATUS_ERROR: CLOGE("Device has encountered a serious error"); CLOGE("Device has encountered a serious error"); Loading @@ -1524,10 +1526,14 @@ status_t Camera3Device::createDefaultRequest(int templateId, *request = mRequestTemplateCache[templateId]; *request = mRequestTemplateCache[templateId]; return OK; return OK; } } } camera_metadata_t *rawRequest; camera_metadata_t *rawRequest; status_t res = mInterface->constructDefaultRequestSettings( status_t res = mInterface->constructDefaultRequestSettings( (camera3_request_template_t) templateId, &rawRequest); (camera3_request_template_t) templateId, &rawRequest); { Mutex::Autolock l(mLock); if (res == BAD_VALUE) { if (res == BAD_VALUE) { ALOGI("%s: template %d is not supported on this camera device", ALOGI("%s: template %d is not supported on this camera device", __FUNCTION__, templateId); __FUNCTION__, templateId); Loading @@ -1542,18 +1548,20 @@ status_t Camera3Device::createDefaultRequest(int templateId, mRequestTemplateCache[templateId].acquire(rawRequest); mRequestTemplateCache[templateId].acquire(rawRequest); *request = mRequestTemplateCache[templateId]; *request = mRequestTemplateCache[templateId]; } return OK; return OK; } } status_t Camera3Device::waitUntilDrained() { status_t Camera3Device::waitUntilDrained() { ATRACE_CALL(); ATRACE_CALL(); Mutex::Autolock il(mInterfaceLock); Mutex::Autolock il(mInterfaceLock); nsecs_t maxExpectedDuration = getExpectedInFlightDuration(); Mutex::Autolock l(mLock); Mutex::Autolock l(mLock); return waitUntilDrainedLocked(); return waitUntilDrainedLocked(maxExpectedDuration); } } status_t Camera3Device::waitUntilDrainedLocked() { status_t Camera3Device::waitUntilDrainedLocked(nsecs_t maxExpectedDuration) { switch (mStatus) { switch (mStatus) { case STATUS_UNINITIALIZED: case STATUS_UNINITIALIZED: case STATUS_UNCONFIGURED: case STATUS_UNCONFIGURED: Loading @@ -1569,9 +1577,6 @@ status_t Camera3Device::waitUntilDrainedLocked() { SET_ERR_L("Unexpected status: %d",mStatus); SET_ERR_L("Unexpected status: %d",mStatus); return INVALID_OPERATION; return INVALID_OPERATION; } } nsecs_t maxExpectedDuration = getExpectedInFlightDurationLocked(); ALOGV("%s: Camera %s: Waiting until idle (%" PRIi64 "ns)", __FUNCTION__, mId.string(), ALOGV("%s: Camera %s: Waiting until idle (%" PRIi64 "ns)", __FUNCTION__, mId.string(), maxExpectedDuration); maxExpectedDuration); status_t res = waitUntilStateThenRelock(/*active*/ false, maxExpectedDuration); status_t res = waitUntilStateThenRelock(/*active*/ false, maxExpectedDuration); Loading @@ -1590,11 +1595,10 @@ void Camera3Device::internalUpdateStatusLocked(Status status) { } } // Pause to reconfigure // Pause to reconfigure status_t Camera3Device::internalPauseAndWaitLocked() { status_t Camera3Device::internalPauseAndWaitLocked(nsecs_t maxExpectedDuration) { mRequestThread->setPaused(true); mRequestThread->setPaused(true); mPauseStateNotify = true; mPauseStateNotify = true; nsecs_t maxExpectedDuration = getExpectedInFlightDurationLocked(); ALOGV("%s: Camera %s: Internal wait until idle (% " PRIi64 " ns)", __FUNCTION__, mId.string(), ALOGV("%s: Camera %s: Internal wait until idle (% " PRIi64 " ns)", __FUNCTION__, mId.string(), maxExpectedDuration); maxExpectedDuration); status_t res = waitUntilStateThenRelock(/*active*/ false, maxExpectedDuration); status_t res = waitUntilStateThenRelock(/*active*/ false, maxExpectedDuration); Loading Loading @@ -2384,9 +2388,7 @@ status_t Camera3Device::registerInFlight(uint32_t frameNumber, } } } } Mutex::Autolock ml(mLock); mExpectedInflightDuration += maxExpectedDuration; mExpectedInflightDuration += maxExpectedDuration; return OK; return OK; } } Loading Loading @@ -2418,7 +2420,6 @@ void Camera3Device::removeInFlightMapEntryLocked(int idx) { mStatusTracker->markComponentIdle(mInFlightStatusId, Fence::NO_FENCE); mStatusTracker->markComponentIdle(mInFlightStatusId, Fence::NO_FENCE); } } } } Mutex::Autolock l(mLock); mExpectedInflightDuration -= duration; mExpectedInflightDuration -= duration; } } Loading Loading @@ -2500,6 +2501,7 @@ void Camera3Device::flushInflightRequests() { request.pendingOutputBuffers.size(), 0); request.pendingOutputBuffers.size(), 0); } } mInFlightMap.clear(); mInFlightMap.clear(); mExpectedInflightDuration = 0; } } // Then return all inflight buffers not returned by HAL // Then return all inflight buffers not returned by HAL Loading Loading @@ -4294,7 +4296,8 @@ bool Camera3Device::RequestThread::isStreamPending( return false; return false; } } nsecs_t Camera3Device::getExpectedInFlightDurationLocked() { nsecs_t Camera3Device::getExpectedInFlightDuration() { Mutex::Autolock al(mInFlightLock); return mExpectedInflightDuration > kMinInflightDuration ? return mExpectedInflightDuration > kMinInflightDuration ? mExpectedInflightDuration : kMinInflightDuration; mExpectedInflightDuration : kMinInflightDuration; } } Loading
services/camera/libcameraservice/device3/Camera3Device.h +8 −5 Original line number Original line Diff line number Diff line Loading @@ -486,7 +486,7 @@ class Camera3Device : * CameraDeviceBase interface we shouldn't need to. * CameraDeviceBase interface we shouldn't need to. * Must be called with mLock and mInterfaceLock both held. * Must be called with mLock and mInterfaceLock both held. */ */ status_t internalPauseAndWaitLocked(); status_t internalPauseAndWaitLocked(nsecs_t maxExpectedDuration); /** /** * Resume work after internalPauseAndWaitLocked() * Resume work after internalPauseAndWaitLocked() Loading @@ -512,7 +512,7 @@ class Camera3Device : * * * Need to be called with mLock and mInterfaceLock held. * Need to be called with mLock and mInterfaceLock held. */ */ status_t waitUntilDrainedLocked(); status_t waitUntilDrainedLocked(nsecs_t maxExpectedDuration); /** /** * Do common work for setting up a streaming or single capture request. * Do common work for setting up a streaming or single capture request. Loading Loading @@ -915,11 +915,14 @@ class Camera3Device : // Map from frame number to the in-flight request state // Map from frame number to the in-flight request state typedef KeyedVector<uint32_t, InFlightRequest> InFlightMap; typedef KeyedVector<uint32_t, InFlightRequest> InFlightMap; nsecs_t mExpectedInflightDuration = 0; Mutex mInFlightLock; // Protects mInFlightMap Mutex mInFlightLock; // Protects mInFlightMap and // mExpectedInflightDuration InFlightMap mInFlightMap; InFlightMap mInFlightMap; nsecs_t mExpectedInflightDuration = 0; int mInFlightStatusId; int mInFlightStatusId; status_t registerInFlight(uint32_t frameNumber, status_t registerInFlight(uint32_t frameNumber, int32_t numBuffers, CaptureResultExtras resultExtras, bool hasInput, int32_t numBuffers, CaptureResultExtras resultExtras, bool hasInput, bool callback, nsecs_t maxExpectedDuration); bool callback, nsecs_t maxExpectedDuration); Loading @@ -928,7 +931,7 @@ class Camera3Device : * Returns the maximum expected time it'll take for all currently in-flight * Returns the maximum expected time it'll take for all currently in-flight * requests to complete, based on their settings * requests to complete, based on their settings */ */ nsecs_t getExpectedInFlightDurationLocked(); nsecs_t getExpectedInFlightDuration(); /** /** * Tracking for idle detection * Tracking for idle detection Loading