summaryrefslogtreecommitdiffstats
path: root/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java
diff options
context:
space:
mode:
authorSol Boucher <solb@google.com>2014-07-22 18:39:32 -0700
committerSol Boucher <solb@google.com>2014-08-07 15:02:05 -0700
commitde48004068f8c16f9a56c60b0ed2485a67687b4b (patch)
treecc584bbc1756d0f5f00367f39565288679728809 /camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java
parentd4e5286bb4145e0371b783158fc8411565429c9b (diff)
downloadandroid_frameworks_ex-de48004068f8c16f9a56c60b0ed2485a67687b4b.tar.gz
android_frameworks_ex-de48004068f8c16f9a56c60b0ed2485a67687b4b.tar.bz2
android_frameworks_ex-de48004068f8c16f9a56c60b0ed2485a67687b4b.zip
camera2-portability: Support photo capture using camera2 API
This implements JPEG capture, including an autoexposure precapture sequence. There are many changes to AndroidCamera2Capabilities and AndroidCamera2Settings to support the representation of modes (e.g. flash modes) whose flags do not map trivially between the API implementations. Part of this work is the conversion of AndroidCamera2AgentImpl to use and store a Camera2RequestSettingsSet instead of a bare API 2 CaptureRequest.Builder. Change-Id: I03f9f98c954a7b0c140ac8d80161878c92ef65d2
Diffstat (limited to 'camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java')
-rw-r--r--camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java
index 9bbbb7a..95f0320 100644
--- a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java
+++ b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraAgentImpl.java
@@ -175,7 +175,7 @@ class AndroidCameraAgentImpl extends CameraAgent {
return mFirstFrontCameraId;
}
- private static class AndroidCharacteristics implements Characteristics {
+ private static class AndroidCharacteristics extends Characteristics {
private Camera.CameraInfo mCameraInfo;
AndroidCharacteristics(Camera.CameraInfo cameraInfo) {
@@ -437,7 +437,14 @@ class AndroidCameraAgentImpl extends CameraAgent {
}
case CameraActions.SET_DISPLAY_ORIENTATION: {
- mCamera.setDisplayOrientation(msg.arg1);
+ // Update preview orientation
+ mCamera.setDisplayOrientation(
+ mCharacteristics.getPreviewOrientation(msg.arg1));
+ // Only set the JPEG capture orientation if requested to do so; otherwise,
+ // capture in the sensor's physical orientation
+ mParamsToSet.setRotation(
+ msg.arg2 > 0 ? mCharacteristics.getJpegOrientation(msg.arg1) : 0);
+ mCamera.setParameters(mParamsToSet);
break;
}
@@ -566,7 +573,6 @@ class AndroidCameraAgentImpl extends CameraAgent {
// Should use settings.getCurrentZoomRatio() instead here.
mParamsToSet.setZoom(settings.getCurrentZoomIndex());
}
- mParamsToSet.setRotation((int) settings.getCurrentPhotoRotationDegrees());
mParamsToSet.setExposureCompensation(settings.getExposureCompensationIndex());
if (mCapabilities.supports(CameraCapabilities.Feature.AUTO_EXPOSURE_LOCK)) {
mParamsToSet.setAutoExposureLock(settings.isAutoExposureLocked());