|
|
|
@ -1037,6 +1037,10 @@ NdkCamera::CaptureRequest* NdkCamera::CreateRequest(bool isPreviewRequest, int32
|
|
|
|
|
{
|
|
|
|
|
SetupMFNR(mCharacteristics.get(), request->request, true, sensitivity);
|
|
|
|
|
}
|
|
|
|
|
else if (m_params.burstRawCapture == 4)
|
|
|
|
|
{
|
|
|
|
|
Setup3DNR(mCharacteristics.get(), request->request, sensitivity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return request;
|
|
|
|
@ -1976,6 +1980,7 @@ int64_t NdkCamera::GetTimestamp(const ACameraMetadata* result)
|
|
|
|
|
void NdkCamera::FireOneCapture(uint64_t ts)
|
|
|
|
|
{
|
|
|
|
|
#ifdef OUTPUT_DBG_INFO
|
|
|
|
|
#if 0
|
|
|
|
|
if (mWidth == 1920 && mOneFrame.size() > 1)
|
|
|
|
|
{
|
|
|
|
|
std::string dt = FormatLocalDateTime("%d%02d%02d%02d%02d%02d", ts / 1000);
|
|
|
|
@ -1995,10 +2000,13 @@ void NdkCamera::FireOneCapture(uint64_t ts)
|
|
|
|
|
cv::imwrite(fileName, it->second, params);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
onOneCapture(mCharacteristics, mCaptureResults.back(), mFinalLdr, ts - m_startTime, mOneFrame.back().second);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onOneCapture(mCharacteristics, mCaptureResultMap[mOneFrame.back().first], mFinalLdr, ts - m_startTime, mOneFrame.back().second);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NdkCamera::FireBurstCapture()
|
|
|
|
@ -2540,6 +2548,57 @@ void NdkCamera::SetupMFNR(ACameraMetadata* characteristics, ACaptureRequest* req
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NdkCamera::Setup3DNR(ACameraMetadata* characteristics, ACaptureRequest* request, int32_t sensitivity)
|
|
|
|
|
{
|
|
|
|
|
// 1. 设置基础的相机参数
|
|
|
|
|
camera_status_t status;
|
|
|
|
|
#if 0
|
|
|
|
|
int32_t tagCount = 0;
|
|
|
|
|
const uint32_t* tags = nullptr;
|
|
|
|
|
ACameraMetadata_getAllTags(characteristics, &tagCount, &tags);
|
|
|
|
|
for (int32_t i = 0; i < tagCount; i++) {
|
|
|
|
|
if (MTK_NR_FEATURE_AVAILABLE_3DNR_MODES == tags[i])
|
|
|
|
|
{
|
|
|
|
|
ALOGI("MTK_NR_FEATURE_AVAILABLE_3DNR_MODES Tag ID: 0x%x\n", tags[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ACameraMetadata_const_entry entry;
|
|
|
|
|
status = ACameraMetadata_getConstEntry(characteristics, MTK_NR_FEATURE_AVAILABLE_3DNR_MODES, &entry);
|
|
|
|
|
if (status == ACAMERA_OK)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < entry.count; i++)
|
|
|
|
|
{
|
|
|
|
|
ALOGI("MTK_NR_FEATURE_AVAILABLE_3DNR_MODES: 0x%x\n", entry.data.i32[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
int32_t nrMode = MTK_NR_FEATURE_3DNR_MODE_ON;
|
|
|
|
|
status = ACaptureRequest_setEntry_i32(request, MTK_NR_FEATURE_3DNR_MODE, 1, &nrMode);
|
|
|
|
|
if (status != ACAMERA_OK)
|
|
|
|
|
{
|
|
|
|
|
ALOGE("Failed to set MTK_NR_FEATURE_3DNR_MODE, status: %d", status);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint8_t reqRemosaicEnable = 1;
|
|
|
|
|
status = ACaptureRequest_setEntry_u8(request, MTK_HAL_REQUEST_REMOSAIC_ENABLE, 1, &reqRemosaicEnable);
|
|
|
|
|
if (status != ACAMERA_OK)
|
|
|
|
|
{
|
|
|
|
|
ALOGE("Failed to set MTK_HAL_REQUEST_REMOSAIC_ENABLE, status: %d", status);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_params.compensation != 0)
|
|
|
|
|
{
|
|
|
|
|
int32_t compensation = m_params.compensation;
|
|
|
|
|
status = ACaptureRequest_setEntry_i32(request, MTK_CONTROL_AE_EXPOSURE_COMPENSATION, 1, &compensation);
|
|
|
|
|
if (status != ACAMERA_OK)
|
|
|
|
|
{
|
|
|
|
|
ALOGE("Failed to set MTK_CONTROL_AE_EXPOSURE_COMPENSATION, status: %d", status);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NdkCamera::SetupHDR(ACameraMetadata* characteristics, ACaptureRequest* request, int32_t sensitivity)
|
|
|
|
|
{
|
|
|
|
|
// 1. 设置基础的相机参数
|
|
|
|
|