diff options
author | Sol Boucher <solb@google.com> | 2014-06-19 14:54:49 -0700 |
---|---|---|
committer | Sol Boucher <solb@google.com> | 2014-06-20 14:25:04 -0700 |
commit | b30d2c670f1262f0d60181e40dad33f2151fee4a (patch) | |
tree | 7d82b5cd401ec0f956294a9b508618b356b70edd /camera2/portability/src/com/android/ex/camera2/portability/CameraDeviceInfo.java | |
parent | 01e7c02174ef268b6d6daaa5a5bb4f752d55964c (diff) | |
download | android_frameworks_ex-b30d2c670f1262f0d60181e40dad33f2151fee4a.tar.gz android_frameworks_ex-b30d2c670f1262f0d60181e40dad33f2151fee4a.tar.bz2 android_frameworks_ex-b30d2c670f1262f0d60181e40dad33f2151fee4a.zip |
camera2-portability: Remove Camera.CameraInfo accessor
This removes the CameraDevice#getCameraInfos() call that provided direct access
to this API 1 type, replacing it with another accessor returning individual
instances of the new wrapper type CameraDevice.BasicCharacteristics .
It also gives CameraProxy a method for getting instances of this wrapper.
Change-Id: I0c72ffe71817b8acf1cc5a01f1565ec4e0e97e7d
Diffstat (limited to 'camera2/portability/src/com/android/ex/camera2/portability/CameraDeviceInfo.java')
-rw-r--r-- | camera2/portability/src/com/android/ex/camera2/portability/CameraDeviceInfo.java | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/camera2/portability/src/com/android/ex/camera2/portability/CameraDeviceInfo.java b/camera2/portability/src/com/android/ex/camera2/portability/CameraDeviceInfo.java index 60ad8ed..ada1f29 100644 --- a/camera2/portability/src/com/android/ex/camera2/portability/CameraDeviceInfo.java +++ b/camera2/portability/src/com/android/ex/camera2/portability/CameraDeviceInfo.java @@ -3,18 +3,17 @@ package com.android.ex.camera2.portability; import android.hardware.Camera; /** - * The camera device info. + * The device info for all attached cameras. */ public interface CameraDeviceInfo { static final int NO_DEVICE = -1; /** - * @return The camera info. - * // TODO: Remove the dependency on API 1. + * @param cameraId Which device to interrogate. + * @return The static characteristics of the specified device, or {@code null} on error. */ - @Deprecated - Camera.CameraInfo[] getCameraInfos(); + Characteristics getCharacteristics(int cameraId); /** * @return The total number of the available camera devices. @@ -32,4 +31,31 @@ public interface CameraDeviceInfo { * if not available. */ int getFirstFrontCameraId(); + + /** + * Device characteristics for a single camera. + */ + public interface Characteristics { + /** + * @return Whether the camera faces the back of the device. + */ + boolean isFacingBack(); + + /** + * @return Whether the camera faces the device's screen. + */ + boolean isFacingFront(); + + /** + * @return The camera image orientation, or the clockwise rotation angle + * that must be applied to display it in its natural orientation + * (in degrees, and always a multiple of 90). + */ + int getSensorOrientation(); + + /** + * @return Whether the shutter sound can be disabled. + */ + boolean canDisableShutterSound(); + } } |