Camera: Fix green JPEGs
Need crop regions to be 4 entries on the input and the output; otherwise
the sanity checks when doing reprocessing will reject the HAL's own output.
Bug: 8947463
Change-Id: I0be0ac816cb65c802c3a5ae56af732edf9145edc
diff --git a/libcamera2/MetadataConverter.cpp b/libcamera2/MetadataConverter.cpp
index 4ae1e73..386c62a 100644
--- a/libcamera2/MetadataConverter.cpp
+++ b/libcamera2/MetadataConverter.cpp
@@ -621,9 +621,15 @@
&metadata->dm.aa.isoValue, 1))
return NO_MEMORY;
-
+ // Need a four-entry crop region
+ uint32_t cropRegion[4] = {
+ metadata->ctl.scaler.cropRegion[0],
+ metadata->ctl.scaler.cropRegion[1],
+ metadata->ctl.scaler.cropRegion[2],
+ 0
+ };
if (0 != add_camera_metadata_entry(dst, ANDROID_SCALER_CROP_REGION,
- &metadata->ctl.scaler.cropRegion, 3))
+ cropRegion, 4))
return NO_MEMORY;
byteData = metadata->dm.aa.aeState - 1;