Skip to content

Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.

C

Camera: give the FigCaptureStream format its full-sensor crop geometry

vcvkk289db4d9e0a6
diff --git a/userland/src/camera_device.c b/userland/src/camera_device.c
index ca0596a..33201f5 100644
--- a/userland/src/camera_device.c
+++ b/userland/src/camera_device.c
@@ -328,6 +328,21 @@ format(int sensor_width, int sensor_height, int max_fps, bool binned)
put(f, "SensorHeight", number_i(sensor_height));
put(f, "ISOBase", number_f(32));
put(f, "DefaultAEMaxGain", number_f(64));
+
+ /*
+ * The sensor crop geometry the capture-graph builder reads off this format to resolve non-zero
+ * output dimensions (confirmed by a hook: -[FigCaptureSourceVideoFormat sensorCropDimensions] /
+ * postGDCCropDimensions] return these). Everything spans the full sensor: no GDC crop.
+ */
+ put(f, "SensorCropWidth", number_i(sensor_width));
+ put(f, "SensorCropHeight", number_i(sensor_height));
+ put(f, "PreGDCSensorCropWidth", number_i(sensor_width));
+ put(f, "PreGDCSensorCropHeight", number_i(sensor_height));
+ put(f, "PostGDCCropWidth", number_i(sensor_width));
+ put(f, "PostGDCCropHeight", number_i(sensor_height));
+ put(f, "GeometricDistortionCorrectedNativeWidth", number_i(sensor_width));
+ put(f, "GeometricDistortionCorrectedNativeHeight", number_i(sensor_height));
+
put(outputs, "PrimaryScaler", output_info(sensor_width, sensor_height));
put(outputs, "SecondaryScaler", output_info(sensor_width, sensor_height));
put(outputs, "StillImage", output_info(sensor_width, sensor_height));