|
|
@ -805,6 +805,7 @@ NdkCamera::CaptureRequest* NdkCamera::CreateRequest(bool isPreviewRequest, int32
|
|
|
|
// request->templateId = (ACameraDevice_request_template)m_params.requestTemplate;
|
|
|
|
// request->templateId = (ACameraDevice_request_template)m_params.requestTemplate;
|
|
|
|
uint8_t captureIntent = isPreviewRequest ? ACAMERA_CONTROL_CAPTURE_INTENT_PREVIEW : GetCaptureIntent((ACameraDevice_request_template)m_params.requestTemplate);
|
|
|
|
uint8_t captureIntent = isPreviewRequest ? ACAMERA_CONTROL_CAPTURE_INTENT_PREVIEW : GetCaptureIntent((ACameraDevice_request_template)m_params.requestTemplate);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
bool forceToPreview = false;
|
|
|
|
bool forceToPreview = false;
|
|
|
|
if (!isPreviewRequest && sensitivity >= 150 && sensitivity <= 400 && (m_params.burstRawCapture == 2 || m_params.burstRawCapture == 3))
|
|
|
|
if (!isPreviewRequest && sensitivity >= 150 && sensitivity <= 400 && (m_params.burstRawCapture == 2 || m_params.burstRawCapture == 3))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -817,6 +818,7 @@ NdkCamera::CaptureRequest* NdkCamera::CreateRequest(bool isPreviewRequest, int32
|
|
|
|
XYLOG(XYLOG_SEVERITY_WARNING, "Force to use preview mode to avoid pink issue ISO=%d CameraId=%s", sensitivity, mCameraId.c_str());
|
|
|
|
XYLOG(XYLOG_SEVERITY_WARNING, "Force to use preview mode to avoid pink issue ISO=%d CameraId=%s", sensitivity, mCameraId.c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// capture request
|
|
|
|
// capture request
|
|
|
|
status = ACameraDevice_createCaptureRequest(camera_device, request->templateId, &request->request);
|
|
|
|
status = ACameraDevice_createCaptureRequest(camera_device, request->templateId, &request->request);
|
|
|
@ -1006,7 +1008,7 @@ NdkCamera::CaptureRequest* NdkCamera::CreateRequest(bool isPreviewRequest, int32
|
|
|
|
// status = ACaptureSessionOutput_create(request->imageWindow, &request->sessionOutput);
|
|
|
|
// status = ACaptureSessionOutput_create(request->imageWindow, &request->sessionOutput);
|
|
|
|
// status = ACaptureSessionOutputContainer_add(capture_session_output_container, request->sessionOutput);
|
|
|
|
// status = ACaptureSessionOutputContainer_add(capture_session_output_container, request->sessionOutput);
|
|
|
|
|
|
|
|
|
|
|
|
if (!isPreviewRequest && !forceToPreview)
|
|
|
|
if (!isPreviewRequest/* && !forceToPreview*/)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
uint8_t colorMode = ACAMERA_COLOR_CORRECTION_MODE_TRANSFORM_MATRIX;
|
|
|
|
uint8_t colorMode = ACAMERA_COLOR_CORRECTION_MODE_TRANSFORM_MATRIX;
|
|
|
@ -2531,7 +2533,7 @@ void NdkCamera::SetupMFNR(ACameraMetadata* characteristics, ACaptureRequest* req
|
|
|
|
ALOGE("Failed to set MTK_MFNR_FEATURE_MFB_MODE, status: %d", status);
|
|
|
|
ALOGE("Failed to set MTK_MFNR_FEATURE_MFB_MODE, status: %d", status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t aeTargetMode = MTK_3A_FEATURE_AE_TARGET_MODE_LE_FIX;
|
|
|
|
int32_t aeTargetMode = 1; //MTK_3A_FEATURE_AE_TARGET_MODE_LE_FIX;
|
|
|
|
status = ACaptureRequest_setEntry_i32(request, MTK_3A_FEATURE_AE_TARGET_MODE, 1, &aeTargetMode);
|
|
|
|
status = ACaptureRequest_setEntry_i32(request, MTK_3A_FEATURE_AE_TARGET_MODE, 1, &aeTargetMode);
|
|
|
|
if (status != ACAMERA_OK) {
|
|
|
|
if (status != ACAMERA_OK) {
|
|
|
|
ALOGE("Failed to set MTK_3A_FEATURE_AE_TARGET_MODE: %d", status);
|
|
|
|
ALOGE("Failed to set MTK_3A_FEATURE_AE_TARGET_MODE: %d", status);
|
|
|
@ -2661,7 +2663,6 @@ void NdkCamera::SetupHDR(ACameraMetadata* characteristics, ACaptureRequest* requ
|
|
|
|
uint8_t aeMode = MTK_CONTROL_AE_MODE_ON;
|
|
|
|
uint8_t aeMode = MTK_CONTROL_AE_MODE_ON;
|
|
|
|
status = ACaptureRequest_setEntry_u8(request, MTK_CONTROL_AE_MODE, 1, &aeMode);
|
|
|
|
status = ACaptureRequest_setEntry_u8(request, MTK_CONTROL_AE_MODE, 1, &aeMode);
|
|
|
|
|
|
|
|
|
|
|
|
// int32_t mfbMode = ais ? 2 : 1; // 1 Enable MFNR
|
|
|
|
|
|
|
|
status = ACaptureRequest_setEntry_i32(request, MTK_HDR_FEATURE_HDR_MODE, 1, &hdrMode);
|
|
|
|
status = ACaptureRequest_setEntry_i32(request, MTK_HDR_FEATURE_HDR_MODE, 1, &hdrMode);
|
|
|
|
if (status != ACAMERA_OK)
|
|
|
|
if (status != ACAMERA_OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2698,9 +2699,9 @@ bool NdkCamera::SetupTonemapCurve(ACameraMetadata* characteristics, ACaptureRequ
|
|
|
|
const uint32_t* tags = nullptr;
|
|
|
|
const uint32_t* tags = nullptr;
|
|
|
|
ACameraMetadata_getAllTags(characteristics, &tagCount, &tags);
|
|
|
|
ACameraMetadata_getAllTags(characteristics, &tagCount, &tags);
|
|
|
|
for (int32_t i = 0; i < tagCount; i++) {
|
|
|
|
for (int32_t i = 0; i < tagCount; i++) {
|
|
|
|
if (MTK_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES == tags[i])
|
|
|
|
if (MTK_3A_FEATURE_AE_TARGET_MODE == tags[i])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ALOGI("MTK_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES Tag ID: 0x%x\n", tags[i]);
|
|
|
|
ALOGI("MTK_3A_FEATURE_AE_TARGET_MODE Tag ID: 0x%x\n", tags[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2724,18 +2725,26 @@ bool NdkCamera::SetupTonemapCurve(ACameraMetadata* characteristics, ACaptureRequ
|
|
|
|
status = ACaptureRequest_setEntry_i32(request, MTK_CONTROL_AE_TARGET_FPS_RANGE, 2, fpsRange);
|
|
|
|
status = ACaptureRequest_setEntry_i32(request, MTK_CONTROL_AE_TARGET_FPS_RANGE, 2, fpsRange);
|
|
|
|
if (status != ACAMERA_OK) {
|
|
|
|
if (status != ACAMERA_OK) {
|
|
|
|
ALOGE("Failed to set MTK_CONTROL_AE_TARGET_FPS_RANGE: %d", status);
|
|
|
|
ALOGE("Failed to set MTK_CONTROL_AE_TARGET_FPS_RANGE: %d", status);
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t aeTargetMode = MTK_3A_FEATURE_AE_TARGET_MODE_STAGGER_3EXP;
|
|
|
|
int32_t aeTargetMode = 1; // MTK_3A_FEATURE_AE_TARGET_MODE_STAGGER_3EXP;
|
|
|
|
status = ACaptureRequest_setEntry_i32(request, MTK_3A_FEATURE_AE_TARGET_MODE, 1, &aeTargetMode);
|
|
|
|
status = ACaptureRequest_setEntry_i32(request, MTK_3A_FEATURE_AE_TARGET_MODE, 1, &aeTargetMode);
|
|
|
|
if (status != ACAMERA_OK) {
|
|
|
|
if (status != ACAMERA_OK) {
|
|
|
|
ALOGE("Failed to set MTK_3A_FEATURE_AE_TARGET_MODE: %d", status);
|
|
|
|
ALOGE("Failed to set MTK_3A_FEATURE_AE_TARGET_MODE: %d", status);
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t zsl = MTK_CONTROL_ENABLE_ZSL_TRUE;
|
|
|
|
|
|
|
|
status = ACaptureRequest_setEntry_i32(request, MTK_CONTROL_ENABLE_ZSL, 1, &zsl);
|
|
|
|
|
|
|
|
if (status != ACAMERA_OK) {
|
|
|
|
|
|
|
|
ALOGE("Failed to set MTK_CONTROL_ENABLE_ZSL: %d", status);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t brightness = MTK_CONTROL_ISP_BRIGHTNESS_LOW;
|
|
|
|
|
|
|
|
status = ACaptureRequest_setEntry_i32(request, MTK_CONTROL_ISP_BRIGHTNESS, 1, &brightness);
|
|
|
|
|
|
|
|
if (status != ACAMERA_OK) {
|
|
|
|
|
|
|
|
ALOGE("Failed to set MTK_CONTROL_ISP_BRIGHTNESS_LOW: %d", status);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
|
|
|
|