|
|
|
@ -124,6 +124,8 @@ NdkCamera::NdkCamera(int32_t width, int32_t height, const NdkCamera::CAMERA_PARA
|
|
|
|
|
|
|
|
|
|
sceneModeSupported = false;
|
|
|
|
|
|
|
|
|
|
numberOfPrecaptures = 0;
|
|
|
|
|
|
|
|
|
|
activeArraySize[0] = 0;
|
|
|
|
|
activeArraySize[1] = 0;
|
|
|
|
|
|
|
|
|
@ -625,7 +627,7 @@ int NdkCamera::open(const std::string& cameraId) {
|
|
|
|
|
// status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AF_TRIGGER, 1, &trig);
|
|
|
|
|
|
|
|
|
|
trig = ACAMERA_CONTROL_AF_TRIGGER_START;
|
|
|
|
|
// status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AF_TRIGGER, 1, &trig);
|
|
|
|
|
status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AF_TRIGGER, 1, &trig);
|
|
|
|
|
}
|
|
|
|
|
if (status == ACAMERA_OK)
|
|
|
|
|
{
|
|
|
|
@ -641,13 +643,13 @@ int NdkCamera::open(const std::string& cameraId) {
|
|
|
|
|
|
|
|
|
|
// std::this_thread::sleep_for(std::chrono::milliseconds(128));
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
if (m_params.sceneMode != 0)
|
|
|
|
|
{
|
|
|
|
|
uint8_t sceneMode = m_params.sceneMode;
|
|
|
|
|
status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_SCENE_MODE, 1, &sceneMode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
if (m_params.autoExposure)
|
|
|
|
|
{
|
|
|
|
|
uint8_t aeMode = ACAMERA_CONTROL_AE_MODE_ON;
|
|
|
|
@ -686,13 +688,6 @@ int NdkCamera::open(const std::string& cameraId) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint8_t aePrecatureTrigger = ACAMERA_CONTROL_AE_PRECAPTURE_TRIGGER_START;
|
|
|
|
|
status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AE_PRECAPTURE_TRIGGER, 1, &aePrecatureTrigger);
|
|
|
|
|
if (status == ACAMERA_OK)
|
|
|
|
|
{
|
|
|
|
|
m_imagesCaptured = ~0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (aeLockAvailable)
|
|
|
|
|
{
|
|
|
|
|
uint8_t aeLock = ACAMERA_CONTROL_AE_LOCK_ON;
|
|
|
|
@ -705,6 +700,16 @@ int NdkCamera::open(const std::string& cameraId) {
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_DEBUG, "AE_Lock Not Supported");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint8_t aePrecatureTrigger = ACAMERA_CONTROL_AE_PRECAPTURE_TRIGGER_START;
|
|
|
|
|
status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AE_PRECAPTURE_TRIGGER, 1, &aePrecatureTrigger);
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_DEBUG, "Trigger PRECAPTURE status=%d", (int)status);
|
|
|
|
|
if (status == ACAMERA_OK)
|
|
|
|
|
{
|
|
|
|
|
m_imagesCaptured = ~0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AE_LOCK, 1, &aeLockOff);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -1241,11 +1246,26 @@ void NdkCamera::onCaptureCompleted(ACameraCaptureSession* session, ACaptureReque
|
|
|
|
|
|
|
|
|
|
if (m_params.autoExposure != 0)
|
|
|
|
|
{
|
|
|
|
|
if (mResult.aeState == ACAMERA_CONTROL_AE_STATE_SEARCHING)
|
|
|
|
|
{
|
|
|
|
|
numberOfPrecaptures ++;
|
|
|
|
|
if (numberOfPrecaptures > 50)
|
|
|
|
|
{
|
|
|
|
|
uint8_t aePrecatureTrigger = ACAMERA_CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL;
|
|
|
|
|
status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AE_PRECAPTURE_TRIGGER, 1, &aePrecatureTrigger);
|
|
|
|
|
|
|
|
|
|
aePrecatureTrigger = ACAMERA_CONTROL_AE_PRECAPTURE_TRIGGER_START;
|
|
|
|
|
status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AE_PRECAPTURE_TRIGGER, 1, &aePrecatureTrigger);
|
|
|
|
|
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_WARNING, "Retrigger PRECAPTURE status=%d AES=%u", (int)status, (unsigned int)mResult.aeState);
|
|
|
|
|
numberOfPrecaptures = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (mResult.aeState == ACAMERA_CONTROL_AE_STATE_PRECAPTURE)
|
|
|
|
|
{
|
|
|
|
|
uint8_t aePrecatureTrigger = ACAMERA_CONTROL_AE_PRECAPTURE_TRIGGER_START;
|
|
|
|
|
status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AE_PRECAPTURE_TRIGGER, 1, &aePrecatureTrigger);
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_DEBUG, "PreCapture AES=%u", (unsigned int)mResult.aeState);
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_DEBUG, "Trigger PRECAPTURE status=%d AES=%u", (int)status, (unsigned int)mResult.aeState);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|