Shuzhen Wang | d3feb3d | 2018-08-17 13:52:40 -0700 | [diff] [blame] | 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 | |
| 17 | package android.hardware.camera.device@3.5; |
| 18 | |
| 19 | import android.hardware.camera.common@1.0::Status; |
| 20 | import @3.2::CameraMetadata; |
| 21 | import @3.2::ICameraDevice; |
Emilian Peev | 40a8c6e | 2018-10-29 09:35:21 +0000 | [diff] [blame] | 22 | import @3.4::StreamConfiguration; |
Shuzhen Wang | d3feb3d | 2018-08-17 13:52:40 -0700 | [diff] [blame] | 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 | */ |
| 31 | interface 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 |
Shuzhen Wang | 6bdeaf5 | 2018-09-05 09:40:00 -0700 | [diff] [blame] | 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. |
Shuzhen Wang | d3feb3d | 2018-08-17 13:52:40 -0700 | [diff] [blame] | 54 | * |
| 55 | * @return status Status code for the operation, one of: |
| 56 | * OK: |
Shuzhen Wang | 6bdeaf5 | 2018-09-05 09:40:00 -0700 | [diff] [blame] | 57 | * On a successful query of the physical camera device characteristics |
Shuzhen Wang | d3feb3d | 2018-08-17 13:52:40 -0700 | [diff] [blame] | 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. |
Shuzhen Wang | 6bdeaf5 | 2018-09-05 09:40:00 -0700 | [diff] [blame] | 67 | * ILLEGAL_ARGUMENT: |
| 68 | * If the physicalCameraId is not a valid physical camera Id outside |
| 69 | * of ICameraProvider::getCameraIdList(). |
Shuzhen Wang | d3feb3d | 2018-08-17 13:52:40 -0700 | [diff] [blame] | 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 | |
Emilian Peev | 40a8c6e | 2018-10-29 09:35:21 +0000 | [diff] [blame] | 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 | * |
| 88 | * ------------------------------------------------------------------------ |
| 89 | * |
| 90 | * Preconditions: |
| 91 | * |
| 92 | * The framework can call this method at any time before, during and |
| 93 | * after active session configuration. This means that calls must not |
| 94 | * impact the performance of pending camera requests in any way. In |
| 95 | * particular there must not be any glitches or delays during normal |
| 96 | * camera streaming. |
| 97 | * |
| 98 | * Performance requirements: |
| 99 | * This call is expected to be significantly faster than stream |
| 100 | * configuration. In general HW and SW camera settings must not be |
| 101 | * changed and there must not be a user-visible impact on camera performance. |
| 102 | * |
| 103 | * @return Status Status code for the operation, one of: |
| 104 | * OK: |
| 105 | * On successful stream combination query. |
| 106 | * METHOD_NOT_SUPPORTED: |
| 107 | * The camera device does not support stream combination query. |
| 108 | * INTERNAL_ERROR: |
| 109 | * The stream combination query cannot complete due to internal |
| 110 | * error. |
| 111 | * @return true in case the stream combination is supported, false otherwise. |
| 112 | * |
| 113 | */ |
| 114 | isStreamCombinationSupported(@3.4::StreamConfiguration streams) |
| 115 | generates (Status status, bool queryStatus); |
Shuzhen Wang | d3feb3d | 2018-08-17 13:52:40 -0700 | [diff] [blame] | 116 | }; |