1 #ifndef HIDL_GENERATED_ANDROID_HARDWARE_CAMERA_DEVICE_V3_7_TYPES_H
2 #define HIDL_GENERATED_ANDROID_HARDWARE_CAMERA_DEVICE_V3_7_TYPES_H
3
4 #include <android/hardware/camera/device/3.2/types.h>
5 #include <android/hardware/camera/device/3.4/types.h>
6 #include <android/hardware/camera/metadata/3.6/types.h>
7
8 #include <hidl/HidlSupport.h>
9 #include <hidl/MQDescriptor.h>
10 #include <utils/NativeHandle.h>
11 #include <utils/misc.h>
12
13 namespace android {
14 namespace hardware {
15 namespace camera {
16 namespace device {
17 namespace V3_7 {
18
19 // Forward declaration for forward reference support:
20 struct Stream;
21 struct StreamConfiguration;
22 struct CaptureRequest;
23
24 /**
25 * Stream:
26 *
27 * A descriptor for a single camera input or output stream. A stream is defined
28 * by the framework by its buffer resolution and format, and additionally by the
29 * HAL with the gralloc usage flags and the maximum in-flight buffer count.
30 *
31 * This version extends the @3.4 Stream with the multi-resolution output surface
32 * group Id field.
33 */
34 struct Stream final {
35 /**
36 * The definition of Stream from the prior version.
37 */
38 ::android::hardware::camera::device::V3_4::Stream v3_4 __attribute__ ((aligned(8)));
39 /**
40 * The surface group id used for multi-resolution output streams.
41 *
42 * This works similar to the surfaceGroupId of OutputConfiguration in the
43 * public API, with the exception that this is for multi-resolution image
44 * reader and is used by the camera HAL to choose a target stream within
45 * the same group to which images are written. All streams in the same group
46 * will have the same image format, data space, and usage flag.
47 *
48 * The framework must only call processCaptureRequest on at most one of the
49 * streams within a surface group. Depending on current active physical
50 * camera backing the logical multi-camera, or the pixel mode the camera is
51 * running in, the HAL can choose to request and return a buffer from any
52 * stream within the same group. -1 means that this stream is an input
53 * stream, or is an output stream which doesn't belong to any group.
54 *
55 * Streams with the same non-negative group id must have the same format and
56 * usage flag.
57 */
58 int32_t groupId __attribute__ ((aligned(4)));
59 /**
60 * The sensor pixel modes used by this stream. This can assist the camera
61 * HAL in decision making about stream combination support.
62 * If this is empty, the HAL must assume that this stream will only be used
63 * with ANDROID_SENSOR_PIXEL_MODE set to ANDROID_SENSOR_PIXEL_MODE_DEFAULT.
64 */
65 ::android::hardware::hidl_vec<::android::hardware::camera::metadata::V3_6::CameraMetadataEnumAndroidSensorPixelMode> sensorPixelModesUsed __attribute__ ((aligned(8)));
66 };
67
68 static_assert(offsetof(::android::hardware::camera::device::V3_7::Stream, v3_4) == 0, "wrong offset");
69 static_assert(offsetof(::android::hardware::camera::device::V3_7::Stream, groupId) == 64, "wrong offset");
70 static_assert(offsetof(::android::hardware::camera::device::V3_7::Stream, sensorPixelModesUsed) == 72, "wrong offset");
71 static_assert(sizeof(::android::hardware::camera::device::V3_7::Stream) == 88, "wrong size");
72 static_assert(__alignof(::android::hardware::camera::device::V3_7::Stream) == 8, "wrong alignment");
73
74 /**
75 * StreamConfiguration:
76 *
77 * Identical to @3.5::StreamConfiguration, except that the streams
78 * vector contains @3.7::Stream.
79 */
80 struct StreamConfiguration final {
81 /**
82 * An array of camera stream pointers, defining the input/output
83 * configuration for the camera HAL device.
84 */
85 ::android::hardware::hidl_vec<::android::hardware::camera::device::V3_7::Stream> streams __attribute__ ((aligned(8)));
86 /**
87 * The definition of operation mode from prior version.
88 *
89 */
90 ::android::hardware::camera::device::V3_2::StreamConfigurationMode operationMode __attribute__ ((aligned(4)));
91 /**
92 * The definition of session parameters from prior version.
93 */
94 ::android::hardware::hidl_vec<uint8_t> sessionParams __attribute__ ((aligned(8)));
95 /**
96 * The definition of stream configuration counter from prior version.
97 */
98 uint32_t streamConfigCounter __attribute__ ((aligned(4)));
99 /**
100 * If an input stream is configured, whether the input stream is expected to
101 * receive variable resolution images.
102 *
103 * This flag can only be set to true if the camera device supports
104 * multi-resolution input streams by advertising input stream configurations in
105 * physicalCameraMultiResolutionStreamConfigurations in its physical cameras'
106 * characteristics.
107 *
108 * When this flag is set to true, the input stream's width and height can be
109 * any one of the supported multi-resolution input stream sizes.
110 */
111 bool multiResolutionInputImage __attribute__ ((aligned(1)));
112 };
113
114 static_assert(offsetof(::android::hardware::camera::device::V3_7::StreamConfiguration, streams) == 0, "wrong offset");
115 static_assert(offsetof(::android::hardware::camera::device::V3_7::StreamConfiguration, operationMode) == 16, "wrong offset");
116 static_assert(offsetof(::android::hardware::camera::device::V3_7::StreamConfiguration, sessionParams) == 24, "wrong offset");
117 static_assert(offsetof(::android::hardware::camera::device::V3_7::StreamConfiguration, streamConfigCounter) == 40, "wrong offset");
118 static_assert(offsetof(::android::hardware::camera::device::V3_7::StreamConfiguration, multiResolutionInputImage) == 44, "wrong offset");
119 static_assert(sizeof(::android::hardware::camera::device::V3_7::StreamConfiguration) == 48, "wrong size");
120 static_assert(__alignof(::android::hardware::camera::device::V3_7::StreamConfiguration) == 8, "wrong alignment");
121
122 /**
123 * CaptureRequest:
124 *
125 * This version extends 3.4::CaptureRequest with the input buffer's width and
126 * height.
127 */
128 struct CaptureRequest final {
129 /**
130 * The definition of CaptureRequest from the prior version.
131 */
132 ::android::hardware::camera::device::V3_4::CaptureRequest v3_4 __attribute__ ((aligned(8)));
133 /**
134 * The width and height of the input buffer for this capture request.
135 *
136 * These fields will be [0, 0] if no input buffer exists in the capture
137 * request.
138 *
139 * If the stream configuration contains an input stream and has the
140 * multiResolutionInputImage flag set to true, the camera client may submit a
141 * reprocessing request with input buffer size different than the
142 * configured input stream size. In that case, the inputWith and inputHeight
143 * fields will be the actual size of the input image.
144 *
145 * If the stream configuration contains an input stream and the
146 * multiResolutionInputImage flag is false, the inputWidth and inputHeight must
147 * match the input stream size.
148 */
149 uint32_t inputWidth __attribute__ ((aligned(4)));
150 uint32_t inputHeight __attribute__ ((aligned(4)));
151 };
152
153 static_assert(offsetof(::android::hardware::camera::device::V3_7::CaptureRequest, v3_4) == 0, "wrong offset");
154 static_assert(offsetof(::android::hardware::camera::device::V3_7::CaptureRequest, inputWidth) == 136, "wrong offset");
155 static_assert(offsetof(::android::hardware::camera::device::V3_7::CaptureRequest, inputHeight) == 140, "wrong offset");
156 static_assert(sizeof(::android::hardware::camera::device::V3_7::CaptureRequest) == 144, "wrong size");
157 static_assert(__alignof(::android::hardware::camera::device::V3_7::CaptureRequest) == 8, "wrong alignment");
158
159 //
160 // type declarations for package
161 //
162
163 static inline std::string toString(const ::android::hardware::camera::device::V3_7::Stream& o);
164 static inline void PrintTo(const ::android::hardware::camera::device::V3_7::Stream& o, ::std::ostream*);
165 static inline bool operator==(const ::android::hardware::camera::device::V3_7::Stream& lhs, const ::android::hardware::camera::device::V3_7::Stream& rhs);
166 static inline bool operator!=(const ::android::hardware::camera::device::V3_7::Stream& lhs, const ::android::hardware::camera::device::V3_7::Stream& rhs);
167
168 static inline std::string toString(const ::android::hardware::camera::device::V3_7::StreamConfiguration& o);
169 static inline void PrintTo(const ::android::hardware::camera::device::V3_7::StreamConfiguration& o, ::std::ostream*);
170 static inline bool operator==(const ::android::hardware::camera::device::V3_7::StreamConfiguration& lhs, const ::android::hardware::camera::device::V3_7::StreamConfiguration& rhs);
171 static inline bool operator!=(const ::android::hardware::camera::device::V3_7::StreamConfiguration& lhs, const ::android::hardware::camera::device::V3_7::StreamConfiguration& rhs);
172
173 static inline std::string toString(const ::android::hardware::camera::device::V3_7::CaptureRequest& o);
174 static inline void PrintTo(const ::android::hardware::camera::device::V3_7::CaptureRequest& o, ::std::ostream*);
175 // operator== and operator!= are not generated for CaptureRequest
176
177 //
178 // type header definitions for package
179 //
180
toString(const::android::hardware::camera::device::V3_7::Stream & o)181 static inline std::string toString(const ::android::hardware::camera::device::V3_7::Stream& o) {
182 using ::android::hardware::toString;
183 std::string os;
184 os += "{";
185 os += ".v3_4 = ";
186 os += ::android::hardware::camera::device::V3_4::toString(o.v3_4);
187 os += ", .groupId = ";
188 os += ::android::hardware::toString(o.groupId);
189 os += ", .sensorPixelModesUsed = ";
190 os += ::android::hardware::toString(o.sensorPixelModesUsed);
191 os += "}"; return os;
192 }
193
PrintTo(const::android::hardware::camera::device::V3_7::Stream & o,::std::ostream * os)194 static inline void PrintTo(const ::android::hardware::camera::device::V3_7::Stream& o, ::std::ostream* os) {
195 *os << toString(o);
196 }
197
198 static inline bool operator==(const ::android::hardware::camera::device::V3_7::Stream& lhs, const ::android::hardware::camera::device::V3_7::Stream& rhs) {
199 if (lhs.v3_4 != rhs.v3_4) {
200 return false;
201 }
202 if (lhs.groupId != rhs.groupId) {
203 return false;
204 }
205 if (lhs.sensorPixelModesUsed != rhs.sensorPixelModesUsed) {
206 return false;
207 }
208 return true;
209 }
210
211 static inline bool operator!=(const ::android::hardware::camera::device::V3_7::Stream& lhs, const ::android::hardware::camera::device::V3_7::Stream& rhs){
212 return !(lhs == rhs);
213 }
214
toString(const::android::hardware::camera::device::V3_7::StreamConfiguration & o)215 static inline std::string toString(const ::android::hardware::camera::device::V3_7::StreamConfiguration& o) {
216 using ::android::hardware::toString;
217 std::string os;
218 os += "{";
219 os += ".streams = ";
220 os += ::android::hardware::toString(o.streams);
221 os += ", .operationMode = ";
222 os += ::android::hardware::camera::device::V3_2::toString(o.operationMode);
223 os += ", .sessionParams = ";
224 os += ::android::hardware::toString(o.sessionParams);
225 os += ", .streamConfigCounter = ";
226 os += ::android::hardware::toString(o.streamConfigCounter);
227 os += ", .multiResolutionInputImage = ";
228 os += ::android::hardware::toString(o.multiResolutionInputImage);
229 os += "}"; return os;
230 }
231
PrintTo(const::android::hardware::camera::device::V3_7::StreamConfiguration & o,::std::ostream * os)232 static inline void PrintTo(const ::android::hardware::camera::device::V3_7::StreamConfiguration& o, ::std::ostream* os) {
233 *os << toString(o);
234 }
235
236 static inline bool operator==(const ::android::hardware::camera::device::V3_7::StreamConfiguration& lhs, const ::android::hardware::camera::device::V3_7::StreamConfiguration& rhs) {
237 if (lhs.streams != rhs.streams) {
238 return false;
239 }
240 if (lhs.operationMode != rhs.operationMode) {
241 return false;
242 }
243 if (lhs.sessionParams != rhs.sessionParams) {
244 return false;
245 }
246 if (lhs.streamConfigCounter != rhs.streamConfigCounter) {
247 return false;
248 }
249 if (lhs.multiResolutionInputImage != rhs.multiResolutionInputImage) {
250 return false;
251 }
252 return true;
253 }
254
255 static inline bool operator!=(const ::android::hardware::camera::device::V3_7::StreamConfiguration& lhs, const ::android::hardware::camera::device::V3_7::StreamConfiguration& rhs){
256 return !(lhs == rhs);
257 }
258
toString(const::android::hardware::camera::device::V3_7::CaptureRequest & o)259 static inline std::string toString(const ::android::hardware::camera::device::V3_7::CaptureRequest& o) {
260 using ::android::hardware::toString;
261 std::string os;
262 os += "{";
263 os += ".v3_4 = ";
264 os += ::android::hardware::camera::device::V3_4::toString(o.v3_4);
265 os += ", .inputWidth = ";
266 os += ::android::hardware::toString(o.inputWidth);
267 os += ", .inputHeight = ";
268 os += ::android::hardware::toString(o.inputHeight);
269 os += "}"; return os;
270 }
271
PrintTo(const::android::hardware::camera::device::V3_7::CaptureRequest & o,::std::ostream * os)272 static inline void PrintTo(const ::android::hardware::camera::device::V3_7::CaptureRequest& o, ::std::ostream* os) {
273 *os << toString(o);
274 }
275
276 // operator== and operator!= are not generated for CaptureRequest
277
278
279 } // namespace V3_7
280 } // namespace device
281 } // namespace camera
282 } // namespace hardware
283 } // namespace android
284
285 //
286 // global type declarations for package
287 //
288
289
290 #endif // HIDL_GENERATED_ANDROID_HARDWARE_CAMERA_DEVICE_V3_7_TYPES_H
291