1/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.camera.device@3.5;
18
19import android.hardware.camera.common@1.0::Status;
20import @3.2::CameraMetadata;
21import @3.2::ICameraDevice;
22import @3.4::StreamConfiguration;
23
24/**
25 * Camera device interface
26 *
27 * Supports the android.hardware.Camera API, and the android.hardware.camera2
28 * API at LIMITED or better hardware level.
29 *
30 */
31interface ICameraDevice extends @3.2::ICameraDevice {
32
33    /**
34     * getPhysicalCameraCharacteristics:
35     *
36     * Return the static camera information for a physical camera ID backing
37     * this logical camera device. This information may not change between consecutive calls.
38     *
39     * Note that HAL must support this function for physical camera IDs that are
40     * not exposed via ICameraProvider::getCameraIdList(). Calling
41     * getCameraDeviceInterface_V3_x() on these camera IDs must return ILLEGAL_ARGUMENT.
42     *
43     * The characteristics of all cameras returned by
44     * ICameraProvider::getCameraIdList() must be queried via
45     * getCameraCharacteristics(). Calling getPhysicalCameraCharacteristics() on
46     * those cameras must return ILLEGAL_ARGUMENT.
47     *
48     * @param physicalCameraId The physical camera id parsed from the logical
49     *     camera's ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS static metadata
50     *     key. The framework assumes that this ID is just the <id> part of fully
51     *     qualified camera device name "device@<major>.<minor>/<type>/<id>". And
52     *     the physical camera must be of the same version and type as the parent
53     *     logical camera device.
54     *
55     * @return status Status code for the operation, one of:
56     *     OK:
57     *         On a successful query of the physical camera device characteristics
58     *     INTERNAL_ERROR:
59     *         The camera device cannot be opened due to an internal
60     *         error.
61     *     CAMERA_DISCONNECTED:
62     *         An external camera device has been disconnected, and is no longer
63     *         available. This camera device interface is now stale, and a new
64     *         instance must be acquired if the device is reconnected. All
65     *         subsequent calls on this interface must return
66     *         CAMERA_DISCONNECTED.
67     *     ILLEGAL_ARGUMENT:
68     *         If the physicalCameraId is not a valid physical camera Id outside
69     *         of ICameraProvider::getCameraIdList().
70     *
71     * @return cameraCharacteristics
72     *     The static metadata for this logical camera device's physical device, or an empty
73     *     metadata structure if status is not OK.
74     *
75     */
76    getPhysicalCameraCharacteristics(string physicalCameraId)
77            generates (Status status, CameraMetadata cameraCharacteristics);
78
79
80    /**
81     * isStreamCombinationSupported:
82     *
83     * Check for device support of specific camera stream combination.
84     *
85     * The streamList must contain at least one output-capable stream, and may
86     * not contain more than one input-capable stream.
87     * In contrast to regular stream configuration the framework does not create
88     * or initialize any actual streams. This means that Hal must not use or
89     * consider the stream "id" value.
90     *
91     * ------------------------------------------------------------------------
92     *
93     * Preconditions:
94     *
95     * The framework can call this method at any time before, during and
96     * after active session configuration. This means that calls must not
97     * impact the performance of pending camera requests in any way. In
98     * particular there must not be any glitches or delays during normal
99     * camera streaming.
100     *
101     * Performance requirements:
102     * This call is expected to be significantly faster than stream
103     * configuration. In general HW and SW camera settings must not be
104     * changed and there must not be a user-visible impact on camera performance.
105     *
106     * @return Status Status code for the operation, one of:
107     *     OK:
108     *          On successful stream combination query.
109     *     METHOD_NOT_SUPPORTED:
110     *          The camera device does not support stream combination query.
111     *     INTERNAL_ERROR:
112     *          The stream combination query cannot complete due to internal
113     *          error.
114     * @return true in case the stream combination is supported, false otherwise.
115     *
116     */
117    isStreamCombinationSupported(@3.4::StreamConfiguration streams)
118            generates (Status status, bool queryStatus);
119};
120