Emilian Peev | e18057b | 2017-11-13 16:03:44 +0000 | [diff] [blame] | 1 | /* |
Shuzhen Wang | 82e36b3 | 2017-11-28 17:00:43 -0800 | [diff] [blame] | 2 | * Copyright (C) 2017-2018 The Android Open Source Project |
Emilian Peev | e18057b | 2017-11-13 16:03:44 +0000 | [diff] [blame] | 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.4; |
| 18 | |
| 19 | import android.hardware.camera.common@1.0::Status; |
Eino-Ville Talvala | 658d30d | 2018-01-18 12:55:07 -0800 | [diff] [blame] | 20 | import @3.2::CameraMetadata; |
Emilian Peev | e18057b | 2017-11-13 16:03:44 +0000 | [diff] [blame] | 21 | import @3.3::ICameraDeviceSession; |
| 22 | import @3.3::HalStreamConfiguration; |
Shuzhen Wang | 82e36b3 | 2017-11-28 17:00:43 -0800 | [diff] [blame] | 23 | import @3.2::BufferCache; |
Emilian Peev | e18057b | 2017-11-13 16:03:44 +0000 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Camera device active session interface. |
| 27 | * |
| 28 | * Obtained via ICameraDevice::open(), this interface contains the methods to |
| 29 | * configure and request captures from an active camera device. |
| 30 | */ |
| 31 | interface ICameraDeviceSession extends @3.3::ICameraDeviceSession { |
| 32 | |
| 33 | /** |
| 34 | * configureStreams_3_4: |
| 35 | * |
| 36 | * Identical to @3.3::ICameraDeviceSession.configureStreams, except that: |
| 37 | * |
| 38 | * - The requested configuration includes session parameters. |
| 39 | * |
| 40 | * @return Status Status code for the operation, one of: |
| 41 | * OK: |
| 42 | * On successful stream configuration. |
| 43 | * INTERNAL_ERROR: |
| 44 | * If there has been a fatal error and the device is no longer |
| 45 | * operational. Only close() can be called successfully by the |
| 46 | * framework after this error is returned. |
| 47 | * ILLEGAL_ARGUMENT: |
| 48 | * If the requested stream configuration is invalid. Some examples |
| 49 | * of invalid stream configurations include: |
| 50 | * - Including more than 1 INPUT stream |
| 51 | * - Not including any OUTPUT streams |
| 52 | * - Including streams with unsupported formats, or an unsupported |
| 53 | * size for that format. |
| 54 | * - Including too many output streams of a certain format. |
| 55 | * - Unsupported rotation configuration |
| 56 | * - Stream sizes/formats don't satisfy the |
Yin-Chia Yeh | 6a6fe0f | 2018-09-06 15:38:34 -0700 | [diff] [blame] | 57 | * StreamConfigurationMode requirements |
Emilian Peev | e18057b | 2017-11-13 16:03:44 +0000 | [diff] [blame] | 58 | * for non-NORMAL mode, or the requested operation_mode is not |
| 59 | * supported by the HAL. |
| 60 | * - Unsupported usage flag |
| 61 | * The camera service cannot filter out all possible illegal stream |
| 62 | * configurations, since some devices may support more simultaneous |
| 63 | * streams or larger stream resolutions than the minimum required |
| 64 | * for a given camera device hardware level. The HAL must return an |
| 65 | * ILLEGAL_ARGUMENT for any unsupported stream set, and then be |
| 66 | * ready to accept a future valid stream configuration in a later |
| 67 | * configureStreams call. |
| 68 | * @return halConfiguration The stream parameters desired by the HAL for |
| 69 | * each stream, including maximum buffers, the usage flags, and the |
| 70 | * override format. |
| 71 | */ |
| 72 | configureStreams_3_4(@3.4::StreamConfiguration requestedConfiguration) |
| 73 | generates (Status status, |
Shuzhen Wang | 82e36b3 | 2017-11-28 17:00:43 -0800 | [diff] [blame] | 74 | @3.4::HalStreamConfiguration halConfiguration); |
Emilian Peev | b75aa35 | 2018-01-17 11:00:54 +0000 | [diff] [blame] | 75 | |
| 76 | /** |
| 77 | * processCaptureRequest_3_4: |
| 78 | * |
| 79 | * Identical to @3.2::ICameraDeviceSession.processCaptureRequest, except that: |
| 80 | * |
| 81 | * - The capture request can include individual settings for physical camera devices |
| 82 | * backing a logical multi-camera. |
| 83 | * |
| 84 | * @return status Status code for the operation, one of: |
| 85 | * OK: |
| 86 | * On a successful start to processing the capture request |
| 87 | * ILLEGAL_ARGUMENT: |
| 88 | * If the input is malformed (the settings are empty when not |
| 89 | * allowed, the physical camera settings are invalid, there are 0 |
| 90 | * output buffers, etc) and capture processing |
| 91 | * cannot start. Failures during request processing must be |
| 92 | * handled by calling ICameraDeviceCallback::notify(). In case of |
| 93 | * this error, the framework retains responsibility for the |
| 94 | * stream buffers' fences and the buffer handles; the HAL must not |
| 95 | * close the fences or return these buffers with |
| 96 | * ICameraDeviceCallback::processCaptureResult(). |
| 97 | * INTERNAL_ERROR: |
| 98 | * If the camera device has encountered a serious error. After this |
| 99 | * error is returned, only the close() method can be successfully |
| 100 | * called by the framework. |
| 101 | * @return numRequestProcessed Number of requests successfully processed by |
| 102 | * camera HAL. When status is OK, this must be equal to the size of |
| 103 | * requests. When the call fails, this number is the number of requests |
| 104 | * that HAL processed successfully before HAL runs into an error. |
| 105 | * |
| 106 | */ |
| 107 | processCaptureRequest_3_4(vec<CaptureRequest> requests, vec<BufferCache> cachesToRemove) |
| 108 | generates (Status status, uint32_t numRequestProcessed); |
Emilian Peev | e18057b | 2017-11-13 16:03:44 +0000 | [diff] [blame] | 109 | }; |