//TODO: sensor color calibration fields
// android.flash
- static const uint8_t flashAvailable = 0;
+ static const uint8_t flashAvailable = 1;
ADD_OR_SIZE(ANDROID_FLASH_AVAILABLE, &flashAvailable, 1);
static const int64_t flashChargeDuration = 0;
// android.stats
static const uint8_t availableFaceDetectModes[] = {
- ANDROID_STATS_FACE_DETECTION_OFF
+ ANDROID_STATS_FACE_DETECTION_OFF,
+ ANDROID_STATS_FACE_DETECTION_FULL
};
ADD_OR_SIZE(ANDROID_STATS_AVAILABLE_FACE_DETECT_MODES,
availableFaceDetectModes,
sizeof(availableFaceDetectModes));
- static const int32_t maxFaceCount = 0;
+ m_curCameraInfo->maxFaceCount = 16;
ADD_OR_SIZE(ANDROID_STATS_MAX_FACE_COUNT,
- &maxFaceCount, 1);
+ &(m_curCameraInfo->maxFaceCount), 1);
static const int32_t histogramSize = 64;
ADD_OR_SIZE(ANDROID_STATS_HISTOGRAM_BUCKET_COUNT,
static const uint8_t availableAeModes[] = {
ANDROID_CONTROL_AE_OFF,
- ANDROID_CONTROL_AE_ON
+ ANDROID_CONTROL_AE_ON,
+ ANDROID_CONTROL_AE_ON_AUTO_FLASH
};
ADD_OR_SIZE(ANDROID_CONTROL_AE_AVAILABLE_MODES,
availableAeModes, sizeof(availableAeModes));
/** android.stats */
- static const uint8_t faceDetectMode = ANDROID_STATS_FACE_DETECTION_OFF;
+ static const uint8_t faceDetectMode = ANDROID_STATS_FACE_DETECTION_FULL;
ADD_OR_SIZE(ANDROID_STATS_FACE_DETECT_MODE, &faceDetectMode, 1);
static const uint8_t histogramMode = ANDROID_STATS_OFF;
return false;
}
m_entryFrameOutputIndex = tempFrameOutputIndex;
- m_tempFrameMetadata = place_camera_metadata(m_tempFrameMetadataBuf, 2000, 15, 500); //estimated
+ m_tempFrameMetadata = place_camera_metadata(m_tempFrameMetadataBuf, 2000, 20, 500); //estimated
add_camera_metadata_entry(m_tempFrameMetadata, ANDROID_CONTROL_AF_STATE, &afState, 1);
res = m_metadataConverter->ToDynamicMetadata(&(currentEntry->internal_shot),
m_tempFrameMetadata);
if (targetStreamIndex==0) {
ALOGV("DEBUG(%s): outputstreams(%d) is for scalerP", __FUNCTION__, i);
shot_ext->request_scp = 1;
+ if (shot_ext->shot.ctl.stats.faceDetectMode != FACEDETECT_MODE_OFF)
+ shot_ext->fd_bypass = 0;
}
else if (targetStreamIndex == 1) {
ALOGV("DEBUG(%s): outputstreams(%d) is for scalerC", __FUNCTION__, i);
ALOGV("DEBUG(%s): outputstreams(%d) is for scalerP (record)", __FUNCTION__, i);
shot_ext->request_scp = 1;
shot_ext->shot.ctl.request.outputStreams[2] = 1;
+ if (shot_ext->shot.ctl.stats.faceDetectMode != FACEDETECT_MODE_OFF)
+ shot_ext->fd_bypass = 0;
}
else {
ALOGV("DEBUG(%s): outputstreams(%d) has abnormal value(%d)", __FUNCTION__, i, targetStreamIndex);
if (targetStreamIndex==0) {
ALOGV("DEBUG(%s): outputstreams(%d) is for scalerP", __FUNCTION__, i);
shot_ext->request_scp = 1;
+ if (shot_ext->shot.ctl.stats.faceDetectMode != FACEDETECT_MODE_OFF)
+ shot_ext->fd_bypass = 0;
}
else if (targetStreamIndex == 1) {
ALOGV("DEBUG(%s): outputstreams(%d) is for scalerC", __FUNCTION__, i);
shot_ext->request_scc = 1;
+ if (shot_ext->shot.ctl.stats.faceDetectMode != FACEDETECT_MODE_OFF)
+ shot_ext->fd_bypass = 0;
}
else if (targetStreamIndex == 2) {
ALOGV("DEBUG(%s): outputstreams(%d) is for scalerP (record)", __FUNCTION__, i);
shot_ext->shot.ctl.request.outputStreams[2] = 1;
shot_ext->shot.ctl.aa.aeTargetFpsRange[0] = 30;
shot_ext->shot.ctl.aa.aeTargetFpsRange[1] = 30;
+ if (shot_ext->shot.ctl.stats.faceDetectMode != FACEDETECT_MODE_OFF)
+ shot_ext->fd_bypass = 0;
}
else {
ALOGV("DEBUG(%s): outputstreams(%d) has abnormal value(%d)", __FUNCTION__, i, targetStreamIndex);
else
m_scp_closed = false;
+ if (!shot_ext->fd_bypass) {
+ /* FD orientation axis transformation */
+ for (int i=0; i < CAMERA2_MAX_FACES; i++) {
+ if (shot_ext->shot.dm.stats.faceRectangles[i][0] > 0)
+ shot_ext->shot.dm.stats.faceRectangles[i][0] = (m_camera2->m_curCameraInfo->sensorW
+ * shot_ext->shot.dm.stats.faceRectangles[i][0])
+ / m_streamThreads[0].get()->m_parameters.outputWidth;
+ if (shot_ext->shot.dm.stats.faceRectangles[i][1] > 0)
+ shot_ext->shot.dm.stats.faceRectangles[i][1] = (m_camera2->m_curCameraInfo->sensorH
+ * shot_ext->shot.dm.stats.faceRectangles[i][1])
+ / m_streamThreads[0].get()->m_parameters.outputHeight;
+ if (shot_ext->shot.dm.stats.faceRectangles[i][2] > 0)
+ shot_ext->shot.dm.stats.faceRectangles[i][2] = (m_camera2->m_curCameraInfo->sensorW
+ * shot_ext->shot.dm.stats.faceRectangles[i][2])
+ / m_streamThreads[0].get()->m_parameters.outputWidth;
+ if (shot_ext->shot.dm.stats.faceRectangles[i][3] > 0)
+ shot_ext->shot.dm.stats.faceRectangles[i][3] = (m_camera2->m_curCameraInfo->sensorH
+ * shot_ext->shot.dm.stats.faceRectangles[i][3])
+ / m_streamThreads[0].get()->m_parameters.outputHeight;
+ }
+ }
+
m_requestManager->ApplyDynamicMetadata(shot_ext);
OnAfNotification(shot_ext->shot.dm.aa.afState);
}
&intData, 1))
return NO_MEMORY;
- byteData = ANDROID_STATS_FACE_DETECTION_OFF;
+ byteData = metadata->dm.stats.faceDetectMode - 1;
if (0 != add_camera_metadata_entry(dst, ANDROID_STATS_FACE_DETECT_MODE,
&byteData, 1))
return NO_MEMORY;
+ int maxFacecount = 16;
+ if (0 != add_camera_metadata_entry(dst, ANDROID_STATS_MAX_FACE_COUNT,
+ &maxFacecount, 1))
+ return NO_MEMORY;
+
+ if (0 != add_camera_metadata_entry(dst, ANDROID_STATS_FACE_RECTANGLES,
+ &metadata->dm.stats.faceRectangles, 4 * maxFacecount))
+ return NO_MEMORY;
+
+ if (0 != add_camera_metadata_entry(dst, ANDROID_STATS_FACE_LANDMARKS,
+ &metadata->dm.stats.faceLandmarks, 6 * maxFacecount))
+ return NO_MEMORY;
+
+ if (0 != add_camera_metadata_entry(dst, ANDROID_STATS_FACE_IDS,
+ &metadata->dm.stats.faceIds, maxFacecount))
+ return NO_MEMORY;
+
+ if (0 != add_camera_metadata_entry(dst, ANDROID_STATS_FACE_SCORES,
+ &metadata->dm.stats.faceScores, maxFacecount))
+ return NO_MEMORY;
+
+
ALOGV("(%s): AWB(%d) AE(%d) SCENE(%d) AEComp(%d)", __FUNCTION__,
metadata->dm.aa.awbMode - 1, metadata->dm.aa.aeMode - 1, metadata->ctl.aa.sceneMode - 1,
metadata->ctl.aa.aeExpCompensation );