summaryrefslogtreecommitdiffstats
path: root/camera2/portability/src/com/android/ex/camera2/portability/CameraDeviceInfo.java
diff options
context:
space:
mode:
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.java36
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();
+ }
}