[libcamera-devel] [RFC PATCH 08/14] android: Plumb AwbMode control
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Mon Jun 28 03:42:27 CEST 2021
Hi Paul,
Thank you for the patch.
On Fri, Jun 18, 2021 at 07:33:45PM +0900, Paul Elder wrote:
> Plumb the AwbMode control into the HAL for
> CONTROL_AWB_AVAILABLE_MODES for static metadata.
>
> Bug: https://bugs.libcamera.org/show_bug.cgi?id=44
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
>
> ---
> TODO: plumb result metadata
Same comment as for 07/14.
> ---
> src/android/camera_device.cpp | 26 ++++++++++++++++++--------
> 1 file changed, 18 insertions(+), 8 deletions(-)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index 3add5bc6..a8b6fa38 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -985,15 +985,25 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
> staticMetadata_->addEntry(ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES,
> availableStabilizationModes);
>
> - /*
> - * \todo Inspect the Camera capabilities to report the available
> - * AWB modes. Default to AUTO as CTS tests require it.
> - */
> - std::vector<uint8_t> availableAwbModes = {
> - ANDROID_CONTROL_AWB_MODE_AUTO,
> - };
> + std::vector<uint8_t> awbAvailableModes;
> + awbAvailableModes.reserve(2);
> + const auto &awbModesInfo = controlsInfo.find(&controls::AwbMode);
> + if (awbModesInfo != controlsInfo.end()) {
> + for (const auto &value : awbModesInfo->second.values())
> + awbAvailableModes.push_back(value.get<int32_t>());
> + } else {
> + awbAvailableModes.push_back(ANDROID_CONTROL_AWB_MODE_AUTO);
> + }
> +
> + if (std::find(awbAvailableModes.begin(),
> + awbAvailableModes.end(),
> + ANDROID_CONTROL_AWB_MODE_OFF) == awbAvailableModes.end()) {
> + fullSupport = false;
> + /* \todo Double check if this is the correct capability */
> + capabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING] = false;
It's not explicitly mentioned in the documentation, but the manual
post-processing capability requires supporting
android.colorCorrection.gains, which is only taken into account when AWB
is OFF, so this makes sense.
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> + }
> staticMetadata_->addEntry(ANDROID_CONTROL_AWB_AVAILABLE_MODES,
> - availableAwbModes);
> + awbAvailableModes);
>
> std::vector<int32_t> availableMaxRegions = {
> 0, 0, 0,
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list