Loading services/camera/libcameraservice/api1/Camera2Client.cpp +19 −2 Original line number Diff line number Diff line Loading @@ -1446,6 +1446,7 @@ status_t Camera2Client::takePicture(int /*msgType*/) { if ( (res = checkPid(__FUNCTION__) ) != OK) return res; int takePictureCounter; bool shouldSyncWithDevice = true; { SharedParameters::Lock l(mParameters); switch (l.mParameters.state) { Loading Loading @@ -1531,12 +1532,23 @@ status_t Camera2Client::takePicture(int /*msgType*/) { __FUNCTION__, mCameraId); mZslProcessor->clearZslQueue(); } // We should always sync with the device in case flash is turned on, // the camera device suggests that flash is needed (AE state FLASH_REQUIRED) // or we are in some other AE state different from CONVERGED that may need // precapture trigger. if (l.mParameters.flashMode != Parameters::FLASH_MODE_ON && (l.mParameters.aeState == ANDROID_CONTROL_AE_STATE_CONVERGED)) { shouldSyncWithDevice = false; } } ATRACE_ASYNC_BEGIN(kTakepictureLabel, takePictureCounter); // Need HAL to have correct settings before (possibly) triggering precapture // Make sure HAL has correct settings in case precapture trigger is needed. if (shouldSyncWithDevice) { syncWithDevice(); } res = mCaptureSequencer->startCapture(); if (res != OK) { Loading Loading @@ -1905,6 +1917,11 @@ void Camera2Client::notifyAutoFocus(uint8_t newState, int triggerId) { void Camera2Client::notifyAutoExposure(uint8_t newState, int triggerId) { ALOGV("%s: Autoexposure state now %d, last trigger %d", __FUNCTION__, newState, triggerId); { SharedParameters::Lock l(mParameters); // Update state l.mParameters.aeState = newState; } mCaptureSequencer->notifyAutoExposure(newState, triggerId); } Loading services/camera/libcameraservice/api1/client2/Parameters.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -757,6 +757,7 @@ status_t Parameters::initialize(CameraDeviceBase *device, int deviceVersion) { focusState = ANDROID_CONTROL_AF_STATE_INACTIVE; shadowFocusMode = FOCUS_MODE_INVALID; aeState = ANDROID_CONTROL_AE_STATE_INACTIVE; camera_metadata_ro_entry_t max3aRegions = staticInfo(ANDROID_CONTROL_MAX_REGIONS, Parameters::NUM_REGION, Parameters::NUM_REGION); if (max3aRegions.count != Parameters::NUM_REGION) return NO_INIT; Loading services/camera/libcameraservice/api1/client2/Parameters.h +1 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ struct Parameters { int32_t high; }; uint8_t aeState; //latest AE state from Hal int32_t exposureCompensation; bool autoExposureLock; bool autoExposureLockAvailable; Loading Loading
services/camera/libcameraservice/api1/Camera2Client.cpp +19 −2 Original line number Diff line number Diff line Loading @@ -1446,6 +1446,7 @@ status_t Camera2Client::takePicture(int /*msgType*/) { if ( (res = checkPid(__FUNCTION__) ) != OK) return res; int takePictureCounter; bool shouldSyncWithDevice = true; { SharedParameters::Lock l(mParameters); switch (l.mParameters.state) { Loading Loading @@ -1531,12 +1532,23 @@ status_t Camera2Client::takePicture(int /*msgType*/) { __FUNCTION__, mCameraId); mZslProcessor->clearZslQueue(); } // We should always sync with the device in case flash is turned on, // the camera device suggests that flash is needed (AE state FLASH_REQUIRED) // or we are in some other AE state different from CONVERGED that may need // precapture trigger. if (l.mParameters.flashMode != Parameters::FLASH_MODE_ON && (l.mParameters.aeState == ANDROID_CONTROL_AE_STATE_CONVERGED)) { shouldSyncWithDevice = false; } } ATRACE_ASYNC_BEGIN(kTakepictureLabel, takePictureCounter); // Need HAL to have correct settings before (possibly) triggering precapture // Make sure HAL has correct settings in case precapture trigger is needed. if (shouldSyncWithDevice) { syncWithDevice(); } res = mCaptureSequencer->startCapture(); if (res != OK) { Loading Loading @@ -1905,6 +1917,11 @@ void Camera2Client::notifyAutoFocus(uint8_t newState, int triggerId) { void Camera2Client::notifyAutoExposure(uint8_t newState, int triggerId) { ALOGV("%s: Autoexposure state now %d, last trigger %d", __FUNCTION__, newState, triggerId); { SharedParameters::Lock l(mParameters); // Update state l.mParameters.aeState = newState; } mCaptureSequencer->notifyAutoExposure(newState, triggerId); } Loading
services/camera/libcameraservice/api1/client2/Parameters.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -757,6 +757,7 @@ status_t Parameters::initialize(CameraDeviceBase *device, int deviceVersion) { focusState = ANDROID_CONTROL_AF_STATE_INACTIVE; shadowFocusMode = FOCUS_MODE_INVALID; aeState = ANDROID_CONTROL_AE_STATE_INACTIVE; camera_metadata_ro_entry_t max3aRegions = staticInfo(ANDROID_CONTROL_MAX_REGIONS, Parameters::NUM_REGION, Parameters::NUM_REGION); if (max3aRegions.count != Parameters::NUM_REGION) return NO_INIT; Loading
services/camera/libcameraservice/api1/client2/Parameters.h +1 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ struct Parameters { int32_t high; }; uint8_t aeState; //latest AE state from Hal int32_t exposureCompensation; bool autoExposureLock; bool autoExposureLockAvailable; Loading