am bbbc646d: EmulatedCamera2: Fix metadata symbols: DO NOT MERGE
# Via Igor Murashkin * commit 'bbbc646d85c959d8be3431b4922e943f2978135f': EmulatedCamera2: Fix metadata symbols: DO NOT MERGE
This commit is contained in:
@@ -1277,7 +1277,7 @@ bool EmulatedFakeCamera2::ReadoutThread::threadLoop() {
|
|||||||
ALOGV("Readout: Constructing metadata and frames for request %d",
|
ALOGV("Readout: Constructing metadata and frames for request %d",
|
||||||
frameNumber);
|
frameNumber);
|
||||||
|
|
||||||
if (*entry.data.u8 == ANDROID_REQUEST_METADATA_FULL) {
|
if (*entry.data.u8 == ANDROID_REQUEST_METADATA_MODE_FULL) {
|
||||||
ALOGV("Readout: Metadata requested, constructing");
|
ALOGV("Readout: Metadata requested, constructing");
|
||||||
|
|
||||||
camera_metadata_t *frame = NULL;
|
camera_metadata_t *frame = NULL;
|
||||||
@@ -1395,14 +1395,14 @@ status_t EmulatedFakeCamera2::ReadoutThread::collectStatisticsMetadata(
|
|||||||
status_t res;
|
status_t res;
|
||||||
camera_metadata_entry_t entry;
|
camera_metadata_entry_t entry;
|
||||||
res = find_camera_metadata_entry(frame,
|
res = find_camera_metadata_entry(frame,
|
||||||
ANDROID_STATS_FACE_DETECT_MODE,
|
ANDROID_STATISTICS_FACE_DETECT_MODE,
|
||||||
&entry);
|
&entry);
|
||||||
if (res != OK) {
|
if (res != OK) {
|
||||||
ALOGE("%s: Unable to find face detect mode!", __FUNCTION__);
|
ALOGE("%s: Unable to find face detect mode!", __FUNCTION__);
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry.data.u8[0] == ANDROID_STATS_FACE_DETECTION_OFF) return OK;
|
if (entry.data.u8[0] == ANDROID_STATISTICS_FACE_DETECT_MODE_OFF) return OK;
|
||||||
|
|
||||||
// The coordinate system for the face regions is the raw sensor pixel
|
// The coordinate system for the face regions is the raw sensor pixel
|
||||||
// coordinates. Here, we map from the scene coordinates (0-19 in both axis)
|
// coordinates. Here, we map from the scene coordinates (0-19 in both axis)
|
||||||
@@ -1434,21 +1434,21 @@ status_t EmulatedFakeCamera2::ReadoutThread::collectStatisticsMetadata(
|
|||||||
scores[i] += (int32_t)(((float)rand() / RAND_MAX) * 10 - 5);
|
scores[i] += (int32_t)(((float)rand() / RAND_MAX) * 10 - 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
res = add_camera_metadata_entry(frame, ANDROID_STATS_FACE_RECTANGLES,
|
res = add_camera_metadata_entry(frame, ANDROID_STATISTICS_FACE_RECTANGLES,
|
||||||
rects, numFaces * 4);
|
rects, numFaces * 4);
|
||||||
if (res != OK) {
|
if (res != OK) {
|
||||||
ALOGE("%s: Unable to add face rectangles!", __FUNCTION__);
|
ALOGE("%s: Unable to add face rectangles!", __FUNCTION__);
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = add_camera_metadata_entry(frame, ANDROID_STATS_FACE_SCORES,
|
res = add_camera_metadata_entry(frame, ANDROID_STATISTICS_FACE_SCORES,
|
||||||
scores, numFaces);
|
scores, numFaces);
|
||||||
if (res != OK) {
|
if (res != OK) {
|
||||||
ALOGE("%s: Unable to add face scores!", __FUNCTION__);
|
ALOGE("%s: Unable to add face scores!", __FUNCTION__);
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry.data.u8[0] == ANDROID_STATS_FACE_DETECTION_SIMPLE) return OK;
|
if (entry.data.u8[0] == ANDROID_STATISTICS_FACE_DETECT_MODE_SIMPLE) return OK;
|
||||||
|
|
||||||
// Advanced face detection options - add eye/mouth coordinates. The
|
// Advanced face detection options - add eye/mouth coordinates. The
|
||||||
// coordinates in order are (leftEyeX, leftEyeY, rightEyeX, rightEyeY,
|
// coordinates in order are (leftEyeX, leftEyeY, rightEyeX, rightEyeY,
|
||||||
@@ -1479,14 +1479,14 @@ status_t EmulatedFakeCamera2::ReadoutThread::collectStatisticsMetadata(
|
|||||||
100, 200
|
100, 200
|
||||||
};
|
};
|
||||||
|
|
||||||
res = add_camera_metadata_entry(frame, ANDROID_STATS_FACE_LANDMARKS,
|
res = add_camera_metadata_entry(frame, ANDROID_STATISTICS_FACE_LANDMARKS,
|
||||||
features, numFaces * 6);
|
features, numFaces * 6);
|
||||||
if (res != OK) {
|
if (res != OK) {
|
||||||
ALOGE("%s: Unable to add face landmarks!", __FUNCTION__);
|
ALOGE("%s: Unable to add face landmarks!", __FUNCTION__);
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = add_camera_metadata_entry(frame, ANDROID_STATS_FACE_IDS,
|
res = add_camera_metadata_entry(frame, ANDROID_STATISTICS_FACE_IDS,
|
||||||
ids, numFaces);
|
ids, numFaces);
|
||||||
if (res != OK) {
|
if (res != OK) {
|
||||||
ALOGE("%s: Unable to add face scores!", __FUNCTION__);
|
ALOGE("%s: Unable to add face scores!", __FUNCTION__);
|
||||||
@@ -1514,16 +1514,16 @@ status_t EmulatedFakeCamera2::ControlThread::readyToRun() {
|
|||||||
mCancelAf = false;
|
mCancelAf = false;
|
||||||
mStartPrecapture = false;
|
mStartPrecapture = false;
|
||||||
|
|
||||||
mControlMode = ANDROID_CONTROL_AUTO;
|
mControlMode = ANDROID_CONTROL_MODE_AUTO;
|
||||||
|
|
||||||
mEffectMode = ANDROID_CONTROL_EFFECT_OFF;
|
mEffectMode = ANDROID_CONTROL_EFFECT_MODE_OFF;
|
||||||
mSceneMode = ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY;
|
mSceneMode = ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY;
|
||||||
|
|
||||||
mAfMode = ANDROID_CONTROL_AF_AUTO;
|
mAfMode = ANDROID_CONTROL_AF_MODE_AUTO;
|
||||||
mAfModeChange = false;
|
mAfModeChange = false;
|
||||||
|
|
||||||
mAeMode = ANDROID_CONTROL_AE_ON;
|
mAeMode = ANDROID_CONTROL_AE_MODE_ON;
|
||||||
mAwbMode = ANDROID_CONTROL_AWB_AUTO;
|
mAwbMode = ANDROID_CONTROL_AWB_MODE_AUTO;
|
||||||
|
|
||||||
mAfTriggerId = 0;
|
mAfTriggerId = 0;
|
||||||
mPrecaptureTriggerId = 0;
|
mPrecaptureTriggerId = 0;
|
||||||
@@ -1625,7 +1625,7 @@ status_t EmulatedFakeCamera2::ControlThread::processRequest(camera_metadata_t *r
|
|||||||
|
|
||||||
// TODO: Override more control fields
|
// TODO: Override more control fields
|
||||||
|
|
||||||
if (mAeMode != ANDROID_CONTROL_AE_OFF) {
|
if (mAeMode != ANDROID_CONTROL_AE_MODE_OFF) {
|
||||||
camera_metadata_entry_t exposureTime;
|
camera_metadata_entry_t exposureTime;
|
||||||
res = find_camera_metadata_entry(request,
|
res = find_camera_metadata_entry(request,
|
||||||
ANDROID_SENSOR_EXPOSURE_TIME,
|
ANDROID_SENSOR_EXPOSURE_TIME,
|
||||||
@@ -1776,12 +1776,12 @@ bool EmulatedFakeCamera2::ControlThread::threadLoop() {
|
|||||||
int EmulatedFakeCamera2::ControlThread::processAfTrigger(uint8_t afMode,
|
int EmulatedFakeCamera2::ControlThread::processAfTrigger(uint8_t afMode,
|
||||||
uint8_t afState) {
|
uint8_t afState) {
|
||||||
switch (afMode) {
|
switch (afMode) {
|
||||||
case ANDROID_CONTROL_AF_OFF:
|
case ANDROID_CONTROL_AF_MODE_OFF:
|
||||||
case ANDROID_CONTROL_AF_EDOF:
|
case ANDROID_CONTROL_AF_MODE_EDOF:
|
||||||
// Do nothing
|
// Do nothing
|
||||||
break;
|
break;
|
||||||
case ANDROID_CONTROL_AF_MACRO:
|
case ANDROID_CONTROL_AF_MODE_MACRO:
|
||||||
case ANDROID_CONTROL_AF_AUTO:
|
case ANDROID_CONTROL_AF_MODE_AUTO:
|
||||||
switch (afState) {
|
switch (afState) {
|
||||||
case ANDROID_CONTROL_AF_STATE_INACTIVE:
|
case ANDROID_CONTROL_AF_STATE_INACTIVE:
|
||||||
case ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED:
|
case ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED:
|
||||||
@@ -1801,7 +1801,7 @@ int EmulatedFakeCamera2::ControlThread::processAfTrigger(uint8_t afMode,
|
|||||||
afState);
|
afState);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ANDROID_CONTROL_AF_CONTINUOUS_PICTURE:
|
case ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE:
|
||||||
switch (afState) {
|
switch (afState) {
|
||||||
// Picture mode waits for passive scan to complete
|
// Picture mode waits for passive scan to complete
|
||||||
case ANDROID_CONTROL_AF_STATE_PASSIVE_SCAN:
|
case ANDROID_CONTROL_AF_STATE_PASSIVE_SCAN:
|
||||||
@@ -1822,7 +1822,7 @@ int EmulatedFakeCamera2::ControlThread::processAfTrigger(uint8_t afMode,
|
|||||||
afState);
|
afState);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ANDROID_CONTROL_AF_CONTINUOUS_VIDEO:
|
case ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO:
|
||||||
switch (afState) {
|
switch (afState) {
|
||||||
// Video mode does not wait for passive scan to complete
|
// Video mode does not wait for passive scan to complete
|
||||||
case ANDROID_CONTROL_AF_STATE_PASSIVE_SCAN:
|
case ANDROID_CONTROL_AF_STATE_PASSIVE_SCAN:
|
||||||
@@ -1849,8 +1849,8 @@ int EmulatedFakeCamera2::ControlThread::processAfTrigger(uint8_t afMode,
|
|||||||
|
|
||||||
int EmulatedFakeCamera2::ControlThread::maybeStartAfScan(uint8_t afMode,
|
int EmulatedFakeCamera2::ControlThread::maybeStartAfScan(uint8_t afMode,
|
||||||
uint8_t afState) {
|
uint8_t afState) {
|
||||||
if ((afMode == ANDROID_CONTROL_AF_CONTINUOUS_VIDEO ||
|
if ((afMode == ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO ||
|
||||||
afMode == ANDROID_CONTROL_AF_CONTINUOUS_PICTURE) &&
|
afMode == ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE) &&
|
||||||
(afState == ANDROID_CONTROL_AF_STATE_INACTIVE ||
|
(afState == ANDROID_CONTROL_AF_STATE_INACTIVE ||
|
||||||
afState == ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED)) {
|
afState == ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED)) {
|
||||||
|
|
||||||
@@ -1877,8 +1877,8 @@ int EmulatedFakeCamera2::ControlThread::updateAfScan(uint8_t afMode,
|
|||||||
if (mAfScanDuration <= 0) {
|
if (mAfScanDuration <= 0) {
|
||||||
ALOGV("%s: AF scan done", __FUNCTION__);
|
ALOGV("%s: AF scan done", __FUNCTION__);
|
||||||
switch (afMode) {
|
switch (afMode) {
|
||||||
case ANDROID_CONTROL_AF_MACRO:
|
case ANDROID_CONTROL_AF_MODE_MACRO:
|
||||||
case ANDROID_CONTROL_AF_AUTO: {
|
case ANDROID_CONTROL_AF_MODE_AUTO: {
|
||||||
bool success = ((double)rand() / RAND_MAX) < kAfSuccessRate;
|
bool success = ((double)rand() / RAND_MAX) < kAfSuccessRate;
|
||||||
if (success) {
|
if (success) {
|
||||||
afState = ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED;
|
afState = ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED;
|
||||||
@@ -1887,7 +1887,7 @@ int EmulatedFakeCamera2::ControlThread::updateAfScan(uint8_t afMode,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ANDROID_CONTROL_AF_CONTINUOUS_PICTURE:
|
case ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE:
|
||||||
if (mLockAfterPassiveScan) {
|
if (mLockAfterPassiveScan) {
|
||||||
afState = ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED;
|
afState = ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED;
|
||||||
mLockAfterPassiveScan = false;
|
mLockAfterPassiveScan = false;
|
||||||
@@ -1895,7 +1895,7 @@ int EmulatedFakeCamera2::ControlThread::updateAfScan(uint8_t afMode,
|
|||||||
afState = ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED;
|
afState = ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ANDROID_CONTROL_AF_CONTINUOUS_VIDEO:
|
case ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO:
|
||||||
afState = ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED;
|
afState = ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -1924,13 +1924,13 @@ void EmulatedFakeCamera2::ControlThread::updateAfState(uint8_t newState,
|
|||||||
int EmulatedFakeCamera2::ControlThread::processPrecaptureTrigger(uint8_t aeMode,
|
int EmulatedFakeCamera2::ControlThread::processPrecaptureTrigger(uint8_t aeMode,
|
||||||
uint8_t aeState) {
|
uint8_t aeState) {
|
||||||
switch (aeMode) {
|
switch (aeMode) {
|
||||||
case ANDROID_CONTROL_AE_OFF:
|
case ANDROID_CONTROL_AE_MODE_OFF:
|
||||||
// Don't do anything for these
|
// Don't do anything for these
|
||||||
return aeState;
|
return aeState;
|
||||||
case ANDROID_CONTROL_AE_ON:
|
case ANDROID_CONTROL_AE_MODE_ON:
|
||||||
case ANDROID_CONTROL_AE_ON_AUTO_FLASH:
|
case ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH:
|
||||||
case ANDROID_CONTROL_AE_ON_ALWAYS_FLASH:
|
case ANDROID_CONTROL_AE_MODE_ON_ALWAYS_FLASH:
|
||||||
case ANDROID_CONTROL_AE_ON_AUTO_FLASH_REDEYE:
|
case ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE:
|
||||||
// Trigger a precapture cycle
|
// Trigger a precapture cycle
|
||||||
aeState = ANDROID_CONTROL_AE_STATE_PRECAPTURE;
|
aeState = ANDROID_CONTROL_AE_STATE_PRECAPTURE;
|
||||||
mAeScanDuration = ((double)rand() / RAND_MAX) *
|
mAeScanDuration = ((double)rand() / RAND_MAX) *
|
||||||
@@ -1948,12 +1948,12 @@ int EmulatedFakeCamera2::ControlThread::maybeStartAeScan(uint8_t aeMode,
|
|||||||
uint8_t aeState) {
|
uint8_t aeState) {
|
||||||
if (aeLocked) return aeState;
|
if (aeLocked) return aeState;
|
||||||
switch (aeMode) {
|
switch (aeMode) {
|
||||||
case ANDROID_CONTROL_AE_OFF:
|
case ANDROID_CONTROL_AE_MODE_OFF:
|
||||||
break;
|
break;
|
||||||
case ANDROID_CONTROL_AE_ON:
|
case ANDROID_CONTROL_AE_MODE_ON:
|
||||||
case ANDROID_CONTROL_AE_ON_AUTO_FLASH:
|
case ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH:
|
||||||
case ANDROID_CONTROL_AE_ON_ALWAYS_FLASH:
|
case ANDROID_CONTROL_AE_MODE_ON_ALWAYS_FLASH:
|
||||||
case ANDROID_CONTROL_AE_ON_AUTO_FLASH_REDEYE: {
|
case ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE: {
|
||||||
if (aeState != ANDROID_CONTROL_AE_STATE_INACTIVE &&
|
if (aeState != ANDROID_CONTROL_AE_STATE_INACTIVE &&
|
||||||
aeState != ANDROID_CONTROL_AE_STATE_CONVERGED) break;
|
aeState != ANDROID_CONTROL_AE_STATE_CONVERGED) break;
|
||||||
|
|
||||||
@@ -2033,39 +2033,39 @@ status_t EmulatedFakeCamera2::constructStaticInfo(
|
|||||||
|
|
||||||
// 5 cm min focus distance for back camera, infinity (fixed focus) for front
|
// 5 cm min focus distance for back camera, infinity (fixed focus) for front
|
||||||
const float minFocusDistance = mFacingBack ? 1.0/0.05 : 0.0;
|
const float minFocusDistance = mFacingBack ? 1.0/0.05 : 0.0;
|
||||||
ADD_OR_SIZE(ANDROID_LENS_MINIMUM_FOCUS_DISTANCE,
|
ADD_OR_SIZE(ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE,
|
||||||
&minFocusDistance, 1);
|
&minFocusDistance, 1);
|
||||||
// 5 m hyperfocal distance for back camera, infinity (fixed focus) for front
|
// 5 m hyperfocal distance for back camera, infinity (fixed focus) for front
|
||||||
const float hyperFocalDistance = mFacingBack ? 1.0/5.0 : 0.0;
|
const float hyperFocalDistance = mFacingBack ? 1.0/5.0 : 0.0;
|
||||||
ADD_OR_SIZE(ANDROID_LENS_HYPERFOCAL_DISTANCE,
|
ADD_OR_SIZE(ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,
|
||||||
&minFocusDistance, 1);
|
&minFocusDistance, 1);
|
||||||
|
|
||||||
static const float focalLength = 3.30f; // mm
|
static const float focalLength = 3.30f; // mm
|
||||||
ADD_OR_SIZE(ANDROID_LENS_AVAILABLE_FOCAL_LENGTHS,
|
ADD_OR_SIZE(ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS,
|
||||||
&focalLength, 1);
|
&focalLength, 1);
|
||||||
static const float aperture = 2.8f;
|
static const float aperture = 2.8f;
|
||||||
ADD_OR_SIZE(ANDROID_LENS_AVAILABLE_APERTURES,
|
ADD_OR_SIZE(ANDROID_LENS_INFO_AVAILABLE_APERTURES,
|
||||||
&aperture, 1);
|
&aperture, 1);
|
||||||
static const float filterDensity = 0;
|
static const float filterDensity = 0;
|
||||||
ADD_OR_SIZE(ANDROID_LENS_AVAILABLE_FILTER_DENSITY,
|
ADD_OR_SIZE(ANDROID_LENS_INFO_AVAILABLE_FILTER_DENSITIES,
|
||||||
&filterDensity, 1);
|
&filterDensity, 1);
|
||||||
static const uint8_t availableOpticalStabilization =
|
static const uint8_t availableOpticalStabilization =
|
||||||
ANDROID_LENS_OPTICAL_STABILIZATION_OFF;
|
ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF;
|
||||||
ADD_OR_SIZE(ANDROID_LENS_AVAILABLE_OPTICAL_STABILIZATION,
|
ADD_OR_SIZE(ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,
|
||||||
&availableOpticalStabilization, 1);
|
&availableOpticalStabilization, 1);
|
||||||
|
|
||||||
static const int32_t lensShadingMapSize[] = {1, 1};
|
static const int32_t lensShadingMapSize[] = {1, 1};
|
||||||
ADD_OR_SIZE(ANDROID_LENS_SHADING_MAP_SIZE, lensShadingMapSize,
|
ADD_OR_SIZE(ANDROID_LENS_INFO_SHADING_MAP_SIZE, lensShadingMapSize,
|
||||||
sizeof(lensShadingMapSize)/sizeof(int32_t));
|
sizeof(lensShadingMapSize)/sizeof(int32_t));
|
||||||
|
|
||||||
static const float lensShadingMap[3 * 1 * 1 ] =
|
static const float lensShadingMap[3 * 1 * 1 ] =
|
||||||
{ 1.f, 1.f, 1.f };
|
{ 1.f, 1.f, 1.f };
|
||||||
ADD_OR_SIZE(ANDROID_LENS_SHADING_MAP, lensShadingMap,
|
ADD_OR_SIZE(ANDROID_LENS_INFO_SHADING_MAP, lensShadingMap,
|
||||||
sizeof(lensShadingMap)/sizeof(float));
|
sizeof(lensShadingMap)/sizeof(float));
|
||||||
|
|
||||||
// Identity transform
|
// Identity transform
|
||||||
static const int32_t geometricCorrectionMapSize[] = {2, 2};
|
static const int32_t geometricCorrectionMapSize[] = {2, 2};
|
||||||
ADD_OR_SIZE(ANDROID_LENS_GEOMETRIC_CORRECTION_MAP_SIZE,
|
ADD_OR_SIZE(ANDROID_LENS_INFO_GEOMETRIC_CORRECTION_MAP_SIZE,
|
||||||
geometricCorrectionMapSize,
|
geometricCorrectionMapSize,
|
||||||
sizeof(geometricCorrectionMapSize)/sizeof(int32_t));
|
sizeof(geometricCorrectionMapSize)/sizeof(int32_t));
|
||||||
|
|
||||||
@@ -2074,7 +2074,7 @@ status_t EmulatedFakeCamera2::constructStaticInfo(
|
|||||||
1.f, 0.f, 1.f, 0.f, 1.f, 0.f,
|
1.f, 0.f, 1.f, 0.f, 1.f, 0.f,
|
||||||
0.f, 1.f, 0.f, 1.f, 0.f, 1.f,
|
0.f, 1.f, 0.f, 1.f, 0.f, 1.f,
|
||||||
1.f, 1.f, 1.f, 1.f, 1.f, 1.f};
|
1.f, 1.f, 1.f, 1.f, 1.f, 1.f};
|
||||||
ADD_OR_SIZE(ANDROID_LENS_GEOMETRIC_CORRECTION_MAP,
|
ADD_OR_SIZE(ANDROID_LENS_INFO_GEOMETRIC_CORRECTION_MAP,
|
||||||
geometricCorrectionMap,
|
geometricCorrectionMap,
|
||||||
sizeof(geometricCorrectionMap)/sizeof(float));
|
sizeof(geometricCorrectionMap)/sizeof(float));
|
||||||
|
|
||||||
@@ -2099,31 +2099,31 @@ status_t EmulatedFakeCamera2::constructStaticInfo(
|
|||||||
|
|
||||||
// android.sensor
|
// android.sensor
|
||||||
|
|
||||||
ADD_OR_SIZE(ANDROID_SENSOR_EXPOSURE_TIME_RANGE,
|
ADD_OR_SIZE(ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,
|
||||||
Sensor::kExposureTimeRange, 2);
|
Sensor::kExposureTimeRange, 2);
|
||||||
|
|
||||||
ADD_OR_SIZE(ANDROID_SENSOR_MAX_FRAME_DURATION,
|
ADD_OR_SIZE(ANDROID_SENSOR_INFO_MAX_FRAME_DURATION,
|
||||||
&Sensor::kFrameDurationRange[1], 1);
|
&Sensor::kFrameDurationRange[1], 1);
|
||||||
|
|
||||||
ADD_OR_SIZE(ANDROID_SENSOR_AVAILABLE_SENSITIVITIES,
|
ADD_OR_SIZE(ANDROID_SENSOR_INFO_AVAILABLE_SENSITIVITIES,
|
||||||
Sensor::kAvailableSensitivities,
|
Sensor::kAvailableSensitivities,
|
||||||
sizeof(Sensor::kAvailableSensitivities)
|
sizeof(Sensor::kAvailableSensitivities)
|
||||||
/sizeof(uint32_t));
|
/sizeof(uint32_t));
|
||||||
|
|
||||||
ADD_OR_SIZE(ANDROID_SENSOR_COLOR_FILTER_ARRANGEMENT,
|
ADD_OR_SIZE(ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT,
|
||||||
&Sensor::kColorFilterArrangement, 1);
|
&Sensor::kColorFilterArrangement, 1);
|
||||||
|
|
||||||
static const float sensorPhysicalSize[2] = {3.20f, 2.40f}; // mm
|
static const float sensorPhysicalSize[2] = {3.20f, 2.40f}; // mm
|
||||||
ADD_OR_SIZE(ANDROID_SENSOR_PHYSICAL_SIZE,
|
ADD_OR_SIZE(ANDROID_SENSOR_INFO_PHYSICAL_SIZE,
|
||||||
sensorPhysicalSize, 2);
|
sensorPhysicalSize, 2);
|
||||||
|
|
||||||
ADD_OR_SIZE(ANDROID_SENSOR_PIXEL_ARRAY_SIZE,
|
ADD_OR_SIZE(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE,
|
||||||
Sensor::kResolution, 2);
|
Sensor::kResolution, 2);
|
||||||
|
|
||||||
ADD_OR_SIZE(ANDROID_SENSOR_ACTIVE_ARRAY_SIZE,
|
ADD_OR_SIZE(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE,
|
||||||
Sensor::kResolution, 2);
|
Sensor::kResolution, 2);
|
||||||
|
|
||||||
ADD_OR_SIZE(ANDROID_SENSOR_WHITE_LEVEL,
|
ADD_OR_SIZE(ANDROID_SENSOR_INFO_WHITE_LEVEL,
|
||||||
&Sensor::kMaxRawValue, 1);
|
&Sensor::kMaxRawValue, 1);
|
||||||
|
|
||||||
static const int32_t blackLevelPattern[4] = {
|
static const int32_t blackLevelPattern[4] = {
|
||||||
@@ -2137,10 +2137,10 @@ status_t EmulatedFakeCamera2::constructStaticInfo(
|
|||||||
|
|
||||||
// android.flash
|
// android.flash
|
||||||
static const uint8_t flashAvailable = 0;
|
static const uint8_t flashAvailable = 0;
|
||||||
ADD_OR_SIZE(ANDROID_FLASH_AVAILABLE, &flashAvailable, 1);
|
ADD_OR_SIZE(ANDROID_FLASH_INFO_AVAILABLE, &flashAvailable, 1);
|
||||||
|
|
||||||
static const int64_t flashChargeDuration = 0;
|
static const int64_t flashChargeDuration = 0;
|
||||||
ADD_OR_SIZE(ANDROID_FLASH_CHARGE_DURATION, &flashChargeDuration, 1);
|
ADD_OR_SIZE(ANDROID_FLASH_INFO_CHARGE_DURATION, &flashChargeDuration, 1);
|
||||||
|
|
||||||
// android.tonemap
|
// android.tonemap
|
||||||
|
|
||||||
@@ -2190,7 +2190,7 @@ status_t EmulatedFakeCamera2::constructStaticInfo(
|
|||||||
sizeof(kAvailableJpegMinDurations)/sizeof(uint64_t));
|
sizeof(kAvailableJpegMinDurations)/sizeof(uint64_t));
|
||||||
|
|
||||||
static const float maxZoom = 10;
|
static const float maxZoom = 10;
|
||||||
ADD_OR_SIZE(ANDROID_SCALER_AVAILABLE_MAX_ZOOM,
|
ADD_OR_SIZE(ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM,
|
||||||
&maxZoom, 1);
|
&maxZoom, 1);
|
||||||
|
|
||||||
// android.jpeg
|
// android.jpeg
|
||||||
@@ -2209,33 +2209,33 @@ status_t EmulatedFakeCamera2::constructStaticInfo(
|
|||||||
// android.stats
|
// android.stats
|
||||||
|
|
||||||
static const uint8_t availableFaceDetectModes[] = {
|
static const uint8_t availableFaceDetectModes[] = {
|
||||||
ANDROID_STATS_FACE_DETECTION_OFF,
|
ANDROID_STATISTICS_FACE_DETECT_MODE_OFF,
|
||||||
ANDROID_STATS_FACE_DETECTION_SIMPLE,
|
ANDROID_STATISTICS_FACE_DETECT_MODE_SIMPLE,
|
||||||
ANDROID_STATS_FACE_DETECTION_FULL
|
ANDROID_STATISTICS_FACE_DETECT_MODE_FULL
|
||||||
};
|
};
|
||||||
|
|
||||||
ADD_OR_SIZE(ANDROID_STATS_AVAILABLE_FACE_DETECT_MODES,
|
ADD_OR_SIZE(ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES,
|
||||||
availableFaceDetectModes,
|
availableFaceDetectModes,
|
||||||
sizeof(availableFaceDetectModes));
|
sizeof(availableFaceDetectModes));
|
||||||
|
|
||||||
static const int32_t maxFaceCount = 8;
|
static const int32_t maxFaceCount = 8;
|
||||||
ADD_OR_SIZE(ANDROID_STATS_MAX_FACE_COUNT,
|
ADD_OR_SIZE(ANDROID_STATISTICS_INFO_MAX_FACE_COUNT,
|
||||||
&maxFaceCount, 1);
|
&maxFaceCount, 1);
|
||||||
|
|
||||||
static const int32_t histogramSize = 64;
|
static const int32_t histogramSize = 64;
|
||||||
ADD_OR_SIZE(ANDROID_STATS_HISTOGRAM_BUCKET_COUNT,
|
ADD_OR_SIZE(ANDROID_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT,
|
||||||
&histogramSize, 1);
|
&histogramSize, 1);
|
||||||
|
|
||||||
static const int32_t maxHistogramCount = 1000;
|
static const int32_t maxHistogramCount = 1000;
|
||||||
ADD_OR_SIZE(ANDROID_STATS_MAX_HISTOGRAM_COUNT,
|
ADD_OR_SIZE(ANDROID_STATISTICS_INFO_MAX_HISTOGRAM_COUNT,
|
||||||
&maxHistogramCount, 1);
|
&maxHistogramCount, 1);
|
||||||
|
|
||||||
static const int32_t sharpnessMapSize[2] = {64, 64};
|
static const int32_t sharpnessMapSize[2] = {64, 64};
|
||||||
ADD_OR_SIZE(ANDROID_STATS_SHARPNESS_MAP_SIZE,
|
ADD_OR_SIZE(ANDROID_STATISTICS_INFO_SHARPNESS_MAP_SIZE,
|
||||||
sharpnessMapSize, sizeof(sharpnessMapSize)/sizeof(int32_t));
|
sharpnessMapSize, sizeof(sharpnessMapSize)/sizeof(int32_t));
|
||||||
|
|
||||||
static const int32_t maxSharpnessMapValue = 1000;
|
static const int32_t maxSharpnessMapValue = 1000;
|
||||||
ADD_OR_SIZE(ANDROID_STATS_MAX_SHARPNESS_MAP_VALUE,
|
ADD_OR_SIZE(ANDROID_STATISTICS_INFO_MAX_SHARPNESS_MAP_VALUE,
|
||||||
&maxSharpnessMapValue, 1);
|
&maxSharpnessMapValue, 1);
|
||||||
|
|
||||||
// android.control
|
// android.control
|
||||||
@@ -2247,7 +2247,7 @@ status_t EmulatedFakeCamera2::constructStaticInfo(
|
|||||||
availableSceneModes, sizeof(availableSceneModes));
|
availableSceneModes, sizeof(availableSceneModes));
|
||||||
|
|
||||||
static const uint8_t availableEffects[] = {
|
static const uint8_t availableEffects[] = {
|
||||||
ANDROID_CONTROL_EFFECT_OFF
|
ANDROID_CONTROL_EFFECT_MODE_OFF
|
||||||
};
|
};
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AVAILABLE_EFFECTS,
|
ADD_OR_SIZE(ANDROID_CONTROL_AVAILABLE_EFFECTS,
|
||||||
availableEffects, sizeof(availableEffects));
|
availableEffects, sizeof(availableEffects));
|
||||||
@@ -2257,8 +2257,8 @@ status_t EmulatedFakeCamera2::constructStaticInfo(
|
|||||||
&max3aRegions, 1);
|
&max3aRegions, 1);
|
||||||
|
|
||||||
static const uint8_t availableAeModes[] = {
|
static const uint8_t availableAeModes[] = {
|
||||||
ANDROID_CONTROL_AE_OFF,
|
ANDROID_CONTROL_AE_MODE_OFF,
|
||||||
ANDROID_CONTROL_AE_ON
|
ANDROID_CONTROL_AE_MODE_ON
|
||||||
};
|
};
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AE_AVAILABLE_MODES,
|
ADD_OR_SIZE(ANDROID_CONTROL_AE_AVAILABLE_MODES,
|
||||||
availableAeModes, sizeof(availableAeModes));
|
availableAeModes, sizeof(availableAeModes));
|
||||||
@@ -2266,11 +2266,11 @@ status_t EmulatedFakeCamera2::constructStaticInfo(
|
|||||||
static const camera_metadata_rational exposureCompensationStep = {
|
static const camera_metadata_rational exposureCompensationStep = {
|
||||||
1, 3
|
1, 3
|
||||||
};
|
};
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AE_EXP_COMPENSATION_STEP,
|
ADD_OR_SIZE(ANDROID_CONTROL_AE_COMPENSATION_STEP,
|
||||||
&exposureCompensationStep, 1);
|
&exposureCompensationStep, 1);
|
||||||
|
|
||||||
int32_t exposureCompensationRange[] = {-9, 9};
|
int32_t exposureCompensationRange[] = {-9, 9};
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AE_EXP_COMPENSATION_RANGE,
|
ADD_OR_SIZE(ANDROID_CONTROL_AE_COMPENSATION_RANGE,
|
||||||
exposureCompensationRange,
|
exposureCompensationRange,
|
||||||
sizeof(exposureCompensationRange)/sizeof(int32_t));
|
sizeof(exposureCompensationRange)/sizeof(int32_t));
|
||||||
|
|
||||||
@@ -2282,33 +2282,33 @@ status_t EmulatedFakeCamera2::constructStaticInfo(
|
|||||||
sizeof(availableTargetFpsRanges)/sizeof(int32_t));
|
sizeof(availableTargetFpsRanges)/sizeof(int32_t));
|
||||||
|
|
||||||
static const uint8_t availableAntibandingModes[] = {
|
static const uint8_t availableAntibandingModes[] = {
|
||||||
ANDROID_CONTROL_AE_ANTIBANDING_OFF,
|
ANDROID_CONTROL_AE_ANTIBANDING_MODE_OFF,
|
||||||
ANDROID_CONTROL_AE_ANTIBANDING_AUTO
|
ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO
|
||||||
};
|
};
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES,
|
ADD_OR_SIZE(ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES,
|
||||||
availableAntibandingModes, sizeof(availableAntibandingModes));
|
availableAntibandingModes, sizeof(availableAntibandingModes));
|
||||||
|
|
||||||
static const uint8_t availableAwbModes[] = {
|
static const uint8_t availableAwbModes[] = {
|
||||||
ANDROID_CONTROL_AWB_OFF,
|
ANDROID_CONTROL_AWB_MODE_OFF,
|
||||||
ANDROID_CONTROL_AWB_AUTO,
|
ANDROID_CONTROL_AWB_MODE_AUTO,
|
||||||
ANDROID_CONTROL_AWB_INCANDESCENT,
|
ANDROID_CONTROL_AWB_MODE_INCANDESCENT,
|
||||||
ANDROID_CONTROL_AWB_FLUORESCENT,
|
ANDROID_CONTROL_AWB_MODE_FLUORESCENT,
|
||||||
ANDROID_CONTROL_AWB_DAYLIGHT,
|
ANDROID_CONTROL_AWB_MODE_DAYLIGHT,
|
||||||
ANDROID_CONTROL_AWB_SHADE
|
ANDROID_CONTROL_AWB_MODE_SHADE
|
||||||
};
|
};
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AWB_AVAILABLE_MODES,
|
ADD_OR_SIZE(ANDROID_CONTROL_AWB_AVAILABLE_MODES,
|
||||||
availableAwbModes, sizeof(availableAwbModes));
|
availableAwbModes, sizeof(availableAwbModes));
|
||||||
|
|
||||||
static const uint8_t availableAfModesBack[] = {
|
static const uint8_t availableAfModesBack[] = {
|
||||||
ANDROID_CONTROL_AF_OFF,
|
ANDROID_CONTROL_AF_MODE_OFF,
|
||||||
ANDROID_CONTROL_AF_AUTO,
|
ANDROID_CONTROL_AF_MODE_AUTO,
|
||||||
ANDROID_CONTROL_AF_MACRO,
|
ANDROID_CONTROL_AF_MODE_MACRO,
|
||||||
ANDROID_CONTROL_AF_CONTINUOUS_VIDEO,
|
ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO,
|
||||||
ANDROID_CONTROL_AF_CONTINUOUS_PICTURE
|
ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint8_t availableAfModesFront[] = {
|
static const uint8_t availableAfModesFront[] = {
|
||||||
ANDROID_CONTROL_AF_OFF
|
ANDROID_CONTROL_AF_MODE_OFF
|
||||||
};
|
};
|
||||||
|
|
||||||
if (mFacingBack) {
|
if (mFacingBack) {
|
||||||
@@ -2320,7 +2320,7 @@ status_t EmulatedFakeCamera2::constructStaticInfo(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const uint8_t availableVstabModes[] = {
|
static const uint8_t availableVstabModes[] = {
|
||||||
ANDROID_CONTROL_VIDEO_STABILIZATION_OFF
|
ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF
|
||||||
};
|
};
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES,
|
ADD_OR_SIZE(ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES,
|
||||||
availableVstabModes, sizeof(availableVstabModes));
|
availableVstabModes, sizeof(availableVstabModes));
|
||||||
@@ -2360,7 +2360,7 @@ status_t EmulatedFakeCamera2::constructDefaultRequest(
|
|||||||
static const uint8_t requestType = ANDROID_REQUEST_TYPE_CAPTURE;
|
static const uint8_t requestType = ANDROID_REQUEST_TYPE_CAPTURE;
|
||||||
ADD_OR_SIZE(ANDROID_REQUEST_TYPE, &requestType, 1);
|
ADD_OR_SIZE(ANDROID_REQUEST_TYPE, &requestType, 1);
|
||||||
|
|
||||||
static const uint8_t metadataMode = ANDROID_REQUEST_METADATA_FULL;
|
static const uint8_t metadataMode = ANDROID_REQUEST_METADATA_MODE_FULL;
|
||||||
ADD_OR_SIZE(ANDROID_REQUEST_METADATA_MODE, &metadataMode, 1);
|
ADD_OR_SIZE(ANDROID_REQUEST_METADATA_MODE, &metadataMode, 1);
|
||||||
|
|
||||||
static const int32_t id = 0;
|
static const int32_t id = 0;
|
||||||
@@ -2388,7 +2388,7 @@ status_t EmulatedFakeCamera2::constructDefaultRequest(
|
|||||||
ADD_OR_SIZE(ANDROID_LENS_FILTER_DENSITY, &filterDensity, 1);
|
ADD_OR_SIZE(ANDROID_LENS_FILTER_DENSITY, &filterDensity, 1);
|
||||||
|
|
||||||
static const uint8_t opticalStabilizationMode =
|
static const uint8_t opticalStabilizationMode =
|
||||||
ANDROID_LENS_OPTICAL_STABILIZATION_OFF;
|
ANDROID_LENS_OPTICAL_STABILIZATION_MODE_OFF;
|
||||||
ADD_OR_SIZE(ANDROID_LENS_OPTICAL_STABILIZATION_MODE,
|
ADD_OR_SIZE(ANDROID_LENS_OPTICAL_STABILIZATION_MODE,
|
||||||
&opticalStabilizationMode, 1);
|
&opticalStabilizationMode, 1);
|
||||||
|
|
||||||
@@ -2409,7 +2409,7 @@ status_t EmulatedFakeCamera2::constructDefaultRequest(
|
|||||||
|
|
||||||
/** android.flash */
|
/** android.flash */
|
||||||
|
|
||||||
static const uint8_t flashMode = ANDROID_FLASH_OFF;
|
static const uint8_t flashMode = ANDROID_FLASH_MODE_OFF;
|
||||||
ADD_OR_SIZE(ANDROID_FLASH_MODE, &flashMode, 1);
|
ADD_OR_SIZE(ANDROID_FLASH_MODE, &flashMode, 1);
|
||||||
|
|
||||||
static const uint8_t flashPower = 10;
|
static const uint8_t flashPower = 10;
|
||||||
@@ -2428,79 +2428,47 @@ status_t EmulatedFakeCamera2::constructDefaultRequest(
|
|||||||
uint8_t tonemapMode = 0;
|
uint8_t tonemapMode = 0;
|
||||||
uint8_t edgeMode = 0;
|
uint8_t edgeMode = 0;
|
||||||
switch (request_template) {
|
switch (request_template) {
|
||||||
case CAMERA2_TEMPLATE_PREVIEW:
|
|
||||||
hotPixelMode = ANDROID_PROCESSING_FAST;
|
|
||||||
demosaicMode = ANDROID_PROCESSING_FAST;
|
|
||||||
noiseMode = ANDROID_PROCESSING_FAST;
|
|
||||||
shadingMode = ANDROID_PROCESSING_FAST;
|
|
||||||
geometricMode = ANDROID_PROCESSING_FAST;
|
|
||||||
colorMode = ANDROID_PROCESSING_FAST;
|
|
||||||
tonemapMode = ANDROID_PROCESSING_FAST;
|
|
||||||
edgeMode = ANDROID_PROCESSING_FAST;
|
|
||||||
break;
|
|
||||||
case CAMERA2_TEMPLATE_STILL_CAPTURE:
|
case CAMERA2_TEMPLATE_STILL_CAPTURE:
|
||||||
hotPixelMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
// fall-through
|
||||||
demosaicMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
noiseMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
shadingMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
geometricMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
colorMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
tonemapMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
edgeMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
break;
|
|
||||||
case CAMERA2_TEMPLATE_VIDEO_RECORD:
|
|
||||||
hotPixelMode = ANDROID_PROCESSING_FAST;
|
|
||||||
demosaicMode = ANDROID_PROCESSING_FAST;
|
|
||||||
noiseMode = ANDROID_PROCESSING_FAST;
|
|
||||||
shadingMode = ANDROID_PROCESSING_FAST;
|
|
||||||
geometricMode = ANDROID_PROCESSING_FAST;
|
|
||||||
colorMode = ANDROID_PROCESSING_FAST;
|
|
||||||
tonemapMode = ANDROID_PROCESSING_FAST;
|
|
||||||
edgeMode = ANDROID_PROCESSING_FAST;
|
|
||||||
break;
|
|
||||||
case CAMERA2_TEMPLATE_VIDEO_SNAPSHOT:
|
case CAMERA2_TEMPLATE_VIDEO_SNAPSHOT:
|
||||||
hotPixelMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
// fall-through
|
||||||
demosaicMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
noiseMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
shadingMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
geometricMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
colorMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
tonemapMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
edgeMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
|
||||||
break;
|
|
||||||
case CAMERA2_TEMPLATE_ZERO_SHUTTER_LAG:
|
case CAMERA2_TEMPLATE_ZERO_SHUTTER_LAG:
|
||||||
hotPixelMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
hotPixelMode = ANDROID_HOT_PIXEL_MODE_HIGH_QUALITY;
|
||||||
demosaicMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
demosaicMode = ANDROID_DEMOSAIC_MODE_HIGH_QUALITY;
|
||||||
noiseMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
noiseMode = ANDROID_NOISE_REDUCTION_MODE_HIGH_QUALITY;
|
||||||
shadingMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
shadingMode = ANDROID_SHADING_MODE_HIGH_QUALITY;
|
||||||
geometricMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
geometricMode = ANDROID_GEOMETRIC_MODE_HIGH_QUALITY;
|
||||||
colorMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
colorMode = ANDROID_COLOR_CORRECTION_MODE_HIGH_QUALITY;
|
||||||
tonemapMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
tonemapMode = ANDROID_TONEMAP_MODE_HIGH_QUALITY;
|
||||||
edgeMode = ANDROID_PROCESSING_HIGH_QUALITY;
|
edgeMode = ANDROID_EDGE_MODE_HIGH_QUALITY;
|
||||||
break;
|
break;
|
||||||
|
case CAMERA2_TEMPLATE_PREVIEW:
|
||||||
|
// fall-through
|
||||||
|
case CAMERA2_TEMPLATE_VIDEO_RECORD:
|
||||||
|
// fall-through
|
||||||
default:
|
default:
|
||||||
hotPixelMode = ANDROID_PROCESSING_FAST;
|
hotPixelMode = ANDROID_HOT_PIXEL_MODE_FAST;
|
||||||
demosaicMode = ANDROID_PROCESSING_FAST;
|
demosaicMode = ANDROID_DEMOSAIC_MODE_FAST;
|
||||||
noiseMode = ANDROID_PROCESSING_FAST;
|
noiseMode = ANDROID_NOISE_REDUCTION_MODE_FAST;
|
||||||
shadingMode = ANDROID_PROCESSING_FAST;
|
shadingMode = ANDROID_SHADING_MODE_FAST;
|
||||||
geometricMode = ANDROID_PROCESSING_FAST;
|
geometricMode = ANDROID_GEOMETRIC_MODE_FAST;
|
||||||
colorMode = ANDROID_PROCESSING_FAST;
|
colorMode = ANDROID_COLOR_CORRECTION_MODE_FAST;
|
||||||
tonemapMode = ANDROID_PROCESSING_FAST;
|
tonemapMode = ANDROID_TONEMAP_MODE_FAST;
|
||||||
edgeMode = ANDROID_PROCESSING_FAST;
|
edgeMode = ANDROID_EDGE_MODE_FAST;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ADD_OR_SIZE(ANDROID_HOT_PIXEL_MODE, &hotPixelMode, 1);
|
ADD_OR_SIZE(ANDROID_HOT_PIXEL_MODE, &hotPixelMode, 1);
|
||||||
ADD_OR_SIZE(ANDROID_DEMOSAIC_MODE, &demosaicMode, 1);
|
ADD_OR_SIZE(ANDROID_DEMOSAIC_MODE, &demosaicMode, 1);
|
||||||
ADD_OR_SIZE(ANDROID_NOISE_MODE, &noiseMode, 1);
|
ADD_OR_SIZE(ANDROID_NOISE_REDUCTION_MODE, &noiseMode, 1);
|
||||||
ADD_OR_SIZE(ANDROID_SHADING_MODE, &shadingMode, 1);
|
ADD_OR_SIZE(ANDROID_SHADING_MODE, &shadingMode, 1);
|
||||||
ADD_OR_SIZE(ANDROID_GEOMETRIC_MODE, &geometricMode, 1);
|
ADD_OR_SIZE(ANDROID_GEOMETRIC_MODE, &geometricMode, 1);
|
||||||
ADD_OR_SIZE(ANDROID_COLOR_MODE, &colorMode, 1);
|
ADD_OR_SIZE(ANDROID_COLOR_CORRECTION_MODE, &colorMode, 1);
|
||||||
ADD_OR_SIZE(ANDROID_TONEMAP_MODE, &tonemapMode, 1);
|
ADD_OR_SIZE(ANDROID_TONEMAP_MODE, &tonemapMode, 1);
|
||||||
ADD_OR_SIZE(ANDROID_EDGE_MODE, &edgeMode, 1);
|
ADD_OR_SIZE(ANDROID_EDGE_MODE, &edgeMode, 1);
|
||||||
|
|
||||||
/** android.noise */
|
/** android.noise */
|
||||||
static const uint8_t noiseStrength = 5;
|
static const uint8_t noiseStrength = 5;
|
||||||
ADD_OR_SIZE(ANDROID_NOISE_STRENGTH, &noiseStrength, 1);
|
ADD_OR_SIZE(ANDROID_NOISE_REDUCTION_STRENGTH, &noiseStrength, 1);
|
||||||
|
|
||||||
/** android.color */
|
/** android.color */
|
||||||
static const float colorTransform[9] = {
|
static const float colorTransform[9] = {
|
||||||
@@ -2508,7 +2476,7 @@ status_t EmulatedFakeCamera2::constructDefaultRequest(
|
|||||||
0.f, 1.f, 0.f,
|
0.f, 1.f, 0.f,
|
||||||
0.f, 0.f, 1.f
|
0.f, 0.f, 1.f
|
||||||
};
|
};
|
||||||
ADD_OR_SIZE(ANDROID_COLOR_TRANSFORM, colorTransform, 9);
|
ADD_OR_SIZE(ANDROID_COLOR_CORRECTION_TRANSFORM, colorTransform, 9);
|
||||||
|
|
||||||
/** android.tonemap */
|
/** android.tonemap */
|
||||||
static const float tonemapCurve[4] = {
|
static const float tonemapCurve[4] = {
|
||||||
@@ -2557,14 +2525,16 @@ status_t EmulatedFakeCamera2::constructDefaultRequest(
|
|||||||
|
|
||||||
/** android.stats */
|
/** android.stats */
|
||||||
|
|
||||||
static const uint8_t faceDetectMode = ANDROID_STATS_FACE_DETECTION_OFF;
|
static const uint8_t faceDetectMode =
|
||||||
ADD_OR_SIZE(ANDROID_STATS_FACE_DETECT_MODE, &faceDetectMode, 1);
|
ANDROID_STATISTICS_FACE_DETECT_MODE_OFF;
|
||||||
|
ADD_OR_SIZE(ANDROID_STATISTICS_FACE_DETECT_MODE, &faceDetectMode, 1);
|
||||||
|
|
||||||
static const uint8_t histogramMode = ANDROID_STATS_OFF;
|
static const uint8_t histogramMode = ANDROID_STATISTICS_HISTOGRAM_MODE_OFF;
|
||||||
ADD_OR_SIZE(ANDROID_STATS_HISTOGRAM_MODE, &histogramMode, 1);
|
ADD_OR_SIZE(ANDROID_STATISTICS_HISTOGRAM_MODE, &histogramMode, 1);
|
||||||
|
|
||||||
static const uint8_t sharpnessMapMode = ANDROID_STATS_OFF;
|
static const uint8_t sharpnessMapMode =
|
||||||
ADD_OR_SIZE(ANDROID_STATS_SHARPNESS_MAP_MODE, &sharpnessMapMode, 1);
|
ANDROID_STATISTICS_SHARPNESS_MAP_MODE_OFF;
|
||||||
|
ADD_OR_SIZE(ANDROID_STATISTICS_SHARPNESS_MAP_MODE, &sharpnessMapMode, 1);
|
||||||
|
|
||||||
// faceRectangles, faceScores, faceLandmarks, faceIds, histogram,
|
// faceRectangles, faceScores, faceLandmarks, faceIds, histogram,
|
||||||
// sharpnessMap only in frames
|
// sharpnessMap only in frames
|
||||||
@@ -2574,36 +2544,36 @@ status_t EmulatedFakeCamera2::constructDefaultRequest(
|
|||||||
uint8_t controlIntent = 0;
|
uint8_t controlIntent = 0;
|
||||||
switch (request_template) {
|
switch (request_template) {
|
||||||
case CAMERA2_TEMPLATE_PREVIEW:
|
case CAMERA2_TEMPLATE_PREVIEW:
|
||||||
controlIntent = ANDROID_CONTROL_INTENT_PREVIEW;
|
controlIntent = ANDROID_CONTROL_CAPTURE_INTENT_PREVIEW;
|
||||||
break;
|
break;
|
||||||
case CAMERA2_TEMPLATE_STILL_CAPTURE:
|
case CAMERA2_TEMPLATE_STILL_CAPTURE:
|
||||||
controlIntent = ANDROID_CONTROL_INTENT_STILL_CAPTURE;
|
controlIntent = ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE;
|
||||||
break;
|
break;
|
||||||
case CAMERA2_TEMPLATE_VIDEO_RECORD:
|
case CAMERA2_TEMPLATE_VIDEO_RECORD:
|
||||||
controlIntent = ANDROID_CONTROL_INTENT_VIDEO_RECORD;
|
controlIntent = ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD;
|
||||||
break;
|
break;
|
||||||
case CAMERA2_TEMPLATE_VIDEO_SNAPSHOT:
|
case CAMERA2_TEMPLATE_VIDEO_SNAPSHOT:
|
||||||
controlIntent = ANDROID_CONTROL_INTENT_VIDEO_SNAPSHOT;
|
controlIntent = ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT;
|
||||||
break;
|
break;
|
||||||
case CAMERA2_TEMPLATE_ZERO_SHUTTER_LAG:
|
case CAMERA2_TEMPLATE_ZERO_SHUTTER_LAG:
|
||||||
controlIntent = ANDROID_CONTROL_INTENT_ZERO_SHUTTER_LAG;
|
controlIntent = ANDROID_CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
controlIntent = ANDROID_CONTROL_INTENT_CUSTOM;
|
controlIntent = ANDROID_CONTROL_CAPTURE_INTENT_CUSTOM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_CAPTURE_INTENT, &controlIntent, 1);
|
ADD_OR_SIZE(ANDROID_CONTROL_CAPTURE_INTENT, &controlIntent, 1);
|
||||||
|
|
||||||
static const uint8_t controlMode = ANDROID_CONTROL_AUTO;
|
static const uint8_t controlMode = ANDROID_CONTROL_MODE_AUTO;
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_MODE, &controlMode, 1);
|
ADD_OR_SIZE(ANDROID_CONTROL_MODE, &controlMode, 1);
|
||||||
|
|
||||||
static const uint8_t effectMode = ANDROID_CONTROL_EFFECT_OFF;
|
static const uint8_t effectMode = ANDROID_CONTROL_EFFECT_MODE_OFF;
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_EFFECT_MODE, &effectMode, 1);
|
ADD_OR_SIZE(ANDROID_CONTROL_EFFECT_MODE, &effectMode, 1);
|
||||||
|
|
||||||
static const uint8_t sceneMode = ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY;
|
static const uint8_t sceneMode = ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY;
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_SCENE_MODE, &sceneMode, 1);
|
ADD_OR_SIZE(ANDROID_CONTROL_SCENE_MODE, &sceneMode, 1);
|
||||||
|
|
||||||
static const uint8_t aeMode = ANDROID_CONTROL_AE_ON_AUTO_FLASH;
|
static const uint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH;
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AE_MODE, &aeMode, 1);
|
ADD_OR_SIZE(ANDROID_CONTROL_AE_MODE, &aeMode, 1);
|
||||||
|
|
||||||
static const uint8_t aeLock = ANDROID_CONTROL_AE_LOCK_OFF;
|
static const uint8_t aeLock = ANDROID_CONTROL_AE_LOCK_OFF;
|
||||||
@@ -2615,7 +2585,7 @@ status_t EmulatedFakeCamera2::constructDefaultRequest(
|
|||||||
ADD_OR_SIZE(ANDROID_CONTROL_AE_REGIONS, controlRegions, 5);
|
ADD_OR_SIZE(ANDROID_CONTROL_AE_REGIONS, controlRegions, 5);
|
||||||
|
|
||||||
static const int32_t aeExpCompensation = 0;
|
static const int32_t aeExpCompensation = 0;
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AE_EXP_COMPENSATION, &aeExpCompensation, 1);
|
ADD_OR_SIZE(ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, &aeExpCompensation, 1);
|
||||||
|
|
||||||
static const int32_t aeTargetFpsRange[2] = {
|
static const int32_t aeTargetFpsRange[2] = {
|
||||||
10, 30
|
10, 30
|
||||||
@@ -2623,11 +2593,11 @@ status_t EmulatedFakeCamera2::constructDefaultRequest(
|
|||||||
ADD_OR_SIZE(ANDROID_CONTROL_AE_TARGET_FPS_RANGE, aeTargetFpsRange, 2);
|
ADD_OR_SIZE(ANDROID_CONTROL_AE_TARGET_FPS_RANGE, aeTargetFpsRange, 2);
|
||||||
|
|
||||||
static const uint8_t aeAntibandingMode =
|
static const uint8_t aeAntibandingMode =
|
||||||
ANDROID_CONTROL_AE_ANTIBANDING_AUTO;
|
ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO;
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AE_ANTIBANDING_MODE, &aeAntibandingMode, 1);
|
ADD_OR_SIZE(ANDROID_CONTROL_AE_ANTIBANDING_MODE, &aeAntibandingMode, 1);
|
||||||
|
|
||||||
static const uint8_t awbMode =
|
static const uint8_t awbMode =
|
||||||
ANDROID_CONTROL_AWB_AUTO;
|
ANDROID_CONTROL_AWB_MODE_AUTO;
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AWB_MODE, &awbMode, 1);
|
ADD_OR_SIZE(ANDROID_CONTROL_AWB_MODE, &awbMode, 1);
|
||||||
|
|
||||||
static const uint8_t awbLock = ANDROID_CONTROL_AWB_LOCK_OFF;
|
static const uint8_t awbLock = ANDROID_CONTROL_AWB_LOCK_OFF;
|
||||||
@@ -2638,29 +2608,30 @@ status_t EmulatedFakeCamera2::constructDefaultRequest(
|
|||||||
uint8_t afMode = 0;
|
uint8_t afMode = 0;
|
||||||
switch (request_template) {
|
switch (request_template) {
|
||||||
case CAMERA2_TEMPLATE_PREVIEW:
|
case CAMERA2_TEMPLATE_PREVIEW:
|
||||||
afMode = ANDROID_CONTROL_AF_AUTO;
|
afMode = ANDROID_CONTROL_AF_MODE_AUTO;
|
||||||
break;
|
break;
|
||||||
case CAMERA2_TEMPLATE_STILL_CAPTURE:
|
case CAMERA2_TEMPLATE_STILL_CAPTURE:
|
||||||
afMode = ANDROID_CONTROL_AF_AUTO;
|
afMode = ANDROID_CONTROL_AF_MODE_AUTO;
|
||||||
break;
|
break;
|
||||||
case CAMERA2_TEMPLATE_VIDEO_RECORD:
|
case CAMERA2_TEMPLATE_VIDEO_RECORD:
|
||||||
afMode = ANDROID_CONTROL_AF_CONTINUOUS_VIDEO;
|
afMode = ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO;
|
||||||
break;
|
break;
|
||||||
case CAMERA2_TEMPLATE_VIDEO_SNAPSHOT:
|
case CAMERA2_TEMPLATE_VIDEO_SNAPSHOT:
|
||||||
afMode = ANDROID_CONTROL_AF_CONTINUOUS_VIDEO;
|
afMode = ANDROID_CONTROL_AF_MODE_CONTINUOUS_VIDEO;
|
||||||
break;
|
break;
|
||||||
case CAMERA2_TEMPLATE_ZERO_SHUTTER_LAG:
|
case CAMERA2_TEMPLATE_ZERO_SHUTTER_LAG:
|
||||||
afMode = ANDROID_CONTROL_AF_CONTINUOUS_PICTURE;
|
afMode = ANDROID_CONTROL_AF_MODE_CONTINUOUS_PICTURE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
afMode = ANDROID_CONTROL_AF_AUTO;
|
afMode = ANDROID_CONTROL_AF_MODE_AUTO;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AF_MODE, &afMode, 1);
|
ADD_OR_SIZE(ANDROID_CONTROL_AF_MODE, &afMode, 1);
|
||||||
|
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_AF_REGIONS, controlRegions, 5);
|
ADD_OR_SIZE(ANDROID_CONTROL_AF_REGIONS, controlRegions, 5);
|
||||||
|
|
||||||
static const uint8_t vstabMode = ANDROID_CONTROL_VIDEO_STABILIZATION_OFF;
|
static const uint8_t vstabMode =
|
||||||
|
ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_OFF;
|
||||||
ADD_OR_SIZE(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, &vstabMode, 1);
|
ADD_OR_SIZE(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, &vstabMode, 1);
|
||||||
|
|
||||||
// aeState, awbState, afState only in frame
|
// aeState, awbState, afState only in frame
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ const nsecs_t Sensor::kFrameDurationRange[2] =
|
|||||||
{33331760L, 30000000000L}; // ~1/30 s - 30 sec
|
{33331760L, 30000000000L}; // ~1/30 s - 30 sec
|
||||||
const nsecs_t Sensor::kMinVerticalBlank = 10000L;
|
const nsecs_t Sensor::kMinVerticalBlank = 10000L;
|
||||||
|
|
||||||
const uint8_t Sensor::kColorFilterArrangement = ANDROID_SENSOR_RGGB;
|
const uint8_t Sensor::kColorFilterArrangement =
|
||||||
|
ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB;
|
||||||
|
|
||||||
// Output image data characteristics
|
// Output image data characteristics
|
||||||
const uint32_t Sensor::kMaxRawValue = 4000;
|
const uint32_t Sensor::kMaxRawValue = 4000;
|
||||||
|
|||||||
Reference in New Issue
Block a user