Camera: Fix green JPEGs
authorEino-Ville Talvala <etalvala@google.com>
Fri, 17 May 2013 00:33:06 +0000 (17:33 -0700)
committerEino-Ville Talvala <etalvala@google.com>
Fri, 17 May 2013 00:33:06 +0000 (17:33 -0700)
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

libcamera2/MetadataConverter.cpp

index 4ae1e732150006906345c64f7cfd391152b922aa..386c62ab59b98b805b7260cefe68c5d1a3744cb1 100644 (file)
@@ -621,9 +621,15 @@ status_t MetadataConverter::ToDynamicMetadata(struct camera2_shot_ext * metadata
                 &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;