blob: 5651550e2d182ca0ef206e338a6a0c513c7585f3 [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 Chowdhary62481002020-01-09 15:39:27 -080079 * @return status Status code for the operation
80 * @return cameraIds a list of camera id combinations that support
81 * concurrent stream configurations with the minimum guarantees
82 * specified.
Shuzhen Wang05066102020-01-10 12:43:08 -080083 */
Jayant Chowdhary62481002020-01-09 15:39:27 -080084 getConcurrentStreamingCameraIds() generates (Status status, vec<vec<string>> cameraIds);
85
86 /**
87 * isConcurrentStreamCombinationSupported:
88 *
89 * Check for device support of specific camera stream combinations while
90 * streaming concurrently with other devices.
91 *
92 * The per device streamList must contain at least one output-capable stream, and may
93 * not contain more than one input-capable stream.
94 * In contrast to regular stream configuration the framework does not create
95 * or initialize any actual streams. This means that Hal must not use or
96 * consider the stream "id" value.
97 *
98 * ------------------------------------------------------------------------
99 *
100 * Preconditions:
101 *
102 * The framework can call this method at any time before, during and
103 * after active session configuration per device. This means that calls must not
104 * impact the performance of pending camera requests in any way. In
105 * particular there must not be any glitches or delays during normal
106 * camera streaming.
107 *
108 * The framework must not call this method with any combination of camera
109 * ids that is not a subset of the camera ids advertised by getConcurrentStreamingCameraIds of
110 * the same provider.
111 *
112 * Performance requirements:
113 * This call is expected to be significantly faster than stream
114 * configuration. In general HW and SW camera settings must not be
115 * changed and there must not be a user-visible impact on camera performance.
116 *
117 * @param configs a vector of camera ids and their corresponding stream
118 * configurations that need to be queried for support.
119 *
120 * @return status Status code for the operation, one of:
121 * OK:
122 * On successful stream combination query.
123 * METHOD_NOT_SUPPORTED:
124 * The camera provider does not support stream combination query.
125 * INTERNAL_ERROR:
126 * The stream combination query cannot complete due to internal
127 * error.
128 * @return true in case the stream combination is supported, false otherwise.
129 *
130 *
131 */
132 isConcurrentStreamCombinationSupported(vec<CameraIdAndStreamCombination> configs)
133 generates (Status status, bool queryStatus);
Shuzhen Wang05066102020-01-10 12:43:08 -0800134};