blob: b8873a6261702d48060e5fcf7e970b2fb8bd01d4 [file] [log] [blame]
Shuzhen Wang05066102020-01-10 12:43:08 -08001/*
2 * Copyright (C) 2020 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.provider@2.6;
18
19import @2.5::ICameraProvider;
Jayant Chowdhary62481002020-01-09 15:39:27 -080020import android.hardware.camera.common@1.0::Status;
21import android.hardware.camera.device@3.4::StreamConfiguration;
Shuzhen Wang05066102020-01-10 12:43:08 -080022
23/**
24 * Camera provider HAL
Jayant Chowdhary62481002020-01-09 15:39:27 -080025 *
26 * @2.6::adds support for the getConcurrentStreamingCameraIds() and
27 * isConcurrentStreamCombinationSupported()
28 * @2.6::ICameraProviderCallback to receive physical camera availability
29 * callbacks for logical multi-cameras.
Shuzhen Wang05066102020-01-10 12:43:08 -080030 */
31interface ICameraProvider extends @2.5::ICameraProvider {
32 /**
Jayant Chowdhary62481002020-01-09 15:39:27 -080033 * getConcurrentStreamingCameraIds
34 *
35 * Get a vector of combinations of camera device ids that are able to
36 * configure streams concurrently. Each camera device advertised in a
37 * combination MUST at the very least support the following streams while
38 * streaming concurrently with the other camera ids in the combination.
39 *
40 * Target 1 Target 2
Jayant Chowdhary653ea6c2020-02-10 16:11:54 -080041 * -----------------------------------------------------
42 * | Type | Size | Type | Size |
43 * -----------------------------------------------------
44 * | YUV | s1440p | |
45 * -----------------------------------------------------
46 * | JPEG | s1440p | |
47 * -----------------------------------------------------
48 * | PRIV | s1440p | |
49 * -----------------------------------------------------
50 * | YUV / PRIV | s720p | YUV / PRIV | s1440p |
51 * -----------------------------------------------------
52 * | YUV / PRIV | s720p | JPEG | s1440p |
53 * -----------------------------------------------------
54 *
55 * where:
56 * s720p - min (max output resolution for the given format, 1280 X 720)
57 * s1440p - min (max output resolution for the given format, 1920 X 1440)
58 *
Jayant Chowdhary6ae828b2020-02-25 11:45:59 -080059 * If a device has MONOCHROME capability (device's capabilities include
60 * ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME) and therefore supports Y8
61 * outputs, stream combinations mentioned above, where YUV is substituted by
62 * Y8 must be also supported.
63 *
Jayant Chowdhary3a0030f2020-02-18 11:18:12 -080064 * The camera framework must call this method whenever it gets a
65 * cameraDeviceStatusChange callback adding a new camera device or removing
66 * a camera device known to it. This is so that the camera framework can get new combinations
67 * of camera ids that can stream concurrently, that might have potentially appeared.
68 *
Jayant Chowdhary6ae828b2020-02-25 11:45:59 -080069 * For each combination (and their subsets) of camera device ids returned by
70 * getConcurrentStreamingCameraIds(): If only the mandatory combinations can
71 * be supported concurrently by each device, then the resource costs must
72 * sum up to > 100 for the concurrent set, to ensure arbitration between
73 * camera applications work as expected. Only if resources are sufficient
74 * to run a set of cameras at full capability (maximally
75 * resource-consuming framerate and stream size settings available in the
76 * configuration settings exposed through camera metadata), should the sum
77 * of resource costs for the combination be <= 100.
78 *
Jayant Chowdharyed8ec832020-06-10 20:07:05 -070079 * For guaranteed concurrent camera operation, the camera framework must call
80 * ICameraDevice.open() on all devices (intended for concurrent operation), before configuring
81 * any streams on them. This gives the camera HAL process an opportunity to potentially
82 * distribute hardware resources better before stream configuration.
83 *
84 * Due to potential hardware constraints around internal switching of physical camera devices,
85 * a device's complete ZOOM_RATIO_RANGE(if supported), may not apply during concurrent
86 * operation. If ZOOM_RATIO is supported, camera HALs must ensure ZOOM_RATIO_RANGE of
87 * [1.0, ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM] is supported by that device, during
88 * concurrent operation.
Jayant Chowdhary61c3ac22020-03-20 16:15:47 -070089 *
Jayant Chowdhary62481002020-01-09 15:39:27 -080090 * @return status Status code for the operation
91 * @return cameraIds a list of camera id combinations that support
92 * concurrent stream configurations with the minimum guarantees
93 * specified.
Shuzhen Wang05066102020-01-10 12:43:08 -080094 */
Jayant Chowdhary62481002020-01-09 15:39:27 -080095 getConcurrentStreamingCameraIds() generates (Status status, vec<vec<string>> cameraIds);
96
97 /**
98 * isConcurrentStreamCombinationSupported:
99 *
100 * Check for device support of specific camera stream combinations while
101 * streaming concurrently with other devices.
102 *
103 * The per device streamList must contain at least one output-capable stream, and may
104 * not contain more than one input-capable stream.
105 * In contrast to regular stream configuration the framework does not create
106 * or initialize any actual streams. This means that Hal must not use or
107 * consider the stream "id" value.
108 *
109 * ------------------------------------------------------------------------
110 *
111 * Preconditions:
112 *
113 * The framework can call this method at any time before, during and
114 * after active session configuration per device. This means that calls must not
115 * impact the performance of pending camera requests in any way. In
116 * particular there must not be any glitches or delays during normal
117 * camera streaming.
118 *
119 * The framework must not call this method with any combination of camera
120 * ids that is not a subset of the camera ids advertised by getConcurrentStreamingCameraIds of
121 * the same provider.
122 *
123 * Performance requirements:
124 * This call is expected to be significantly faster than stream
125 * configuration. In general HW and SW camera settings must not be
126 * changed and there must not be a user-visible impact on camera performance.
127 *
128 * @param configs a vector of camera ids and their corresponding stream
129 * configurations that need to be queried for support.
130 *
131 * @return status Status code for the operation, one of:
132 * OK:
133 * On successful stream combination query.
134 * METHOD_NOT_SUPPORTED:
135 * The camera provider does not support stream combination query.
136 * INTERNAL_ERROR:
137 * The stream combination query cannot complete due to internal
138 * error.
139 * @return true in case the stream combination is supported, false otherwise.
140 *
141 *
142 */
143 isConcurrentStreamCombinationSupported(vec<CameraIdAndStreamCombination> configs)
144 generates (Status status, bool queryStatus);
Shuzhen Wang05066102020-01-10 12:43:08 -0800145};