CameraDeviceInfo.java revision b30d2c670f1262f0d60181e40dad33f2151fee4a
1package com.android.ex.camera2.portability; 2 3import android.hardware.Camera; 4 5/** 6 * The device info for all attached cameras. 7 */ 8public interface CameraDeviceInfo { 9 10 static final int NO_DEVICE = -1; 11 12 /** 13 * @param cameraId Which device to interrogate. 14 * @return The static characteristics of the specified device, or {@code null} on error. 15 */ 16 Characteristics getCharacteristics(int cameraId); 17 18 /** 19 * @return The total number of the available camera devices. 20 */ 21 int getNumberOfCameras(); 22 23 /** 24 * @return The first (lowest) ID of the back cameras or {@code NO_DEVICE} 25 * if not available. 26 */ 27 int getFirstBackCameraId(); 28 29 /** 30 * @return The first (lowest) ID of the front cameras or {@code NO_DEVICE} 31 * if not available. 32 */ 33 int getFirstFrontCameraId(); 34 35 /** 36 * Device characteristics for a single camera. 37 */ 38 public interface Characteristics { 39 /** 40 * @return Whether the camera faces the back of the device. 41 */ 42 boolean isFacingBack(); 43 44 /** 45 * @return Whether the camera faces the device's screen. 46 */ 47 boolean isFacingFront(); 48 49 /** 50 * @return The camera image orientation, or the clockwise rotation angle 51 * that must be applied to display it in its natural orientation 52 * (in degrees, and always a multiple of 90). 53 */ 54 int getSensorOrientation(); 55 56 /** 57 * @return Whether the shutter sound can be disabled. 58 */ 59 boolean canDisableShutterSound(); 60 } 61} 62