summaryrefslogtreecommitdiffstats
path: root/camera2/portability/src/com/android/ex/camera2/portability/CameraDeviceInfo.java
blob: ada1f29e0146ac6a26876bbea5d0d68be7041022 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.android.ex.camera2.portability;

import android.hardware.Camera;

/**
 * The device info for all attached cameras.
 */
public interface CameraDeviceInfo {

    static final int NO_DEVICE = -1;

    /**
     * @param cameraId Which device to interrogate.
     * @return The static characteristics of the specified device, or {@code null} on error.
     */
    Characteristics getCharacteristics(int cameraId);

    /**
     * @return The total number of the available camera devices.
     */
    int getNumberOfCameras();

    /**
     * @return The first (lowest) ID of the back cameras or {@code NO_DEVICE}
     *         if not available.
     */
    int getFirstBackCameraId();

    /**
     * @return The first (lowest) ID of the front cameras or {@code NO_DEVICE}
     *         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();
    }
}