diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 74e22855..99c828ae 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1565,6 +1565,7 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector< params.awbMode = mPhotoInfo.awbMode; params.wait3ALocked = mPhotoInfo.wait3ALocked; params.customHdr = mPhotoInfo.customHdr; + params.hdrStep = mPhotoInfo.hdrStep; params.burstRawCapture = mPhotoInfo.usingRawFormat; params.burstCaptures = mPhotoInfo.burstCaptures; if (params.requestTemplate <= 0 || params.requestTemplate > 5) diff --git a/app/src/main/cpp/camera2/ndkcamera.cpp b/app/src/main/cpp/camera2/ndkcamera.cpp index 72375558..66183675 100644 --- a/app/src/main/cpp/camera2/ndkcamera.cpp +++ b/app/src/main/cpp/camera2/ndkcamera.cpp @@ -1880,10 +1880,10 @@ void NdkCamera::onCaptureCompleted(ACameraCaptureSession* session, ACaptureReque if (m_params.customHdr) { - int32_t compensation = m_params.compensation; - if (compensation == 0) + int32_t hdrStep = m_params.hdrStep; + if (hdrStep == 0) { - compensation = 1; + hdrStep = 1; } val = { 0 }; @@ -1897,13 +1897,12 @@ void NdkCamera::onCaptureCompleted(ACameraCaptureSession* session, ACaptureReque uint8_t aeModeOff = ACAMERA_CONTROL_AE_MODE_OFF; XYLOG(XYLOG_SEVERITY_INFO, "HDR: Base Exp=%lld ISO=%d", exTime / 1000, sensitivity); - if (exTime != -1 && sensitivity > 0) { for (int idx = 0; idx < burstCaptures; idx++) { ACaptureRequest_setEntry_u8(requests[idx], ACAMERA_CONTROL_AE_MODE, 1, &aeModeOff); - int64_t expt = exTime * ((idx == 0) ? 1 : (compensation + idx)); + int64_t expt = (idx == 0) ? exTime : (exTime * (hdrStep + idx)); ACaptureRequest_setEntry_i64(requests[idx], ACAMERA_SENSOR_EXPOSURE_TIME, 1, &expt); ACaptureRequest_setEntry_i32(requests[idx], ACAMERA_SENSOR_SENSITIVITY, 1, &sensitivity); sensitivity = sensitivityRange.min_; diff --git a/app/src/main/cpp/camera2/ndkcamera.h b/app/src/main/cpp/camera2/ndkcamera.h index 9c2489cb..da2caa3a 100644 --- a/app/src/main/cpp/camera2/ndkcamera.h +++ b/app/src/main/cpp/camera2/ndkcamera.h @@ -83,7 +83,8 @@ public: unsigned int wait3ALocked : 3; unsigned int burstRawCapture : 2; unsigned int customHdr : 1; - unsigned int reserved : 15; + unsigned int hdrStep : 3; + unsigned int reserved : 12; int64_t exposureTime; unsigned int sensitivity; int compensation;