summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-06-23 11:43:04 -0700
committerSteve Kondik <steve@cyngn.com>2016-08-21 18:46:32 -0700
commit511c1ec9863438a2ed94f52349d381a2679a4414 (patch)
tree7ecab375a700e62b9aa657db8a5df4699f476846
parentec4045e8a03860fbbeb73841a9aa7e2b3a25bc11 (diff)
downloadandroid_packages_apps_Snap-511c1ec9863438a2ed94f52349d381a2679a4414.zip
android_packages_apps_Snap-511c1ec9863438a2ed94f52349d381a2679a4414.tar.gz
android_packages_apps_Snap-511c1ec9863438a2ed94f52349d381a2679a4414.tar.bz2
SnapdragonCamera: add jpeg crop parrameter support
Add support for crop data when sending JPEG encode requests. CRs-Fixed: 993611 Change-Id: Icbd960160d651a3422c2b8530608fcd5dba97735
-rw-r--r--src/com/android/camera/CaptureModule.java6
-rw-r--r--src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java10
2 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index baace39..ee4bcc7 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -162,6 +162,12 @@ public class CaptureModule implements CameraModule, PhotoController,
CaptureRequest.Key<Integer> BayerMonoLinkSessionIdKey =
new CaptureRequest.Key<>("org.codeaurora.qcamera3.dualcam_link_meta_data" +
".related_camera_id", Integer.class);
+ public static CaptureRequest.Key<Byte> JpegCropEnableKey =
+ new CaptureRequest.Key<>("org.codeaurora.qcamera3.jpeg_encode_crop.enable",
+ Byte.class);
+ public static CaptureRequest.Key<int[]> JpegCropRectKey =
+ new CaptureRequest.Key<>("org.codeaurora.qcamera3.jpeg_encode_crop.rect",
+ int[].class);
public static CameraCharacteristics.Key<Byte> MetaDataMonoOnlyKey =
new CameraCharacteristics.Key<>("org.codeaurora.qcamera3.sensor_meta_data.is_mono_only",
Byte.class);
diff --git a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
index bafbbb8..c64a0de 100644
--- a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
+++ b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
@@ -64,6 +64,7 @@ import android.os.SystemProperties;
import android.util.Log;
import android.view.Surface;
+import com.android.camera.CaptureModule;
import com.android.camera.MediaSaveService;
import com.android.camera.MediaSaveService.OnMediaSavedListener;
import com.android.camera.PhotoModule.NamedImages;
@@ -712,6 +713,15 @@ public class ClearSightImageProcessor {
reprocRequest.set(CaptureRequest.NOISE_REDUCTION_MODE,
CaptureRequest.NOISE_REDUCTION_MODE_OFF);
+ Rect cropRect = image.mImage.getCropRect();
+ if(cropRect != null &&
+ !cropRect.isEmpty()) {
+ // has crop rect. apply to jpeg request
+ reprocRequest.set(CaptureModule.JpegCropEnableKey, (byte)1);
+ reprocRequest.set(CaptureModule.JpegCropRectKey,
+ new int[] {cropRect.left, cropRect.top, cropRect.width(), cropRect.height()});
+ }
+
mImageWriter[camType].queueInputImage(image.mImage);
session.capture(reprocRequest.build(),