android: camera_device: Report sensor test pattern mode

The CaptureResultTest#testCameraCaptureResultAllKeys enforces the
presence of the ANDROID_SENSOR_TEST_PATTERN_MODE result metadata.

Report the only supported value of ANDROID_SENSOR_TEST_PATTERN_MODE_OFF.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi 2021-02-03 16:43:22 +01:00
parent d77233be82
commit 5360d807b4

View file

@ -705,10 +705,10 @@ std::tuple<uint32_t, uint32_t> CameraDevice::calculateStaticMetadataSize()
{ {
/* /*
* \todo Keep this in sync with the actual number of entries. * \todo Keep this in sync with the actual number of entries.
* Currently: 53 entries, 846 bytes of static metadata * Currently: 53 entries, 850 bytes of static metadata
*/ */
uint32_t numEntries = 53; uint32_t numEntries = 53;
uint32_t byteSize = 846; uint32_t byteSize = 850;
/* /*
* Calculate space occupation in bytes for dynamically built metadata * Calculate space occupation in bytes for dynamically built metadata
@ -1326,6 +1326,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
ANDROID_SCALER_CROP_REGION, ANDROID_SCALER_CROP_REGION,
ANDROID_SENSOR_EXPOSURE_TIME, ANDROID_SENSOR_EXPOSURE_TIME,
ANDROID_SENSOR_ROLLING_SHUTTER_SKEW, ANDROID_SENSOR_ROLLING_SHUTTER_SKEW,
ANDROID_SENSOR_TEST_PATTERN_MODE,
ANDROID_SENSOR_TIMESTAMP, ANDROID_SENSOR_TIMESTAMP,
ANDROID_STATISTICS_FACE_DETECT_MODE, ANDROID_STATISTICS_FACE_DETECT_MODE,
ANDROID_STATISTICS_LENS_SHADING_MAP_MODE, ANDROID_STATISTICS_LENS_SHADING_MAP_MODE,
@ -2010,7 +2011,7 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,
* Total bytes for JPEG metadata: 82 * Total bytes for JPEG metadata: 82
*/ */
std::unique_ptr<CameraMetadata> resultMetadata = std::unique_ptr<CameraMetadata> resultMetadata =
std::make_unique<CameraMetadata>(42, 161); std::make_unique<CameraMetadata>(43, 165);
if (!resultMetadata->isValid()) { if (!resultMetadata->isValid()) {
LOG(HAL, Error) << "Failed to allocate static metadata"; LOG(HAL, Error) << "Failed to allocate static metadata";
return nullptr; return nullptr;
@ -2103,6 +2104,10 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,
resultMetadata->addEntry(ANDROID_LENS_OPTICAL_STABILIZATION_MODE, resultMetadata->addEntry(ANDROID_LENS_OPTICAL_STABILIZATION_MODE,
&value, 1); &value, 1);
value32 = ANDROID_SENSOR_TEST_PATTERN_MODE_OFF;
resultMetadata->addEntry(ANDROID_SENSOR_TEST_PATTERN_MODE,
&value32, 1);
resultMetadata->addEntry(ANDROID_SENSOR_TIMESTAMP, &timestamp, 1); resultMetadata->addEntry(ANDROID_SENSOR_TIMESTAMP, &timestamp, 1);
value = ANDROID_STATISTICS_FACE_DETECT_MODE_OFF; value = ANDROID_STATISTICS_FACE_DETECT_MODE_OFF;