blob: 7afcf94eea28c954a2a34e391b159b6989417e43 [file] [log] [blame]
Emilian Peeve18057b2017-11-13 16:03:44 +00001/*
Shuzhen Wang82e36b32017-11-28 17:00:43 -08002 * Copyright (C) 2017-2018 The Android Open Source Project
Emilian Peeve18057b2017-11-13 16:03:44 +00003 *
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.4;
18
19import android.hardware.camera.common@1.0::Status;
Eino-Ville Talvala658d30d2018-01-18 12:55:07 -080020import @3.2::CameraMetadata;
Emilian Peeve18057b2017-11-13 16:03:44 +000021import @3.3::ICameraDeviceSession;
22import @3.3::HalStreamConfiguration;
Shuzhen Wang82e36b32017-11-28 17:00:43 -080023import @3.2::BufferCache;
Emilian Peeve18057b2017-11-13 16:03:44 +000024
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 */
31interface ICameraDeviceSession extends @3.3::ICameraDeviceSession {
32
33 /**
Eino-Ville Talvala658d30d2018-01-18 12:55:07 -080034 * constructDefaultRequestSettings_3_4:
35 *
36 * Create capture settings for standard camera use cases. Supports the
37 * new template enums added in @3.4.
38 *
39 * The device must return a settings buffer that is configured to meet the
40 * requested use case, which must be one of the CAMERA3_TEMPLATE_*
41 * enums. All request control fields must be included.
42 *
43 * Performance requirements:
44 *
45 * This must be a non-blocking call. The HAL should return from this call
46 * in 1ms, and must return from this call in 5ms.
47 *
48 * Return values:
49 * @return status Status code for the operation, one of:
50 * OK:
51 * On a successful construction of default settings.
52 * INTERNAL_ERROR:
53 * An unexpected internal error occurred, and the default settings
54 * are not available.
55 * ILLEGAL_ARGUMENT:
56 * The camera HAL does not support the input template type
57 * CAMERA_DISCONNECTED:
58 * An external camera device has been disconnected, and is no longer
59 * available. This camera device interface is now stale, and a new
60 * instance must be acquired if the device is reconnected. All
61 * subsequent calls on this interface must return
62 * CAMERA_DISCONNECTED.
63 * @return requestTemplate The default capture request settings for the requested
64 * use case, or an empty metadata structure if status is not OK.
65 *
66 */
67 constructDefaultRequestSettings_3_4(RequestTemplate type) generates
68 (Status status, @3.2::CameraMetadata requestTemplate);
69
70 /**
Emilian Peeve18057b2017-11-13 16:03:44 +000071 * configureStreams_3_4:
72 *
73 * Identical to @3.3::ICameraDeviceSession.configureStreams, except that:
74 *
75 * - The requested configuration includes session parameters.
76 *
77 * @return Status Status code for the operation, one of:
78 * OK:
79 * On successful stream configuration.
80 * INTERNAL_ERROR:
81 * If there has been a fatal error and the device is no longer
82 * operational. Only close() can be called successfully by the
83 * framework after this error is returned.
84 * ILLEGAL_ARGUMENT:
85 * If the requested stream configuration is invalid. Some examples
86 * of invalid stream configurations include:
87 * - Including more than 1 INPUT stream
88 * - Not including any OUTPUT streams
89 * - Including streams with unsupported formats, or an unsupported
90 * size for that format.
91 * - Including too many output streams of a certain format.
92 * - Unsupported rotation configuration
93 * - Stream sizes/formats don't satisfy the
94 * camera3_stream_configuration_t->operation_mode requirements
95 * for non-NORMAL mode, or the requested operation_mode is not
96 * supported by the HAL.
97 * - Unsupported usage flag
98 * The camera service cannot filter out all possible illegal stream
99 * configurations, since some devices may support more simultaneous
100 * streams or larger stream resolutions than the minimum required
101 * for a given camera device hardware level. The HAL must return an
102 * ILLEGAL_ARGUMENT for any unsupported stream set, and then be
103 * ready to accept a future valid stream configuration in a later
104 * configureStreams call.
105 * @return halConfiguration The stream parameters desired by the HAL for
106 * each stream, including maximum buffers, the usage flags, and the
107 * override format.
108 */
109 configureStreams_3_4(@3.4::StreamConfiguration requestedConfiguration)
110 generates (Status status,
Shuzhen Wang82e36b32017-11-28 17:00:43 -0800111 @3.4::HalStreamConfiguration halConfiguration);
Emilian Peevb75aa352018-01-17 11:00:54 +0000112
113 /**
114 * processCaptureRequest_3_4:
115 *
116 * Identical to @3.2::ICameraDeviceSession.processCaptureRequest, except that:
117 *
118 * - The capture request can include individual settings for physical camera devices
119 * backing a logical multi-camera.
120 *
121 * @return status Status code for the operation, one of:
122 * OK:
123 * On a successful start to processing the capture request
124 * ILLEGAL_ARGUMENT:
125 * If the input is malformed (the settings are empty when not
126 * allowed, the physical camera settings are invalid, there are 0
127 * output buffers, etc) and capture processing
128 * cannot start. Failures during request processing must be
129 * handled by calling ICameraDeviceCallback::notify(). In case of
130 * this error, the framework retains responsibility for the
131 * stream buffers' fences and the buffer handles; the HAL must not
132 * close the fences or return these buffers with
133 * ICameraDeviceCallback::processCaptureResult().
134 * INTERNAL_ERROR:
135 * If the camera device has encountered a serious error. After this
136 * error is returned, only the close() method can be successfully
137 * called by the framework.
138 * @return numRequestProcessed Number of requests successfully processed by
139 * camera HAL. When status is OK, this must be equal to the size of
140 * requests. When the call fails, this number is the number of requests
141 * that HAL processed successfully before HAL runs into an error.
142 *
143 */
144 processCaptureRequest_3_4(vec<CaptureRequest> requests, vec<BufferCache> cachesToRemove)
145 generates (Status status, uint32_t numRequestProcessed);
Emilian Peeve18057b2017-11-13 16:03:44 +0000146};