blob: b2b71cdd356bd51f3456f3dee59beaf4ceb02e2a [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;
20import @3.4::ICameraDeviceSession;
Yin-Chia Yeh6a6fe0f2018-09-06 15:38:34 -070021import @3.4::HalStreamConfiguration;
Shuzhen Wangd3feb3d2018-08-17 13:52:40 -070022
23/**
24 * Camera device active session interface.
25 *
26 * Obtained via ICameraDevice::open(), this interface contains the methods to
27 * configure and request captures from an active camera device.
28 */
29interface ICameraDeviceSession extends @3.4::ICameraDeviceSession {
Yin-Chia Yeh6a6fe0f2018-09-06 15:38:34 -070030
31 /**
32 * configureStreams_3_5:
33 *
34 * Identical to @3.4::ICameraDeviceSession.configureStreams, except that:
35 *
36 * - a streamConfigCounter counter is provided to check for race condition
37 * between configureStreams_3_5 and signalStreamFlush call.
38 *
39 * @return status Status code for the operation, one of:
40 * OK:
41 * On successful stream configuration.
42 * INTERNAL_ERROR:
43 * If there has been a fatal error and the device is no longer
44 * operational. Only close() can be called successfully by the
45 * framework after this error is returned.
46 * ILLEGAL_ARGUMENT:
47 * If the requested stream configuration is invalid. Some examples
48 * of invalid stream configurations include:
49 * - Including more than 1 INPUT stream
50 * - Not including any OUTPUT streams
51 * - Including streams with unsupported formats, or an unsupported
52 * size for that format.
53 * - Including too many output streams of a certain format.
54 * - Unsupported rotation configuration
55 * - Stream sizes/formats don't satisfy the
56 * StreamConfigurationMode requirements
57 * for non-NORMAL mode, or the requested operation_mode is not
58 * supported by the HAL.
59 * - Unsupported usage flag
60 * The camera service cannot filter out all possible illegal stream
61 * configurations, since some devices may support more simultaneous
62 * streams or larger stream resolutions than the minimum required
63 * for a given camera device hardware level. The HAL must return an
64 * ILLEGAL_ARGUMENT for any unsupported stream set, and then be
65 * ready to accept a future valid stream configuration in a later
66 * configureStreams call.
67 * @return halConfiguration The stream parameters desired by the HAL for
68 * each stream, including maximum buffers, the usage flags, and the
69 * override format.
70 */
71 configureStreams_3_5(@3.5::StreamConfiguration requestedConfiguration)
72 generates (Status status,
73 @3.4::HalStreamConfiguration halConfiguration);
74
75
76 /**
77 * signalStreamFlush:
78 *
79 * Signaling HAL camera service is about to perform configureStreams_3_5 and
80 * HAL must return all buffers of designated streams. HAL must finish
81 * inflight requests normally and return all buffers that belongs to the
82 * designated streams through processCaptureResult or returnStreamBuffer
83 * API in a timely manner, or camera service will run into a fatal error.
84 *
85 * Note that this call serves as an optional hint and camera service may
86 * skip sending this call if all buffers are already returned.
87 *
88 * @param streamIds The ID of streams camera service need all of its
89 * buffers returned.
90 *
91 * @param streamConfigCounter Note that due to concurrency nature, it is
92 * possible the signalStreamFlush call arrives later than the
93 * corresponding configureStreams_3_5 call, HAL must check
94 * streamConfigCounter for such race condition. If the counter is less
95 * than the counter in the last configureStreams_3_5 call HAL last
96 * received, the call is stale and HAL should just return this call.
97 */
98 oneway signalStreamFlush(
99 vec<int32_t> streamIds,
100 uint32_t streamConfigCounter
101 );
Shuzhen Wangd3feb3d2018-08-17 13:52:40 -0700102};