@@ -662,15 +662,17 @@ int CameraCapabilities::initializeStaticMetadata()
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,
- };
- staticMetadata_->addEntry(ANDROID_CONTROL_AWB_AVAILABLE_MODES,
- availableAwbModes);
+ std::vector<uint8_t> awbModes = setMetadata<uint8_t, int32_t>(
+ staticMetadata_.get(),
+ ANDROID_CONTROL_AWB_AVAILABLE_MODES,
+ controlsInfo, &controls::AwbMode,
+ std::vector<uint8_t>({ ANDROID_CONTROL_AWB_MODE_AUTO }));
+ if (std::find(awbModes.begin(), awbModes.end(),
+ ANDROID_CONTROL_AWB_MODE_OFF) == awbModes.end()) {
+ LOG(HAL, Info) << "AWB cannot be turned off";
+ hwLevels.erase(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL);
+ capabilities.erase(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING);
+ }
std::vector<int32_t> availableMaxRegions = {
0, 0, 0,
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@ideasonboard.com> --- Changes in v3: - use new setMetadata - rebase on camera capabilities refactor TODO: plumb result metadata --- src/android/camera_capabilities.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)