blob: be9e63aaa9e09650e1b601fb7b9c76553c2b8268 [file] [log] [blame]
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -08001/*
2 * Copyright (C) 2012 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
17// FIXME: add well-defined names for cameras
18
19#ifndef ANDROID_INCLUDE_CAMERA_COMMON_H
20#define ANDROID_INCLUDE_CAMERA_COMMON_H
21
22#include <stdint.h>
Chien-Yu Chen30159172015-01-08 11:06:38 -080023#include <stdbool.h>
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -080024#include <sys/cdefs.h>
25#include <sys/types.h>
26#include <cutils/native_handle.h>
27#include <system/camera.h>
Ruben Brunk61cf9eb2014-01-14 15:27:58 -080028#include <system/camera_vendor_tags.h>
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -080029#include <hardware/hardware.h>
30#include <hardware/gralloc.h>
31
32__BEGIN_DECLS
33
34/**
35 * The id of this module
36 */
37#define CAMERA_HARDWARE_MODULE_ID "camera"
38
39/**
40 * Module versioning information for the Camera hardware module, based on
41 * camera_module_t.common.module_api_version. The two most significant hex
42 * digits represent the major version, and the two least significant represent
43 * the minor version.
44 *
45 *******************************************************************************
Eino-Ville Talvaladdc026e2012-03-27 16:15:25 -070046 * Versions: 0.X - 1.X [CAMERA_MODULE_API_VERSION_1_0]
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -080047 *
48 * Camera modules that report these version numbers implement the initial
49 * camera module HAL interface. All camera devices openable through this
50 * module support only version 1 of the camera device HAL. The device_version
51 * and static_camera_characteristics fields of camera_info are not valid. Only
52 * the android.hardware.Camera API can be supported by this module and its
53 * devices.
54 *
55 *******************************************************************************
Eino-Ville Talvaladdc026e2012-03-27 16:15:25 -070056 * Version: 2.0 [CAMERA_MODULE_API_VERSION_2_0]
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -080057 *
58 * Camera modules that report this version number implement the second version
59 * of the camera module HAL interface. Camera devices openable through this
60 * module may support either version 1.0 or version 2.0 of the camera device
61 * HAL interface. The device_version field of camera_info is always valid; the
62 * static_camera_characteristics field of camera_info is valid if the
63 * device_version field is 2.0 or higher.
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -080064 *
65 *******************************************************************************
66 * Version: 2.1 [CAMERA_MODULE_API_VERSION_2_1]
67 *
68 * This camera module version adds support for asynchronous callbacks to the
69 * framework from the camera HAL module, which is used to notify the framework
70 * about changes to the camera module state. Modules that provide a valid
71 * set_callbacks() method must report at least this version number.
Alex Ray19b2cea2013-06-13 12:40:52 -070072 *
73 *******************************************************************************
74 * Version: 2.2 [CAMERA_MODULE_API_VERSION_2_2]
75 *
76 * This camera module version adds vendor tag support from the module, and
77 * deprecates the old vendor_tag_query_ops that were previously only
78 * accessible with a device open.
Zhijun Hebcdebf32014-06-06 15:42:17 -070079 *
80 *******************************************************************************
81 * Version: 2.3 [CAMERA_MODULE_API_VERSION_2_3]
82 *
83 * This camera module version adds open legacy camera HAL device support.
84 * Framework can use it to open the camera device as lower device HAL version
85 * HAL device if the same device can support multiple device API versions.
86 * The standard hardware module open call (common.methods->open) continues
87 * to open the camera device with the latest supported version, which is
88 * also the version listed in camera_info_t.device_version.
Chien-Yu Chen30159172015-01-08 11:06:38 -080089 *
90 *******************************************************************************
91 * Version: 2.4 [CAMERA_MODULE_API_VERSION_2_4]
92 *
Zhijun He94e23b22015-01-12 14:45:33 -080093 * This camera module version adds below API changes:
94 *
95 * 1. Torch mode support. The framework can use it to turn on torch mode for
96 * any camera device that has a flash unit, without opening a camera device. The
97 * camera device has a higher priority accessing the flash unit than the camera
98 * module; opening a camera device will turn off the torch if it had been enabled
99 * through the module interface. When there are any resource conflicts, such as
100 * open() is called to open a camera device, the camera HAL module must notify the
101 * framework through the torch mode status callback that the torch mode has been
102 * turned off.
103 *
104 * 2. External camera (e.g. USB hot-plug camera) support. The API updates specify that
105 * the camera static info is only available when camera is connected and ready to
106 * use for external hot-plug cameras. Calls to get static info will be invalid
107 * calls when camera status is not CAMERA_DEVICE_STATUS_PRESENT. The frameworks
108 * will only count on device status change callbacks to manage the available external
109 * camera list.
Ruben Brunk0388bcd2015-01-16 14:29:21 -0800110 *
111 * 3. Camera arbitration hints. This module version adds support for explicitly
112 * indicating the number of camera devices that can be simultaneously opened and used.
113 * To specify valid combinations of devices, the resource_cost and conflicting_devices
114 * fields should always be set in the camera_info structure returned by the
115 * get_camera_info call.
Eino-Ville Talvalaaee47822015-04-07 13:47:46 -0700116 *
117 * 4. Module initialization method. This will be called by the camera service
118 * right after the HAL module is loaded, to allow for one-time initialization
119 * of the HAL. It is called before any other module methods are invoked.
Shuzhen Wanga8caa6a2018-08-24 11:07:50 -0700120 *
121 *******************************************************************************
122 * Version: 2.5 [CAMERA_MODULE_API_VERSION_2_5]
123 *
124 * This camera module version adds support to query characteristics of a
125 * non-standalone physical camera, which can only be accessed as part of a
126 * logical camera.
127 *
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800128 */
129
Eino-Ville Talvaladdc026e2012-03-27 16:15:25 -0700130/**
131 * Predefined macros for currently-defined version numbers
132 */
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800133
Eino-Ville Talvaladdc026e2012-03-27 16:15:25 -0700134/**
135 * All module versions <= HARDWARE_MODULE_API_VERSION(1, 0xFF) must be treated
136 * as CAMERA_MODULE_API_VERSION_1_0
137 */
138#define CAMERA_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0)
139#define CAMERA_MODULE_API_VERSION_2_0 HARDWARE_MODULE_API_VERSION(2, 0)
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800140#define CAMERA_MODULE_API_VERSION_2_1 HARDWARE_MODULE_API_VERSION(2, 1)
Alex Ray19b2cea2013-06-13 12:40:52 -0700141#define CAMERA_MODULE_API_VERSION_2_2 HARDWARE_MODULE_API_VERSION(2, 2)
Zhijun Hebcdebf32014-06-06 15:42:17 -0700142#define CAMERA_MODULE_API_VERSION_2_3 HARDWARE_MODULE_API_VERSION(2, 3)
Chien-Yu Chen30159172015-01-08 11:06:38 -0800143#define CAMERA_MODULE_API_VERSION_2_4 HARDWARE_MODULE_API_VERSION(2, 4)
Shuzhen Wanga8caa6a2018-08-24 11:07:50 -0700144#define CAMERA_MODULE_API_VERSION_2_5 HARDWARE_MODULE_API_VERSION(2, 5)
Eino-Ville Talvaladdc026e2012-03-27 16:15:25 -0700145
Shuzhen Wanga8caa6a2018-08-24 11:07:50 -0700146#define CAMERA_MODULE_API_VERSION_CURRENT CAMERA_MODULE_API_VERSION_2_5
Eino-Ville Talvaladdc026e2012-03-27 16:15:25 -0700147
148/**
149 * All device versions <= HARDWARE_DEVICE_API_VERSION(1, 0xFF) must be treated
150 * as CAMERA_DEVICE_API_VERSION_1_0
151 */
Eino-Ville Talvalad4392022015-11-25 13:51:51 -0800152#define CAMERA_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) // DEPRECATED
153#define CAMERA_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) // NO LONGER SUPPORTED
154#define CAMERA_DEVICE_API_VERSION_2_1 HARDWARE_DEVICE_API_VERSION(2, 1) // NO LONGER SUPPORTED
Eino-Ville Talvala18782aa2016-12-19 16:35:29 -0800155#define CAMERA_DEVICE_API_VERSION_3_0 HARDWARE_DEVICE_API_VERSION(3, 0) // NO LONGER SUPPORTED
156#define CAMERA_DEVICE_API_VERSION_3_1 HARDWARE_DEVICE_API_VERSION(3, 1) // NO LONGER SUPPORTED
Ruben Brunk61cf9eb2014-01-14 15:27:58 -0800157#define CAMERA_DEVICE_API_VERSION_3_2 HARDWARE_DEVICE_API_VERSION(3, 2)
Zhijun Heebdf1282015-01-16 16:44:40 -0800158#define CAMERA_DEVICE_API_VERSION_3_3 HARDWARE_DEVICE_API_VERSION(3, 3)
Yin-Chia Yeh3e0b5f62015-12-07 16:31:09 -0800159#define CAMERA_DEVICE_API_VERSION_3_4 HARDWARE_DEVICE_API_VERSION(3, 4)
Emilian Peeveec2ee92017-11-08 19:33:27 +0000160#define CAMERA_DEVICE_API_VERSION_3_5 HARDWARE_DEVICE_API_VERSION(3, 5)
Eino-Ville Talvaladdc026e2012-03-27 16:15:25 -0700161
Emilian Peeveec2ee92017-11-08 19:33:27 +0000162// Device version 3.5 is current, older HAL camera device versions are not
Eino-Ville Talvalab5459832014-09-09 16:42:27 -0700163// recommended for new devices.
Emilian Peeveec2ee92017-11-08 19:33:27 +0000164#define CAMERA_DEVICE_API_VERSION_CURRENT CAMERA_DEVICE_API_VERSION_3_5
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800165
166/**
James Dongd0ca70d2012-03-26 16:22:35 -0700167 * Defined in /system/media/camera/include/system/camera_metadata.h
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800168 */
169typedef struct camera_metadata camera_metadata_t;
170
Alex Ray9acc7402013-02-07 15:44:24 -0800171typedef struct camera_info {
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800172 /**
Zhijun He94e23b22015-01-12 14:45:33 -0800173 * The direction that the camera faces to. See system/core/include/system/camera.h
174 * for camera facing definitions.
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800175 *
Zhijun He94e23b22015-01-12 14:45:33 -0800176 * Version information (based on camera_module_t.common.module_api_version):
177 *
178 * CAMERA_MODULE_API_VERSION_2_3 or lower:
179 *
180 * It should be CAMERA_FACING_BACK or CAMERA_FACING_FRONT.
181 *
182 * CAMERA_MODULE_API_VERSION_2_4 or higher:
183 *
184 * It should be CAMERA_FACING_BACK, CAMERA_FACING_FRONT or
185 * CAMERA_FACING_EXTERNAL.
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800186 */
187 int facing;
188
189 /**
190 * The orientation of the camera image. The value is the angle that the
191 * camera image needs to be rotated clockwise so it shows correctly on the
192 * display in its natural orientation. It should be 0, 90, 180, or 270.
193 *
194 * For example, suppose a device has a naturally tall screen. The
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800195 * back-facing camera sensor is mounted in landscape. You are looking at the
196 * screen. If the top side of the camera sensor is aligned with the right
197 * edge of the screen in natural orientation, the value should be 90. If the
198 * top side of a front-facing camera sensor is aligned with the right of the
199 * screen, the value should be 270.
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800200 *
Zhijun He94e23b22015-01-12 14:45:33 -0800201 * Version information (based on camera_module_t.common.module_api_version):
202 *
203 * CAMERA_MODULE_API_VERSION_2_3 or lower:
204 *
205 * Valid in all camera_module versions.
206 *
207 * CAMERA_MODULE_API_VERSION_2_4 or higher:
208 *
209 * Valid if camera facing is CAMERA_FACING_BACK or CAMERA_FACING_FRONT,
210 * not valid if camera facing is CAMERA_FACING_EXTERNAL.
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800211 */
212 int orientation;
213
214 /**
215 * The value of camera_device_t.common.version.
216 *
217 * Version information (based on camera_module_t.common.module_api_version):
218 *
Eino-Ville Talvaladdc026e2012-03-27 16:15:25 -0700219 * CAMERA_MODULE_API_VERSION_1_0:
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800220 *
Eino-Ville Talvaladdc026e2012-03-27 16:15:25 -0700221 * Not valid. Can be assumed to be CAMERA_DEVICE_API_VERSION_1_0. Do
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800222 * not read this field.
223 *
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800224 * CAMERA_MODULE_API_VERSION_2_0 or higher:
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800225 *
226 * Always valid
227 *
228 */
229 uint32_t device_version;
230
231 /**
Zhijun He94e23b22015-01-12 14:45:33 -0800232 * The camera's fixed characteristics, which include all static camera metadata
233 * specified in system/media/camera/docs/docs.html. This should be a sorted metadata
234 * buffer, and may not be modified or freed by the caller. The pointer should remain
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800235 * valid for the lifetime of the camera module, and values in it may not
236 * change after it is returned by get_camera_info().
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800237 *
238 * Version information (based on camera_module_t.common.module_api_version):
239 *
Eino-Ville Talvaladdc026e2012-03-27 16:15:25 -0700240 * CAMERA_MODULE_API_VERSION_1_0:
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800241 *
242 * Not valid. Extra characteristics are not available. Do not read this
243 * field.
244 *
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800245 * CAMERA_MODULE_API_VERSION_2_0 or higher:
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800246 *
Eino-Ville Talvaladdc026e2012-03-27 16:15:25 -0700247 * Valid if device_version >= CAMERA_DEVICE_API_VERSION_2_0. Do not read
248 * otherwise.
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800249 *
250 */
Eino-Ville Talvalab8b64392012-08-24 12:32:17 -0700251 const camera_metadata_t *static_camera_characteristics;
Ruben Brunk0388bcd2015-01-16 14:29:21 -0800252
253 /**
Ruben Brunk1fa09022015-03-10 11:53:12 -0700254 * The total resource "cost" of using this camera, represented as an integer
255 * value in the range [0, 100] where 100 represents total usage of the shared
256 * resource that is the limiting bottleneck of the camera subsystem. This may
257 * be a very rough estimate, and is used as a hint to the camera service to
258 * determine when to disallow multiple applications from simultaneously
259 * opening different cameras advertised by the camera service.
Ruben Brunk0388bcd2015-01-16 14:29:21 -0800260 *
261 * The camera service must be able to simultaneously open and use any
262 * combination of camera devices exposed by the HAL where the sum of
263 * the resource costs of these cameras is <= 100. For determining cost,
264 * each camera device must be assumed to be configured and operating at
265 * the maximally resource-consuming framerate and stream size settings
266 * available in the configuration settings exposed for that device through
267 * the camera metadata.
268 *
Ruben Brunk1fa09022015-03-10 11:53:12 -0700269 * The camera service may still attempt to simultaneously open combinations
270 * of camera devices with a total resource cost > 100. This may succeed or
271 * fail. If this succeeds, combinations of configurations that are not
272 * supported due to resource constraints from having multiple open devices
273 * should fail during the configure calls. If the total resource cost is
274 * <= 100, open and configure should never fail for any stream configuration
275 * settings or other device capabilities that would normally succeed for a
276 * device when it is the only open camera device.
277 *
278 * This field will be used to determine whether background applications are
279 * allowed to use this camera device while other applications are using other
280 * camera devices. Note: multiple applications will never be allowed by the
281 * camera service to simultaneously open the same camera device.
282 *
283 * Example use cases:
284 *
285 * Ex. 1: Camera Device 0 = Back Camera
286 * Camera Device 1 = Front Camera
287 * - Using both camera devices causes a large framerate slowdown due to
288 * limited ISP bandwidth.
289 *
290 * Configuration:
291 *
292 * Camera Device 0 - resource_cost = 51
293 * conflicting_devices = null
294 * Camera Device 1 - resource_cost = 51
295 * conflicting_devices = null
296 *
297 * Result:
298 *
299 * Since the sum of the resource costs is > 100, if a higher-priority
300 * application has either device open, no lower-priority applications will be
301 * allowed by the camera service to open either device. If a lower-priority
302 * application is using a device that a higher-priority subsequently attempts
303 * to open, the lower-priority application will be forced to disconnect the
304 * the device.
305 *
306 * If the highest-priority application chooses, it may still attempt to open
307 * both devices (since these devices are not listed as conflicting in the
308 * conflicting_devices fields), but usage of these devices may fail in the
309 * open or configure calls.
310 *
311 * Ex. 2: Camera Device 0 = Left Back Camera
312 * Camera Device 1 = Right Back Camera
313 * Camera Device 2 = Combined stereo camera using both right and left
314 * back camera sensors used by devices 0, and 1
315 * Camera Device 3 = Front Camera
316 * - Due to do hardware constraints, up to two cameras may be open at once. The
317 * combined stereo camera may never be used at the same time as either of the
318 * two back camera devices (device 0, 1), and typically requires too much
319 * bandwidth to use at the same time as the front camera (device 3).
320 *
321 * Configuration:
322 *
323 * Camera Device 0 - resource_cost = 50
324 * conflicting_devices = { 2 }
325 * Camera Device 1 - resource_cost = 50
326 * conflicting_devices = { 2 }
327 * Camera Device 2 - resource_cost = 100
328 * conflicting_devices = { 0, 1 }
329 * Camera Device 3 - resource_cost = 50
330 * conflicting_devices = null
331 *
332 * Result:
333 *
334 * Based on the conflicting_devices fields, the camera service guarantees that
335 * the following sets of open devices will never be allowed: { 1, 2 }, { 0, 2 }.
336 *
337 * Based on the resource_cost fields, if a high-priority foreground application
338 * is using camera device 0, a background application would be allowed to open
339 * camera device 1 or 3 (but would be forced to disconnect it again if the
340 * foreground application opened another device).
341 *
342 * The highest priority application may still attempt to simultaneously open
343 * devices 0, 2, and 3, but the HAL may fail in open or configure calls for
344 * this combination.
345 *
346 * Ex. 3: Camera Device 0 = Back Camera
347 * Camera Device 1 = Front Camera
348 * Camera Device 2 = Low-power Front Camera that uses the same
349 * sensor as device 1, but only exposes image stream
350 * resolutions that can be used in low-power mode
351 * - Using both front cameras (device 1, 2) at the same time is impossible due
352 * a shared physical sensor. Using the back and "high-power" front camera
353 * (device 1) may be impossible for some stream configurations due to hardware
354 * limitations, but the "low-power" front camera option may always be used as
355 * it has special dedicated hardware.
356 *
357 * Configuration:
358 *
359 * Camera Device 0 - resource_cost = 100
360 * conflicting_devices = null
361 * Camera Device 1 - resource_cost = 100
362 * conflicting_devices = { 2 }
363 * Camera Device 2 - resource_cost = 0
364 * conflicting_devices = { 1 }
365 * Result:
366 *
367 * Based on the conflicting_devices fields, the camera service guarantees that
368 * the following sets of open devices will never be allowed: { 1, 2 }.
369 *
370 * Based on the resource_cost fields, only the highest priority application
371 * may attempt to open both device 0 and 1 at the same time. If a higher-priority
372 * application is not using device 1 or 2, a low-priority background application
373 * may open device 2 (but will be forced to disconnect it if a higher-priority
374 * application subsequently opens device 1 or 2).
Ruben Brunk0388bcd2015-01-16 14:29:21 -0800375 *
376 * Version information (based on camera_module_t.common.module_api_version):
377 *
378 * CAMERA_MODULE_API_VERSION_2_3 or lower:
379 *
380 * Not valid. Can be assumed to be 100. Do not read this field.
381 *
382 * CAMERA_MODULE_API_VERSION_2_4 or higher:
383 *
384 * Always valid.
385 */
386 int resource_cost;
387
388 /**
389 * An array of camera device IDs represented as NULL-terminated strings
390 * indicating other devices that cannot be simultaneously opened while this
391 * camera device is in use.
392 *
393 * This field is intended to be used to indicate that this camera device
394 * is a composite of several other camera devices, or otherwise has
395 * hardware dependencies that prohibit simultaneous usage. If there are no
396 * dependencies, a NULL may be returned in this field to indicate this.
397 *
398 * The camera service will never simultaneously open any of the devices
399 * in this list while this camera device is open.
400 *
Ruben Brunk1fa09022015-03-10 11:53:12 -0700401 * The strings pointed to in this field will not be cleaned up by the camera
402 * service, and must remain while this device is plugged in.
403 *
Ruben Brunk0388bcd2015-01-16 14:29:21 -0800404 * Version information (based on camera_module_t.common.module_api_version):
405 *
406 * CAMERA_MODULE_API_VERSION_2_3 or lower:
407 *
408 * Not valid. Can be assumed to be NULL. Do not read this field.
409 *
410 * CAMERA_MODULE_API_VERSION_2_4 or higher:
411 *
412 * Always valid.
413 */
414 char** conflicting_devices;
415
416 /**
417 * The length of the array given in the conflicting_devices field.
418 *
419 * Version information (based on camera_module_t.common.module_api_version):
420 *
421 * CAMERA_MODULE_API_VERSION_2_3 or lower:
422 *
423 * Not valid. Can be assumed to be 0. Do not read this field.
424 *
425 * CAMERA_MODULE_API_VERSION_2_4 or higher:
426 *
427 * Always valid.
428 */
429 size_t conflicting_devices_length;
430
Alex Ray9acc7402013-02-07 15:44:24 -0800431} camera_info_t;
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800432
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800433/**
434 * camera_device_status_t:
435 *
436 * The current status of the camera device, as provided by the HAL through the
437 * camera_module_callbacks.camera_device_status_change() call.
Igor Murashkin152b50f2013-03-18 13:30:14 -0700438 *
439 * At module load time, the framework will assume all camera devices are in the
440 * CAMERA_DEVICE_STATUS_PRESENT state. The HAL should invoke
441 * camera_module_callbacks::camera_device_status_change to inform the framework
442 * of any initially NOT_PRESENT devices.
443 *
444 * Allowed transitions:
445 * PRESENT -> NOT_PRESENT
446 * NOT_PRESENT -> ENUMERATING
447 * NOT_PRESENT -> PRESENT
448 * ENUMERATING -> PRESENT
449 * ENUMERATING -> NOT_PRESENT
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800450 */
451typedef enum camera_device_status {
452 /**
453 * The camera device is not currently connected, and opening it will return
Zhijun He94e23b22015-01-12 14:45:33 -0800454 * failure.
455 *
456 * Version information (based on camera_module_t.common.module_api_version):
457 *
458 * CAMERA_MODULE_API_VERSION_2_3 or lower:
459 *
460 * Calls to get_camera_info must still succeed, and provide the same information
461 * it would if the camera were connected.
462 *
463 * CAMERA_MODULE_API_VERSION_2_4:
464 *
465 * The camera device at this status must return -EINVAL for get_camera_info call,
466 * as the device is not connected.
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800467 */
468 CAMERA_DEVICE_STATUS_NOT_PRESENT = 0,
469
470 /**
Zhijun He94e23b22015-01-12 14:45:33 -0800471 * The camera device is connected, and opening it will succeed.
472 *
473 * CAMERA_MODULE_API_VERSION_2_3 or lower:
474 *
475 * The information returned by get_camera_info cannot change due to this status
476 * change. By default, the framework will assume all devices are in this state.
477 *
478 * CAMERA_MODULE_API_VERSION_2_4:
479 *
480 * The information returned by get_camera_info will become valid after a device's
481 * status changes to this. By default, the framework will assume all devices are in
482 * this state.
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800483 */
Igor Murashkin152b50f2013-03-18 13:30:14 -0700484 CAMERA_DEVICE_STATUS_PRESENT = 1,
485
486 /**
487 * The camera device is connected, but it is undergoing an enumeration and
Zhijun He94e23b22015-01-12 14:45:33 -0800488 * so opening the device will return -EBUSY.
489 *
490 * CAMERA_MODULE_API_VERSION_2_3 or lower:
491 *
492 * Calls to get_camera_info must still succeed, as if the camera was in the
493 * PRESENT status.
494 *
495 * CAMERA_MODULE_API_VERSION_2_4:
496 *
497 * The camera device at this status must return -EINVAL for get_camera_info for call,
498 * as the device is not ready.
Igor Murashkin152b50f2013-03-18 13:30:14 -0700499 */
500 CAMERA_DEVICE_STATUS_ENUMERATING = 2,
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800501
502} camera_device_status_t;
503
504/**
Chien-Yu Chen30159172015-01-08 11:06:38 -0800505 * torch_mode_status_t:
506 *
507 * The current status of the torch mode, as provided by the HAL through the
508 * camera_module_callbacks.torch_mode_status_change() call.
509 *
510 * The torch mode status of a camera device is applicable only when the camera
511 * device is present. The framework will not call set_torch_mode() to turn on
512 * torch mode of a camera device if the camera device is not present. At module
513 * load time, the framework will assume torch modes are in the
Chien-Yu Chen5c6230e2015-06-03 13:36:33 -0700514 * TORCH_MODE_STATUS_AVAILABLE_OFF state if the camera device is present and
Chien-Yu Chen30159172015-01-08 11:06:38 -0800515 * android.flash.info.available is reported as true via get_camera_info() call.
516 *
517 * The behaviors of the camera HAL module that the framework expects in the
518 * following situations when a camera device's status changes:
519 * 1. A previously-disconnected camera device becomes connected.
520 * After camera_module_callbacks::camera_device_status_change() is invoked
521 * to inform the framework that the camera device is present, the framework
522 * will assume the camera device's torch mode is in
Chien-Yu Chen5c6230e2015-06-03 13:36:33 -0700523 * TORCH_MODE_STATUS_AVAILABLE_OFF state. The camera HAL module does not need
Chien-Yu Chen30159172015-01-08 11:06:38 -0800524 * to invoke camera_module_callbacks::torch_mode_status_change() unless the
525 * flash unit is unavailable to use by set_torch_mode().
526 *
527 * 2. A previously-connected camera becomes disconnected.
528 * After camera_module_callbacks::camera_device_status_change() is invoked
529 * to inform the framework that the camera device is not present, the
530 * framework will not call set_torch_mode() for the disconnected camera
531 * device until its flash unit becomes available again. The camera HAL
532 * module does not need to invoke
533 * camera_module_callbacks::torch_mode_status_change() separately to inform
534 * that the flash unit has become unavailable.
535 *
536 * 3. open() is called to open a camera device.
537 * The camera HAL module must invoke
538 * camera_module_callbacks::torch_mode_status_change() for all flash units
Chien-Yu Chen85585102015-02-25 14:50:13 -0800539 * that have entered TORCH_MODE_STATUS_NOT_AVAILABLE state and can not be
Chien-Yu Chen30159172015-01-08 11:06:38 -0800540 * turned on by calling set_torch_mode() anymore due to this open() call.
Chien-Yu Chen5c6230e2015-06-03 13:36:33 -0700541 * open() must not trigger TORCH_MODE_STATUS_AVAILABLE_OFF before
542 * TORCH_MODE_STATUS_NOT_AVAILABLE for all flash units that have become
543 * unavailable.
Chien-Yu Chen30159172015-01-08 11:06:38 -0800544 *
545 * 4. close() is called to close a camera device.
546 * The camera HAL module must invoke
547 * camera_module_callbacks::torch_mode_status_change() for all flash units
Chien-Yu Chen5c6230e2015-06-03 13:36:33 -0700548 * that have entered TORCH_MODE_STATUS_AVAILABLE_OFF state and can be turned
Chien-Yu Chen30159172015-01-08 11:06:38 -0800549 * on by calling set_torch_mode() again because of enough resources freed
550 * up by this close() call.
551 *
Chien-Yu Chen85585102015-02-25 14:50:13 -0800552 * Note that the framework calling set_torch_mode() successfully must trigger
Chien-Yu Chen5c6230e2015-06-03 13:36:33 -0700553 * TORCH_MODE_STATUS_AVAILABLE_OFF or TORCH_MODE_STATUS_AVAILABLE_ON callback
554 * for the given camera device. Additionally it must trigger
555 * TORCH_MODE_STATUS_AVAILABLE_OFF callbacks for other previously-on torch
556 * modes if HAL cannot keep multiple torch modes on simultaneously.
Chien-Yu Chen30159172015-01-08 11:06:38 -0800557 */
558typedef enum torch_mode_status {
Chien-Yu Chen30159172015-01-08 11:06:38 -0800559
560 /**
561 * The flash unit is no longer available and the torch mode can not be
562 * turned on by calling set_torch_mode(). If the torch mode is on, it
563 * will be turned off by HAL before HAL calls torch_mode_status_change().
564 */
Chien-Yu Chen85585102015-02-25 14:50:13 -0800565 TORCH_MODE_STATUS_NOT_AVAILABLE = 0,
Chien-Yu Chen30159172015-01-08 11:06:38 -0800566
Chien-Yu Chen46edf1a2015-01-29 15:12:47 -0800567 /**
Chien-Yu Chen85585102015-02-25 14:50:13 -0800568 * A torch mode has become off and available to be turned on via
569 * set_torch_mode(). This may happen in the following
570 * cases:
571 * 1. After the resources to turn on the torch mode have become available.
572 * 2. After set_torch_mode() is called to turn off the torch mode.
573 * 3. After the framework turned on the torch mode of some other camera
574 * device and HAL had to turn off the torch modes of any camera devices
575 * that were previously on.
Chien-Yu Chen46edf1a2015-01-29 15:12:47 -0800576 */
Chien-Yu Chen85585102015-02-25 14:50:13 -0800577 TORCH_MODE_STATUS_AVAILABLE_OFF = 1,
578
579 /**
580 * A torch mode has become on and available to be turned off via
581 * set_torch_mode(). This can happen only after set_torch_mode() is called
582 * to turn on the torch mode.
583 */
584 TORCH_MODE_STATUS_AVAILABLE_ON = 2,
Chien-Yu Chen46edf1a2015-01-29 15:12:47 -0800585
Chien-Yu Chen30159172015-01-08 11:06:38 -0800586} torch_mode_status_t;
587
588/**
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800589 * Callback functions for the camera HAL module to use to inform the framework
Chien-Yu Chen30159172015-01-08 11:06:38 -0800590 * of changes to the camera subsystem.
591 *
592 * Version information (based on camera_module_t.common.module_api_version):
593 *
594 * Each callback is called only by HAL modules implementing the indicated
595 * version or higher of the HAL module API interface.
596 *
597 * CAMERA_MODULE_API_VERSION_2_1:
598 * camera_device_status_change()
599 *
600 * CAMERA_MODULE_API_VERSION_2_4:
601 * torch_mode_status_change()
602
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800603 */
604typedef struct camera_module_callbacks {
605
606 /**
607 * camera_device_status_change:
608 *
609 * Callback to the framework to indicate that the state of a specific camera
610 * device has changed. At module load time, the framework will assume all
611 * camera devices are in the CAMERA_DEVICE_STATUS_PRESENT state. The HAL
612 * must call this method to inform the framework of any initially
613 * NOT_PRESENT devices.
614 *
Chien-Yu Chen30159172015-01-08 11:06:38 -0800615 * This callback is added for CAMERA_MODULE_API_VERSION_2_1.
616 *
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800617 * camera_module_callbacks: The instance of camera_module_callbacks_t passed
618 * to the module with set_callbacks.
619 *
620 * camera_id: The ID of the camera device that has a new status.
621 *
622 * new_status: The new status code, one of the camera_device_status_t enums,
623 * or a platform-specific status.
624 *
625 */
626 void (*camera_device_status_change)(const struct camera_module_callbacks*,
627 int camera_id,
628 int new_status);
629
Chien-Yu Chen30159172015-01-08 11:06:38 -0800630 /**
631 * torch_mode_status_change:
632 *
633 * Callback to the framework to indicate that the state of the torch mode
634 * of the flash unit associated with a specific camera device has changed.
635 * At module load time, the framework will assume the torch modes are in
Chien-Yu Chen5c6230e2015-06-03 13:36:33 -0700636 * the TORCH_MODE_STATUS_AVAILABLE_OFF state if android.flash.info.available
Chien-Yu Chen30159172015-01-08 11:06:38 -0800637 * is reported as true via get_camera_info() call.
638 *
639 * This callback is added for CAMERA_MODULE_API_VERSION_2_4.
640 *
641 * camera_module_callbacks: The instance of camera_module_callbacks_t
642 * passed to the module with set_callbacks.
643 *
644 * camera_id: The ID of camera device whose flash unit has a new torch mode
645 * status.
646 *
647 * new_status: The new status code, one of the torch_mode_status_t enums.
648 */
649 void (*torch_mode_status_change)(const struct camera_module_callbacks*,
650 const char* camera_id,
651 int new_status);
652
653
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800654} camera_module_callbacks_t;
655
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800656typedef struct camera_module {
Stewart Miles84d35492014-05-01 09:03:27 -0700657 /**
658 * Common methods of the camera module. This *must* be the first member of
659 * camera_module as users of this structure will cast a hw_module_t to
Eino-Ville Talvalac984be72014-07-24 16:44:56 -0700660 * camera_module pointer in contexts where it's known the hw_module_t
661 * references a camera_module.
662 *
663 * The return values for common.methods->open for camera_module are:
664 *
665 * 0: On a successful open of the camera device.
666 *
667 * -ENODEV: The camera device cannot be opened due to an internal
668 * error.
669 *
670 * -EINVAL: The input arguments are invalid, i.e. the id is invalid,
671 * and/or the module is invalid.
672 *
673 * -EBUSY: The camera device was already opened for this camera id
674 * (by using this method or open_legacy),
675 * regardless of the device HAL version it was opened as.
676 *
677 * -EUSERS: The maximal number of camera devices that can be
678 * opened concurrently were opened already, either by
679 * this method or the open_legacy method.
680 *
681 * All other return values from common.methods->open will be treated as
682 * -ENODEV.
Stewart Miles84d35492014-05-01 09:03:27 -0700683 */
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800684 hw_module_t common;
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800685
686 /**
687 * get_number_of_cameras:
688 *
689 * Returns the number of camera devices accessible through the camera
690 * module. The camera devices are numbered 0 through N-1, where N is the
691 * value returned by this call. The name of the camera device for open() is
692 * simply the number converted to a string. That is, "0" for camera ID 0,
693 * "1" for camera ID 1.
694 *
Zhijun He94e23b22015-01-12 14:45:33 -0800695 * Version information (based on camera_module_t.common.module_api_version):
696 *
697 * CAMERA_MODULE_API_VERSION_2_3 or lower:
698 *
699 * The value here must be static, and cannot change after the first call
700 * to this method.
701 *
702 * CAMERA_MODULE_API_VERSION_2_4 or higher:
703 *
704 * The value here must be static, and must count only built-in cameras,
705 * which have CAMERA_FACING_BACK or CAMERA_FACING_FRONT camera facing values
706 * (camera_info.facing). The HAL must not include the external cameras
707 * (camera_info.facing == CAMERA_FACING_EXTERNAL) into the return value
708 * of this call. Frameworks will use camera_device_status_change callback
709 * to manage number of external cameras.
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800710 */
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800711 int (*get_number_of_cameras)(void);
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800712
713 /**
714 * get_camera_info:
715 *
716 * Return the static camera information for a given camera device. This
717 * information may not change for a camera device.
718 *
Eino-Ville Talvalac984be72014-07-24 16:44:56 -0700719 * Return values:
720 *
721 * 0: On a successful operation
722 *
723 * -ENODEV: The information cannot be provided due to an internal
724 * error.
725 *
726 * -EINVAL: The input arguments are invalid, i.e. the id is invalid,
727 * and/or the module is invalid.
Zhijun He94e23b22015-01-12 14:45:33 -0800728 *
729 * Version information (based on camera_module_t.common.module_api_version):
730 *
731 * CAMERA_MODULE_API_VERSION_2_4 or higher:
732 *
733 * When a camera is disconnected, its camera id becomes invalid. Calling this
734 * this method with this invalid camera id will get -EINVAL and NULL camera
735 * static metadata (camera_info.static_camera_characteristics).
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800736 */
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800737 int (*get_camera_info)(int camera_id, struct camera_info *info);
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800738
739 /**
740 * set_callbacks:
741 *
742 * Provide callback function pointers to the HAL module to inform framework
743 * of asynchronous camera module events. The framework will call this
744 * function once after initial camera HAL module load, after the
745 * get_number_of_cameras() method is called for the first time, and before
746 * any other calls to the module.
747 *
748 * Version information (based on camera_module_t.common.module_api_version):
749 *
750 * CAMERA_MODULE_API_VERSION_1_0, CAMERA_MODULE_API_VERSION_2_0:
751 *
752 * Not provided by HAL module. Framework may not call this function.
753 *
754 * CAMERA_MODULE_API_VERSION_2_1:
755 *
756 * Valid to be called by the framework.
757 *
Eino-Ville Talvalac984be72014-07-24 16:44:56 -0700758 * Return values:
759 *
760 * 0: On a successful operation
761 *
762 * -ENODEV: The operation cannot be completed due to an internal
763 * error.
764 *
765 * -EINVAL: The input arguments are invalid, i.e. the callbacks are
766 * null
Eino-Ville Talvalad76f8af2013-02-13 15:29:48 -0800767 */
768 int (*set_callbacks)(const camera_module_callbacks_t *callbacks);
769
Alex Ray19b2cea2013-06-13 12:40:52 -0700770 /**
771 * get_vendor_tag_ops:
772 *
773 * Get methods to query for vendor extension metadata tag information. The
774 * HAL should fill in all the vendor tag operation methods, or leave ops
775 * unchanged if no vendor tags are defined.
776 *
Ruben Brunk61cf9eb2014-01-14 15:27:58 -0800777 * The vendor_tag_ops structure used here is defined in:
778 * system/media/camera/include/system/vendor_tags.h
779 *
Alex Ray19b2cea2013-06-13 12:40:52 -0700780 * Version information (based on camera_module_t.common.module_api_version):
781 *
782 * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1:
783 * Not provided by HAL module. Framework may not call this function.
784 *
785 * CAMERA_MODULE_API_VERSION_2_2:
786 * Valid to be called by the framework.
787 */
788 void (*get_vendor_tag_ops)(vendor_tag_ops_t* ops);
789
Zhijun Hebcdebf32014-06-06 15:42:17 -0700790 /**
791 * open_legacy:
792 *
793 * Open a specific legacy camera HAL device if multiple device HAL API
794 * versions are supported by this camera HAL module. For example, if the
795 * camera module supports both CAMERA_DEVICE_API_VERSION_1_0 and
796 * CAMERA_DEVICE_API_VERSION_3_2 device API for the same camera id,
797 * framework can call this function to open the camera device as
798 * CAMERA_DEVICE_API_VERSION_1_0 device.
799 *
800 * This is an optional method. A Camera HAL module does not need to support
801 * more than one device HAL version per device, and such modules may return
802 * -ENOSYS for all calls to this method. For all older HAL device API
803 * versions that are not supported, it may return -EOPNOTSUPP. When above
804 * cases occur, The normal open() method (common.methods->open) will be
805 * used by the framework instead.
806 *
807 * Version information (based on camera_module_t.common.module_api_version):
808 *
809 * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2:
810 * Not provided by HAL module. Framework will not call this function.
811 *
812 * CAMERA_MODULE_API_VERSION_2_3:
813 * Valid to be called by the framework.
814 *
815 * Return values:
816 *
817 * 0: On a successful open of the camera device.
818 *
819 * -ENOSYS This method is not supported.
820 *
821 * -EOPNOTSUPP: The requested HAL version is not supported by this method.
822 *
823 * -EINVAL: The input arguments are invalid, i.e. the id is invalid,
824 * and/or the module is invalid.
825 *
826 * -EBUSY: The camera device was already opened for this camera id
827 * (by using this method or common.methods->open method),
828 * regardless of the device HAL version it was opened as.
829 *
830 * -EUSERS: The maximal number of camera devices that can be
831 * opened concurrently were opened already, either by
832 * this method or common.methods->open method.
833 */
834 int (*open_legacy)(const struct hw_module_t* module, const char* id,
835 uint32_t halVersion, struct hw_device_t** device);
836
Chien-Yu Chen30159172015-01-08 11:06:38 -0800837 /**
838 * set_torch_mode:
839 *
840 * Turn on or off the torch mode of the flash unit associated with a given
Chien-Yu Chen85585102015-02-25 14:50:13 -0800841 * camera ID. If the operation is successful, HAL must notify the framework
842 * torch state by invoking
843 * camera_module_callbacks.torch_mode_status_change() with the new state.
Chien-Yu Chen30159172015-01-08 11:06:38 -0800844 *
845 * The camera device has a higher priority accessing the flash unit. When
846 * there are any resource conflicts, such as open() is called to open a
847 * camera device, HAL module must notify the framework through
848 * camera_module_callbacks.torch_mode_status_change() that the
849 * torch mode has been turned off and the torch mode state has become
Chien-Yu Chen85585102015-02-25 14:50:13 -0800850 * TORCH_MODE_STATUS_NOT_AVAILABLE. When resources to turn on torch mode
Chien-Yu Chen30159172015-01-08 11:06:38 -0800851 * become available again, HAL module must notify the framework through
852 * camera_module_callbacks.torch_mode_status_change() that the torch mode
Chien-Yu Chen5c6230e2015-06-03 13:36:33 -0700853 * state has become TORCH_MODE_STATUS_AVAILABLE_OFF for set_torch_mode() to
854 * be called.
Chien-Yu Chen30159172015-01-08 11:06:38 -0800855 *
Chien-Yu Chen46edf1a2015-01-29 15:12:47 -0800856 * When the framework calls set_torch_mode() to turn on the torch mode of a
857 * flash unit, if HAL cannot keep multiple torch modes on simultaneously,
858 * HAL should turn off the torch mode that was turned on by
859 * a previous set_torch_mode() call and notify the framework that the torch
Chien-Yu Chen5c6230e2015-06-03 13:36:33 -0700860 * mode state of that flash unit has become TORCH_MODE_STATUS_AVAILABLE_OFF.
Chien-Yu Chen46edf1a2015-01-29 15:12:47 -0800861 *
Chien-Yu Chen30159172015-01-08 11:06:38 -0800862 * Version information (based on camera_module_t.common.module_api_version):
863 *
864 * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2/2_3:
865 * Not provided by HAL module. Framework will not call this function.
866 *
867 * CAMERA_MODULE_API_VERSION_2_4:
868 * Valid to be called by the framework.
869 *
870 * Return values:
871 *
872 * 0: On a successful operation.
873 *
874 * -ENOSYS: The camera device does not support this operation. It is
875 * returned if and only if android.flash.info.available is
876 * false.
877 *
Chien-Yu Chen273def32015-02-11 11:31:12 -0800878 * -EBUSY: The camera device is already in use.
879 *
880 * -EUSERS: The resources needed to turn on the torch mode are not
881 * available, typically because other camera devices are
882 * holding the resources to make using the flash unit not
883 * possible.
Chien-Yu Chen30159172015-01-08 11:06:38 -0800884 *
885 * -EINVAL: camera_id is invalid.
886 *
887 */
Chien-Yu Chen46edf1a2015-01-29 15:12:47 -0800888 int (*set_torch_mode)(const char* camera_id, bool enabled);
Chien-Yu Chen30159172015-01-08 11:06:38 -0800889
Eino-Ville Talvalaaee47822015-04-07 13:47:46 -0700890 /**
891 * init:
892 *
893 * This method is called by the camera service before any other methods
894 * are invoked, right after the camera HAL library has been successfully
895 * loaded. It may be left as NULL by the HAL module, if no initialization
896 * in needed.
897 *
898 * It can be used by HAL implementations to perform initialization and
899 * other one-time operations.
900 *
901 * Version information (based on camera_module_t.common.module_api_version):
902 *
903 * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2/2_3:
904 * Not provided by HAL module. Framework will not call this function.
905 *
906 * CAMERA_MODULE_API_VERSION_2_4:
907 * If not NULL, will always be called by the framework once after the HAL
908 * module is loaded, before any other HAL module method is called.
909 *
910 * Return values:
911 *
912 * 0: On a successful operation.
913 *
914 * -ENODEV: Initialization cannot be completed due to an internal
915 * error. The HAL must be assumed to be in a nonfunctional
916 * state.
917 *
918 */
919 int (*init)();
920
Shuzhen Wanga8caa6a2018-08-24 11:07:50 -0700921 /**
922 * get_physical_camera_info:
923 *
924 * Return the static metadata for a physical camera as a part of a logical
925 * camera device. This function is only called for those physical camera
926 * ID(s) that are not exposed independently. In other words, camera_id will
927 * be greater or equal to the return value of get_number_of_cameras().
928 *
929 * Return values:
930 *
931 * 0: On a successful operation
932 *
933 * -ENODEV: The information cannot be provided due to an internal
934 * error.
935 *
936 * -EINVAL: The input arguments are invalid, i.e. the id is invalid,
937 * and/or the module is invalid.
938 *
939 * Version information (based on camera_module_t.common.module_api_version):
940 *
941 * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1/2_2/2_3/2_4:
942 * Not provided by HAL module. Framework will not call this function.
943 *
944 * CAMERA_MODULE_API_VERSION_2_5 or higher:
945 * If any of the camera devices accessible through this camera module is
946 * a logical multi-camera, and at least one of the physical cameras isn't
947 * a stand-alone camera device, this function will be called by the camera
948 * framework. Calling this function with invalid physical_camera_id will
949 * get -EINVAL, and NULL static_metadata.
950 */
951 int (*get_physical_camera_info)(int physical_camera_id,
952 camera_metadata_t **static_metadata);
953
Alex Ray19b2cea2013-06-13 12:40:52 -0700954 /* reserved for future use */
Shuzhen Wanga8caa6a2018-08-24 11:07:50 -0700955 void* reserved[4];
Eino-Ville Talvala8bf364e2011-12-22 13:50:37 -0800956} camera_module_t;
957
958__END_DECLS
959
960#endif /* ANDROID_INCLUDE_CAMERA_COMMON_H */