xref: /aosp_15_r20/hardware/interfaces/camera/device/README.md (revision 4d7e907c777eeecc4c5bd7cf640a754fac206ff7)
1*4d7e907cSAndroid Build Coastguard Worker## Camera Device HAL ##
2*4d7e907cSAndroid Build Coastguard Worker---
3*4d7e907cSAndroid Build Coastguard Worker
4*4d7e907cSAndroid Build Coastguard Worker## Overview: ##
5*4d7e907cSAndroid Build Coastguard Worker
6*4d7e907cSAndroid Build Coastguard WorkerThe camera.device HAL interface is used by the Android camera service to operate
7*4d7e907cSAndroid Build Coastguard Workerindividual camera devices. Instances of camera.device HAL interface can be obtained
8*4d7e907cSAndroid Build Coastguard Workervia one of the ICameraProvider::getCameraDeviceInterface_V<N>_x() methods, where N
9*4d7e907cSAndroid Build Coastguard Workeris the major version of the camera device interface.
10*4d7e907cSAndroid Build Coastguard Worker
11*4d7e907cSAndroid Build Coastguard WorkerObtaining the device interface does not turn on the respective camera device;
12*4d7e907cSAndroid Build Coastguard Workereach camera device interface has an actual open() method to begin an active
13*4d7e907cSAndroid Build Coastguard Workercamera session. Without invoking open(), the interface can be used for querying
14*4d7e907cSAndroid Build Coastguard Workercamera static information.
15*4d7e907cSAndroid Build Coastguard Worker
16*4d7e907cSAndroid Build Coastguard WorkerMore complete information about the Android camera HAL and subsystem can be found at
17*4d7e907cSAndroid Build Coastguard Worker[source.android.com](http://source.android.com/devices/camera/index.html).
18*4d7e907cSAndroid Build Coastguard Worker
19*4d7e907cSAndroid Build Coastguard Worker## Version history: ##
20*4d7e907cSAndroid Build Coastguard Worker
21*4d7e907cSAndroid Build Coastguard Worker### [email protected]:
22*4d7e907cSAndroid Build Coastguard Worker
23*4d7e907cSAndroid Build Coastguard WorkerHIDL version of the legacy camera device HAL. Intended as a shim for devices
24*4d7e907cSAndroid Build Coastguard Workerneeding to use the deprecated pre-HIDL camera device HAL v1.0.
25*4d7e907cSAndroid Build Coastguard Worker
26*4d7e907cSAndroid Build Coastguard WorkerMay be used in HIDL passthrough mode for devices upgrading to the Android O
27*4d7e907cSAndroid Build Coastguard Workerrelease; must be used in binderized mode for devices launching in the O release.
28*4d7e907cSAndroid Build Coastguard Worker
29*4d7e907cSAndroid Build Coastguard WorkerIt is strongly recommended to not use this interface for new devices, as new
30*4d7e907cSAndroid Build Coastguard Workerdevices may not use this interface starting with the Android P release, and all
31*4d7e907cSAndroid Build Coastguard Workersupport for [email protected] will be removed with the Android R release.
32*4d7e907cSAndroid Build Coastguard Worker
33*4d7e907cSAndroid Build Coastguard WorkerThis HAL interface version only allows support at the LEGACY level for the
34*4d7e907cSAndroid Build Coastguard Workerandroid.hardware.camera2 API.
35*4d7e907cSAndroid Build Coastguard Worker
36*4d7e907cSAndroid Build Coastguard WorkerAdded in Android 8.0.
37*4d7e907cSAndroid Build Coastguard Worker
38*4d7e907cSAndroid Build Coastguard WorkerSubsidiary HALs:
39*4d7e907cSAndroid Build Coastguard Worker
40*4d7e907cSAndroid Build Coastguard Worker#### [email protected]:
41*4d7e907cSAndroid Build Coastguard Worker
42*4d7e907cSAndroid Build Coastguard WorkerCallback interface for obtaining, filling, and returning graphics buffers for
43*4d7e907cSAndroid Build Coastguard Workerpreview operation with the [email protected] inteface.
44*4d7e907cSAndroid Build Coastguard Worker
45*4d7e907cSAndroid Build Coastguard Worker#### [email protected]:
46*4d7e907cSAndroid Build Coastguard Worker
47*4d7e907cSAndroid Build Coastguard WorkerCallback interface for sending events and data buffers from the HAL to the
48*4d7e907cSAndroid Build Coastguard Workercamera service.
49*4d7e907cSAndroid Build Coastguard Worker
50*4d7e907cSAndroid Build Coastguard Worker### [email protected]:
51*4d7e907cSAndroid Build Coastguard Worker
52*4d7e907cSAndroid Build Coastguard WorkerHIDL version of the baseline camera device HAL, required for LIMITED or FULL
53*4d7e907cSAndroid Build Coastguard Workeroperation through the android.hardware.camera2 API.
54*4d7e907cSAndroid Build Coastguard Worker
55*4d7e907cSAndroid Build Coastguard WorkerThe main HAL contains methods for static queries about the device, similar to
56*4d7e907cSAndroid Build Coastguard Workerthe HALv3-specific sections of the legacy camera module HAL. Simply obtaining an
57*4d7e907cSAndroid Build Coastguard Workerinstance of the camera device interface does not turn on the camera device.
58*4d7e907cSAndroid Build Coastguard Worker
59*4d7e907cSAndroid Build Coastguard WorkerMay be used in passthrough mode for devices upgrading to the Android O release;
60*4d7e907cSAndroid Build Coastguard Workermust be used in binderized mode for all new devices launching with Android O or
61*4d7e907cSAndroid Build Coastguard Workerlater.
62*4d7e907cSAndroid Build Coastguard Worker
63*4d7e907cSAndroid Build Coastguard WorkerThe open() method actually opens the camera device for use, returning a Session
64*4d7e907cSAndroid Build Coastguard Workerinterface for operating the active camera. It takes a Callback interface as an
65*4d7e907cSAndroid Build Coastguard Workerargument.
66*4d7e907cSAndroid Build Coastguard Worker
67*4d7e907cSAndroid Build Coastguard WorkerAdded in Android 8.0.
68*4d7e907cSAndroid Build Coastguard Worker
69*4d7e907cSAndroid Build Coastguard WorkerSubsidiary HALs:
70*4d7e907cSAndroid Build Coastguard Worker
71*4d7e907cSAndroid Build Coastguard Worker#### [email protected]:
72*4d7e907cSAndroid Build Coastguard Worker
73*4d7e907cSAndroid Build Coastguard WorkerClosely matches the features and operation of the pre-HIDL camera device HAL
74*4d7e907cSAndroid Build Coastguard Workerv3.2, containing methods for configuring an active camera device and submitting
75*4d7e907cSAndroid Build Coastguard Workercapture requests to it.
76*4d7e907cSAndroid Build Coastguard Worker
77*4d7e907cSAndroid Build Coastguard Worker#### [email protected]:
78*4d7e907cSAndroid Build Coastguard Worker
79*4d7e907cSAndroid Build Coastguard WorkerCallback interface for sending completed captures and other asynchronous events
80*4d7e907cSAndroid Build Coastguard Workerfrom tehe HAL to the client.
81*4d7e907cSAndroid Build Coastguard Worker
82*4d7e907cSAndroid Build Coastguard Worker### [email protected]:
83*4d7e907cSAndroid Build Coastguard Worker
84*4d7e907cSAndroid Build Coastguard WorkerA minor revision to the [email protected].
85*4d7e907cSAndroid Build Coastguard Worker
86*4d7e907cSAndroid Build Coastguard Worker  - Adds support for overriding the output dataspace of a stream, which was
87*4d7e907cSAndroid Build Coastguard Worker    supported in the legacy camera HAL.
88*4d7e907cSAndroid Build Coastguard Worker
89*4d7e907cSAndroid Build Coastguard WorkerAdded in Android 8.1.
90*4d7e907cSAndroid Build Coastguard Worker
91*4d7e907cSAndroid Build Coastguard Worker### [email protected]:
92*4d7e907cSAndroid Build Coastguard Worker
93*4d7e907cSAndroid Build Coastguard WorkerA minor revision to the [email protected].
94*4d7e907cSAndroid Build Coastguard Worker
95*4d7e907cSAndroid Build Coastguard Worker  - Adds support for session parameters during stream configuration.
96*4d7e907cSAndroid Build Coastguard Worker
97*4d7e907cSAndroid Build Coastguard WorkerAdded in Android 9
98