blob: d0cfe392ae966e9156a5bdd57005f9e1367fc70b [file] [log] [blame]
Shuzhen Wangd3feb3d2018-08-17 13:52:40 -07001/*
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;
Emilian Peev22eac5f2019-01-23 11:14:11 -080020import @3.2::CameraMetadata;
Shuzhen Wangd3feb3d2018-08-17 13:52:40 -070021import @3.4::ICameraDeviceSession;
Yin-Chia Yeh6a6fe0f2018-09-06 15:38:34 -070022import @3.4::HalStreamConfiguration;
Shuzhen Wangd3feb3d2018-08-17 13:52:40 -070023
24/**
25 * Camera device active session interface.
26 *
27 * Obtained via ICameraDevice::open(), this interface contains the methods to
28 * configure and request captures from an active camera device.
29 */
30interface ICameraDeviceSession extends @3.4::ICameraDeviceSession {
Yin-Chia Yeh6a6fe0f2018-09-06 15:38:34 -070031
32 /**
33 * configureStreams_3_5:
34 *
35 * Identical to @3.4::ICameraDeviceSession.configureStreams, except that:
36 *
37 * - a streamConfigCounter counter is provided to check for race condition
38 * between configureStreams_3_5 and signalStreamFlush call.
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
57 * StreamConfigurationMode requirements
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_5(@3.5::StreamConfiguration requestedConfiguration)
73 generates (Status status,
74 @3.4::HalStreamConfiguration halConfiguration);
75
76
77 /**
78 * signalStreamFlush:
79 *
80 * Signaling HAL camera service is about to perform configureStreams_3_5 and
81 * HAL must return all buffers of designated streams. HAL must finish
82 * inflight requests normally and return all buffers that belongs to the
83 * designated streams through processCaptureResult or returnStreamBuffer
84 * API in a timely manner, or camera service will run into a fatal error.
85 *
86 * Note that this call serves as an optional hint and camera service may
87 * skip sending this call if all buffers are already returned.
88 *
89 * @param streamIds The ID of streams camera service need all of its
90 * buffers returned.
91 *
92 * @param streamConfigCounter Note that due to concurrency nature, it is
93 * possible the signalStreamFlush call arrives later than the
94 * corresponding configureStreams_3_5 call, HAL must check
95 * streamConfigCounter for such race condition. If the counter is less
96 * than the counter in the last configureStreams_3_5 call HAL last
97 * received, the call is stale and HAL should just return this call.
98 */
99 oneway signalStreamFlush(
100 vec<int32_t> streamIds,
101 uint32_t streamConfigCounter
102 );
Emilian Peev22eac5f2019-01-23 11:14:11 -0800103
104 /**
105 * isReconfigurationRequired:
106 *
107 * Check whether complete stream reconfiguration is required for possible new session
108 * parameter values.
109 *
110 * This method must be called by the camera framework in case the client changes
111 * the value of any advertised session parameters. Depending on the specific values
112 * the HAL can decide whether a complete stream reconfiguration is required. In case
113 * the HAL returns false, the camera framework must skip the internal reconfiguration.
114 * In case Hal returns true, the framework must reconfigure the streams and pass the
115 * new session parameter values accordingly.
116 * This call may be done by the framework some time before the request with new parameters
117 * is submitted to the HAL, and the request may be cancelled before it ever gets submitted.
118 * Therefore, the HAL must not use this query as an indication to change its behavior in any
119 * way.
120 * ------------------------------------------------------------------------
121 *
122 * Preconditions:
123 *
124 * The framework can call this method at any time after active
125 * session configuration. There must be no impact on the performance of
126 * pending camera requests in any way. In particular there must not be
127 * any glitches or delays during normal camera streaming.
128 *
129 * Performance requirements:
130 * HW and SW camera settings must not be changed and there must not be
131 * a user-visible impact on camera performance.
132 *
133 * @param oldSessionParams Before session parameters, usually the current session parameters.
134 * @param newSessionParams The new session parameters which may be set by client.
135 *
136 * @return Status Status code for the operation, one of:
137 * OK:
138 * On successful reconfiguration required query.
139 * METHOD_NOT_SUPPORTED:
140 * The camera device does not support the reconfiguration query.
141 * INTERNAL_ERROR:
142 * The reconfiguration query cannot complete due to internal
143 * error.
144 * @return true in case the stream reconfiguration is required, false otherwise.
145 */
146 isReconfigurationRequired(CameraMetadata oldSessionParams, CameraMetadata newSessionParams)
147 generates(Status status, bool reconfigurationNeeded);
Shuzhen Wangd3feb3d2018-08-17 13:52:40 -0700148};