[libcamera-devel] [PATCH 6/7] android: camera_device: Report sensor test pattern mode
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Thu Feb 4 23:12:31 CET 2021
Hi Jacopo,
Thank you for the patch.
On Wed, Feb 03, 2021 at 05:25:59PM +0100, Jacopo Mondi wrote:
> 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.
>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> src/android/camera_device.cpp | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index fdda43e9b4af..2b065d57febb 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -708,7 +708,7 @@ std::tuple<uint32_t, uint32_t> CameraDevice::calculateStaticMetadataSize()
> * Currently: 53 entries, 846 bytes of static metadata
> */
> uint32_t numEntries = 53;
> - uint32_t byteSize = 854;
> + uint32_t byteSize = 858;
>
> /*
> * Calculate space occupation in bytes for dynamically built metadata
> @@ -1281,6 +1281,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
> ANDROID_SCALER_CROP_REGION,
> ANDROID_SENSOR_EXPOSURE_TIME,
> ANDROID_SENSOR_ROLLING_SHUTTER_SKEW,
> + ANDROID_SENSOR_TEST_PATTERN_MODE,
> ANDROID_SENSOR_TIMESTAMP,
> ANDROID_STATISTICS_FACE_DETECT_MODE,
> ANDROID_STATISTICS_LENS_SHADING_MAP_MODE,
> @@ -1965,7 +1966,7 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,
> * Total bytes for JPEG metadata: 82
> */
> std::unique_ptr<CameraMetadata> resultMetadata =
> - std::make_unique<CameraMetadata>(42, 161);
> + std::make_unique<CameraMetadata>(43, 165);
> if (!resultMetadata->isValid()) {
> LOG(HAL, Error) << "Failed to allocate static metadata";
> return nullptr;
> @@ -2058,6 +2059,10 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,
> resultMetadata->addEntry(ANDROID_LENS_OPTICAL_STABILIZATION_MODE,
> &value, 1);
>
> + value32 = ANDROID_SENSOR_TEST_PATTERN_MODE_OFF;
> + resultMetadata->addEntry(ANDROID_SENSOR_TEST_PATTERN_MODE,
> + &value32, 1);
> +
> resultMetadata->addEntry(ANDROID_SENSOR_TIMESTAMP, ×tamp, 1);
>
> value = ANDROID_STATISTICS_FACE_DETECT_MODE_OFF;
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list