OSDN Git Service

11304114524b0b180b51f6b45e3e6ba0a4ec49d3
[android-x86/system-media.git] / camera / docs / metadata_definitions.xml
1 <?xml version="1.0" encoding="utf-8"?>
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 <metadata xmlns="http://schemas.android.com/service/camera/metadata/"
17 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18 xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata_properties.xsd">
19
20   <tags>
21     <tag id="BC">
22         Needed for backwards compatibility with old Java API
23     </tag>
24     <tag id="V1">
25         New features for first camera 2 release (API1)
26     </tag>
27     <tag id="RAW">
28         Needed for useful RAW image processing and DNG file support
29     </tag>
30     <tag id="HAL2">
31         Entry is only used by camera device legacy HAL 2.x
32     </tag>
33     <tag id="FULL">
34         Entry is required for full hardware level devices, and optional for other hardware levels
35     </tag>
36     <tag id="DEPTH">
37         Entry is required for the depth capability.
38     </tag>
39     <tag id="REPROC">
40         Entry is required for the YUV or PRIVATE reprocessing capability.
41     </tag>
42     <tag id="LOGICALCAMERA">
43         Entry is required for logical multi-camera capability.
44     </tag>
45     <tag id="FUTURE">
46         Entry is  under-specified and is not required for now. This is for book-keeping purpose,
47         do not implement or use it, it may be revised for future.
48     </tag>
49   </tags>
50
51   <types>
52     <typedef name="pairFloatFloat">
53       <language name="java">android.util.Pair&lt;Float,Float&gt;</language>
54     </typedef>
55     <typedef name="pairDoubleDouble">
56       <language name="java">android.util.Pair&lt;Double,Double&gt;</language>
57     </typedef>
58     <typedef name="rectangle">
59       <language name="java">android.graphics.Rect</language>
60     </typedef>
61     <typedef name="size">
62       <language name="java">android.util.Size</language>
63     </typedef>
64     <typedef name="string">
65       <language name="java">String</language>
66     </typedef>
67     <typedef name="boolean">
68       <language name="java">boolean</language>
69     </typedef>
70     <typedef name="imageFormat">
71       <language name="java">int</language>
72     </typedef>
73     <typedef name="streamConfigurationMap">
74       <language name="java">android.hardware.camera2.params.StreamConfigurationMap</language>
75     </typedef>
76     <typedef name="streamConfiguration">
77       <language name="java">android.hardware.camera2.params.StreamConfiguration</language>
78     </typedef>
79     <typedef name="streamConfigurationDuration">
80       <language name="java">android.hardware.camera2.params.StreamConfigurationDuration</language>
81     </typedef>
82     <typedef name="face">
83       <language name="java">android.hardware.camera2.params.Face</language>
84     </typedef>
85     <typedef name="meteringRectangle">
86       <language name="java">android.hardware.camera2.params.MeteringRectangle</language>
87     </typedef>
88     <typedef name="rangeFloat">
89       <language name="java">android.util.Range&lt;Float&gt;</language>
90     </typedef>
91     <typedef name="rangeInt">
92       <language name="java">android.util.Range&lt;Integer&gt;</language>
93     </typedef>
94     <typedef name="rangeLong">
95       <language name="java">android.util.Range&lt;Long&gt;</language>
96     </typedef>
97     <typedef name="colorSpaceTransform">
98       <language name="java">android.hardware.camera2.params.ColorSpaceTransform</language>
99     </typedef>
100     <typedef name="rggbChannelVector">
101       <language name="java">android.hardware.camera2.params.RggbChannelVector</language>
102     </typedef>
103     <typedef name="blackLevelPattern">
104       <language name="java">android.hardware.camera2.params.BlackLevelPattern</language>
105     </typedef>
106     <typedef name="enumList">
107       <language name="java">int</language>
108     </typedef>
109     <typedef name="sizeF">
110       <language name="java">android.util.SizeF</language>
111     </typedef>
112     <typedef name="point">
113       <language name="java">android.graphics.Point</language>
114     </typedef>
115     <typedef name="tonemapCurve">
116       <language name="java">android.hardware.camera2.params.TonemapCurve</language>
117     </typedef>
118     <typedef name="lensShadingMap">
119       <language name="java">android.hardware.camera2.params.LensShadingMap</language>
120     </typedef>
121     <typedef name="location">
122       <language name="java">android.location.Location</language>
123     </typedef>
124     <typedef name="highSpeedVideoConfiguration">
125       <language name="java">android.hardware.camera2.params.HighSpeedVideoConfiguration</language>
126     </typedef>
127     <typedef name="reprocessFormatsMap">
128       <language name="java">android.hardware.camera2.params.ReprocessFormatsMap</language>
129     </typedef>
130   </types>
131
132   <namespace name="android">
133     <section name="colorCorrection">
134       <controls>
135         <entry name="mode" type="byte" visibility="public" enum="true" hwlevel="full">
136           <enum>
137             <value>TRANSFORM_MATRIX
138               <notes>Use the android.colorCorrection.transform matrix
139                 and android.colorCorrection.gains to do color conversion.
140
141                 All advanced white balance adjustments (not specified
142                 by our white balance pipeline) must be disabled.
143
144                 If AWB is enabled with `android.control.awbMode != OFF`, then
145                 TRANSFORM_MATRIX is ignored. The camera device will override
146                 this value to either FAST or HIGH_QUALITY.
147               </notes>
148             </value>
149             <value>FAST
150               <notes>Color correction processing must not slow down
151               capture rate relative to sensor raw output.
152
153               Advanced white balance adjustments above and beyond
154               the specified white balance pipeline may be applied.
155
156               If AWB is enabled with `android.control.awbMode != OFF`, then
157               the camera device uses the last frame's AWB values
158               (or defaults if AWB has never been run).
159             </notes>
160             </value>
161             <value>HIGH_QUALITY
162               <notes>Color correction processing operates at improved
163               quality but the capture rate might be reduced (relative to sensor
164               raw output rate)
165
166               Advanced white balance adjustments above and beyond
167               the specified white balance pipeline may be applied.
168
169               If AWB is enabled with `android.control.awbMode != OFF`, then
170               the camera device uses the last frame's AWB values
171               (or defaults if AWB has never been run).
172             </notes>
173             </value>
174           </enum>
175
176           <description>
177           The mode control selects how the image data is converted from the
178           sensor's native color into linear sRGB color.
179           </description>
180           <details>
181           When auto-white balance (AWB) is enabled with android.control.awbMode, this
182           control is overridden by the AWB routine. When AWB is disabled, the
183           application controls how the color mapping is performed.
184
185           We define the expected processing pipeline below. For consistency
186           across devices, this is always the case with TRANSFORM_MATRIX.
187
188           When either FULL or HIGH_QUALITY is used, the camera device may
189           do additional processing but android.colorCorrection.gains and
190           android.colorCorrection.transform will still be provided by the
191           camera device (in the results) and be roughly correct.
192
193           Switching to TRANSFORM_MATRIX and using the data provided from
194           FAST or HIGH_QUALITY will yield a picture with the same white point
195           as what was produced by the camera device in the earlier frame.
196
197           The expected processing pipeline is as follows:
198
199           ![White balance processing pipeline](android.colorCorrection.mode/processing_pipeline.png)
200
201           The white balance is encoded by two values, a 4-channel white-balance
202           gain vector (applied in the Bayer domain), and a 3x3 color transform
203           matrix (applied after demosaic).
204
205           The 4-channel white-balance gains are defined as:
206
207               android.colorCorrection.gains = [ R G_even G_odd B ]
208
209           where `G_even` is the gain for green pixels on even rows of the
210           output, and `G_odd` is the gain for green pixels on the odd rows.
211           These may be identical for a given camera device implementation; if
212           the camera device does not support a separate gain for even/odd green
213           channels, it will use the `G_even` value, and write `G_odd` equal to
214           `G_even` in the output result metadata.
215
216           The matrices for color transforms are defined as a 9-entry vector:
217
218               android.colorCorrection.transform = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
219
220           which define a transform from input sensor colors, `P_in = [ r g b ]`,
221           to output linear sRGB, `P_out = [ r' g' b' ]`,
222
223           with colors as follows:
224
225               r' = I0r + I1g + I2b
226               g' = I3r + I4g + I5b
227               b' = I6r + I7g + I8b
228
229           Both the input and output value ranges must match. Overflow/underflow
230           values are clipped to fit within the range.
231           </details>
232           <hal_details>
233           HAL must support both FAST and HIGH_QUALITY if color correction control is available
234           on the camera device, but the underlying implementation can be the same for both modes.
235           That is, if the highest quality implementation on the camera device does not slow down
236           capture rate, then FAST and HIGH_QUALITY should generate the same output.
237           </hal_details>
238         </entry>
239         <entry name="transform" type="rational" visibility="public"
240                type_notes="3x3 rational matrix in row-major order"
241                container="array" typedef="colorSpaceTransform" hwlevel="full">
242           <array>
243             <size>3</size>
244             <size>3</size>
245           </array>
246           <description>A color transform matrix to use to transform
247           from sensor RGB color space to output linear sRGB color space.
248           </description>
249           <units>Unitless scale factors</units>
250           <details>This matrix is either set by the camera device when the request
251           android.colorCorrection.mode is not TRANSFORM_MATRIX, or
252           directly by the application in the request when the
253           android.colorCorrection.mode is TRANSFORM_MATRIX.
254
255           In the latter case, the camera device may round the matrix to account
256           for precision issues; the final rounded matrix should be reported back
257           in this matrix result metadata. The transform should keep the magnitude
258           of the output color values within `[0, 1.0]` (assuming input color
259           values is within the normalized range `[0, 1.0]`), or clipping may occur.
260
261           The valid range of each matrix element varies on different devices, but
262           values within [-1.5, 3.0] are guaranteed not to be clipped.
263           </details>
264         </entry>
265         <entry name="gains" type="float" visibility="public"
266                type_notes="A 1D array of floats for 4 color channel gains"
267                container="array" typedef="rggbChannelVector" hwlevel="full">
268           <array>
269             <size>4</size>
270           </array>
271           <description>Gains applying to Bayer raw color channels for
272           white-balance.</description>
273           <units>Unitless gain factors</units>
274           <details>
275           These per-channel gains are either set by the camera device
276           when the request android.colorCorrection.mode is not
277           TRANSFORM_MATRIX, or directly by the application in the
278           request when the android.colorCorrection.mode is
279           TRANSFORM_MATRIX.
280
281           The gains in the result metadata are the gains actually
282           applied by the camera device to the current frame.
283
284           The valid range of gains varies on different devices, but gains
285           between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
286           device allows gains below 1.0, this is usually not recommended because
287           this can create color artifacts.
288           </details>
289           <hal_details>
290           The 4-channel white-balance gains are defined in
291           the order of `[R G_even G_odd B]`, where `G_even` is the gain
292           for green pixels on even rows of the output, and `G_odd`
293           is the gain for green pixels on the odd rows.
294
295           If a HAL does not support a separate gain for even/odd green
296           channels, it must use the `G_even` value, and write
297           `G_odd` equal to `G_even` in the output result metadata.
298           </hal_details>
299         </entry>
300         <entry name="aberrationMode" type="byte" visibility="public" enum="true" hwlevel="legacy">
301           <enum>
302             <value>OFF
303               <notes>
304                 No aberration correction is applied.
305               </notes>
306             </value>
307             <value>FAST
308               <notes>
309                 Aberration correction will not slow down capture rate
310                 relative to sensor raw output.
311             </notes>
312             </value>
313             <value>HIGH_QUALITY
314               <notes>
315                 Aberration correction operates at improved quality but the capture rate might be
316                 reduced (relative to sensor raw output rate)
317             </notes>
318             </value>
319           </enum>
320           <description>
321             Mode of operation for the chromatic aberration correction algorithm.
322           </description>
323           <range>android.colorCorrection.availableAberrationModes</range>
324           <details>
325             Chromatic (color) aberration is caused by the fact that different wavelengths of light
326             can not focus on the same point after exiting from the lens. This metadata defines
327             the high level control of chromatic aberration correction algorithm, which aims to
328             minimize the chromatic artifacts that may occur along the object boundaries in an
329             image.
330
331             FAST/HIGH_QUALITY both mean that camera device determined aberration
332             correction will be applied. HIGH_QUALITY mode indicates that the camera device will
333             use the highest-quality aberration correction algorithms, even if it slows down
334             capture rate. FAST means the camera device will not slow down capture rate when
335             applying aberration correction.
336
337             LEGACY devices will always be in FAST mode.
338           </details>
339         </entry>
340       </controls>
341       <dynamic>
342         <clone entry="android.colorCorrection.mode" kind="controls">
343         </clone>
344         <clone entry="android.colorCorrection.transform" kind="controls">
345         </clone>
346         <clone entry="android.colorCorrection.gains" kind="controls">
347         </clone>
348         <clone entry="android.colorCorrection.aberrationMode" kind="controls">
349         </clone>
350       </dynamic>
351       <static>
352         <entry name="availableAberrationModes" type="byte" visibility="public"
353         type_notes="list of enums" container="array" typedef="enumList" hwlevel="legacy">
354           <array>
355             <size>n</size>
356           </array>
357           <description>
358             List of aberration correction modes for android.colorCorrection.aberrationMode that are
359             supported by this camera device.
360           </description>
361           <range>Any value listed in android.colorCorrection.aberrationMode</range>
362           <details>
363             This key lists the valid modes for android.colorCorrection.aberrationMode.  If no
364             aberration correction modes are available for a device, this list will solely include
365             OFF mode. All camera devices will support either OFF or FAST mode.
366
367             Camera devices that support the MANUAL_POST_PROCESSING capability will always list
368             OFF mode. This includes all FULL level devices.
369
370             LEGACY devices will always only support FAST mode.
371           </details>
372           <hal_details>
373             HAL must support both FAST and HIGH_QUALITY if chromatic aberration control is available
374             on the camera device, but the underlying implementation can be the same for both modes.
375             That is, if the highest quality implementation on the camera device does not slow down
376             capture rate, then FAST and HIGH_QUALITY will generate the same output.
377           </hal_details>
378           <tag id="V1" />
379         </entry>
380       </static>
381     </section>
382     <section name="control">
383       <controls>
384         <entry name="aeAntibandingMode" type="byte" visibility="public"
385                enum="true" hwlevel="legacy">
386           <enum>
387             <value>OFF
388               <notes>
389                 The camera device will not adjust exposure duration to
390                 avoid banding problems.
391               </notes>
392             </value>
393             <value>50HZ
394               <notes>
395                 The camera device will adjust exposure duration to
396                 avoid banding problems with 50Hz illumination sources.
397               </notes>
398             </value>
399             <value>60HZ
400               <notes>
401                 The camera device will adjust exposure duration to
402                 avoid banding problems with 60Hz illumination
403                 sources.
404               </notes>
405             </value>
406             <value>AUTO
407               <notes>
408                 The camera device will automatically adapt its
409                 antibanding routine to the current illumination
410                 condition. This is the default mode if AUTO is
411                 available on given camera device.
412               </notes>
413             </value>
414           </enum>
415           <description>
416             The desired setting for the camera device's auto-exposure
417             algorithm's antibanding compensation.
418           </description>
419           <range>
420             android.control.aeAvailableAntibandingModes
421           </range>
422           <details>
423             Some kinds of lighting fixtures, such as some fluorescent
424             lights, flicker at the rate of the power supply frequency
425             (60Hz or 50Hz, depending on country). While this is
426             typically not noticeable to a person, it can be visible to
427             a camera device. If a camera sets its exposure time to the
428             wrong value, the flicker may become visible in the
429             viewfinder as flicker or in a final captured image, as a
430             set of variable-brightness bands across the image.
431
432             Therefore, the auto-exposure routines of camera devices
433             include antibanding routines that ensure that the chosen
434             exposure value will not cause such banding. The choice of
435             exposure time depends on the rate of flicker, which the
436             camera device can detect automatically, or the expected
437             rate can be selected by the application using this
438             control.
439
440             A given camera device may not support all of the possible
441             options for the antibanding mode. The
442             android.control.aeAvailableAntibandingModes key contains
443             the available modes for a given camera device.
444
445             AUTO mode is the default if it is available on given
446             camera device. When AUTO mode is not available, the
447             default will be either 50HZ or 60HZ, and both 50HZ
448             and 60HZ will be available.
449
450             If manual exposure control is enabled (by setting
451             android.control.aeMode or android.control.mode to OFF),
452             then this setting has no effect, and the application must
453             ensure it selects exposure times that do not cause banding
454             issues. The android.statistics.sceneFlicker key can assist
455             the application in this.
456           </details>
457           <hal_details>
458             For all capture request templates, this field must be set
459             to AUTO if AUTO mode is available. If AUTO is not available,
460             the default must be either 50HZ or 60HZ, and both 50HZ and
461             60HZ must be available.
462
463             If manual exposure control is enabled (by setting
464             android.control.aeMode or android.control.mode to OFF),
465             then the exposure values provided by the application must not be
466             adjusted for antibanding.
467           </hal_details>
468           <tag id="BC" />
469         </entry>
470         <entry name="aeExposureCompensation" type="int32" visibility="public" hwlevel="legacy">
471           <description>Adjustment to auto-exposure (AE) target image
472           brightness.</description>
473           <units>Compensation steps</units>
474           <range>android.control.aeCompensationRange</range>
475           <details>
476           The adjustment is measured as a count of steps, with the
477           step size defined by android.control.aeCompensationStep and the
478           allowed range by android.control.aeCompensationRange.
479
480           For example, if the exposure value (EV) step is 0.333, '6'
481           will mean an exposure compensation of +2 EV; -3 will mean an
482           exposure compensation of -1 EV. One EV represents a doubling
483           of image brightness. Note that this control will only be
484           effective if android.control.aeMode `!=` OFF. This control
485           will take effect even when android.control.aeLock `== true`.
486
487           In the event of exposure compensation value being changed, camera device
488           may take several frames to reach the newly requested exposure target.
489           During that time, android.control.aeState field will be in the SEARCHING
490           state. Once the new exposure target is reached, android.control.aeState will
491           change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
492           FLASH_REQUIRED (if the scene is too dark for still capture).
493           </details>
494           <tag id="BC" />
495         </entry>
496         <entry name="aeLock" type="byte" visibility="public" enum="true"
497                typedef="boolean" hwlevel="legacy">
498           <enum>
499             <value>OFF
500             <notes>Auto-exposure lock is disabled; the AE algorithm
501             is free to update its parameters.</notes></value>
502             <value>ON
503             <notes>Auto-exposure lock is enabled; the AE algorithm
504             must not update the exposure and sensitivity parameters
505             while the lock is active.
506
507             android.control.aeExposureCompensation setting changes
508             will still take effect while auto-exposure is locked.
509
510             Some rare LEGACY devices may not support
511             this, in which case the value will always be overridden to OFF.
512             </notes></value>
513           </enum>
514           <description>Whether auto-exposure (AE) is currently locked to its latest
515           calculated values.</description>
516           <details>
517           When set to `true` (ON), the AE algorithm is locked to its latest parameters,
518           and will not change exposure settings until the lock is set to `false` (OFF).
519
520           Note that even when AE is locked, the flash may be fired if
521           the android.control.aeMode is ON_AUTO_FLASH /
522           ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.
523
524           When android.control.aeExposureCompensation is changed, even if the AE lock
525           is ON, the camera device will still adjust its exposure value.
526
527           If AE precapture is triggered (see android.control.aePrecaptureTrigger)
528           when AE is already locked, the camera device will not change the exposure time
529           (android.sensor.exposureTime) and sensitivity (android.sensor.sensitivity)
530           parameters. The flash may be fired if the android.control.aeMode
531           is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
532           android.control.aeMode is ON_ALWAYS_FLASH, the scene may become overexposed.
533           Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.
534
535           When an AE precapture sequence is triggered, AE unlock will not be able to unlock
536           the AE if AE is locked by the camera device internally during precapture metering
537           sequence In other words, submitting requests with AE unlock has no effect for an
538           ongoing precapture metering sequence. Otherwise, the precapture metering sequence
539           will never succeed in a sequence of preview requests where AE lock is always set
540           to `false`.
541
542           Since the camera device has a pipeline of in-flight requests, the settings that
543           get locked do not necessarily correspond to the settings that were present in the
544           latest capture result received from the camera device, since additional captures
545           and AE updates may have occurred even before the result was sent out. If an
546           application is switching between automatic and manual control and wishes to eliminate
547           any flicker during the switch, the following procedure is recommended:
548
549             1. Starting in auto-AE mode:
550             2. Lock AE
551             3. Wait for the first result to be output that has the AE locked
552             4. Copy exposure settings from that result into a request, set the request to manual AE
553             5. Submit the capture request, proceed to run manual AE as desired.
554
555           See android.control.aeState for AE lock related state transition details.
556           </details>
557           <tag id="BC" />
558         </entry>
559         <entry name="aeMode" type="byte" visibility="public" enum="true" hwlevel="legacy">
560           <enum>
561             <value>OFF
562               <notes>
563                 The camera device's autoexposure routine is disabled.
564
565                 The application-selected android.sensor.exposureTime,
566                 android.sensor.sensitivity and
567                 android.sensor.frameDuration are used by the camera
568                 device, along with android.flash.* fields, if there's
569                 a flash unit for this camera device.
570
571                 Note that auto-white balance (AWB) and auto-focus (AF)
572                 behavior is device dependent when AE is in OFF mode.
573                 To have consistent behavior across different devices,
574                 it is recommended to either set AWB and AF to OFF mode
575                 or lock AWB and AF before setting AE to OFF.
576                 See android.control.awbMode, android.control.afMode,
577                 android.control.awbLock, and android.control.afTrigger
578                 for more details.
579
580                 LEGACY devices do not support the OFF mode and will
581                 override attempts to use this value to ON.
582               </notes>
583             </value>
584             <value>ON
585               <notes>
586                 The camera device's autoexposure routine is active,
587                 with no flash control.
588
589                 The application's values for
590                 android.sensor.exposureTime,
591                 android.sensor.sensitivity, and
592                 android.sensor.frameDuration are ignored. The
593                 application has control over the various
594                 android.flash.* fields.
595               </notes>
596             </value>
597             <value>ON_AUTO_FLASH
598               <notes>
599                 Like ON, except that the camera device also controls
600                 the camera's flash unit, firing it in low-light
601                 conditions.
602
603                 The flash may be fired during a precapture sequence
604                 (triggered by android.control.aePrecaptureTrigger) and
605                 may be fired for captures for which the
606                 android.control.captureIntent field is set to
607                 STILL_CAPTURE
608               </notes>
609             </value>
610             <value>ON_ALWAYS_FLASH
611               <notes>
612                 Like ON, except that the camera device also controls
613                 the camera's flash unit, always firing it for still
614                 captures.
615
616                 The flash may be fired during a precapture sequence
617                 (triggered by android.control.aePrecaptureTrigger) and
618                 will always be fired for captures for which the
619                 android.control.captureIntent field is set to
620                 STILL_CAPTURE
621               </notes>
622             </value>
623             <value>ON_AUTO_FLASH_REDEYE
624               <notes>
625                 Like ON_AUTO_FLASH, but with automatic red eye
626                 reduction.
627
628                 If deemed necessary by the camera device, a red eye
629                 reduction flash will fire during the precapture
630                 sequence.
631               </notes>
632             </value>
633             <value hal_version="3.3">ON_EXTERNAL_FLASH
634               <notes>
635                 An external flash has been turned on.
636
637                 It informs the camera device that an external flash has been turned on, and that
638                 metering (and continuous focus if active) should be quickly recaculated to account
639                 for the external flash. Otherwise, this mode acts like ON.
640
641                 When the external flash is turned off, AE mode should be changed to one of the
642                 other available AE modes.
643
644                 If the camera device supports AE external flash mode, aeState must be
645                 FLASH_REQUIRED after the camera device finishes AE scan and it's too dark without
646                 flash.
647               </notes>
648             </value>
649           </enum>
650           <description>The desired mode for the camera device's
651           auto-exposure routine.</description>
652           <range>android.control.aeAvailableModes</range>
653           <details>
654             This control is only effective if android.control.mode is
655             AUTO.
656
657             When set to any of the ON modes, the camera device's
658             auto-exposure routine is enabled, overriding the
659             application's selected exposure time, sensor sensitivity,
660             and frame duration (android.sensor.exposureTime,
661             android.sensor.sensitivity, and
662             android.sensor.frameDuration). If one of the FLASH modes
663             is selected, the camera device's flash unit controls are
664             also overridden.
665
666             The FLASH modes are only available if the camera device
667             has a flash unit (android.flash.info.available is `true`).
668
669             If flash TORCH mode is desired, this field must be set to
670             ON or OFF, and android.flash.mode set to TORCH.
671
672             When set to any of the ON modes, the values chosen by the
673             camera device auto-exposure routine for the overridden
674             fields for a given capture will be available in its
675             CaptureResult.
676           </details>
677           <tag id="BC" />
678         </entry>
679         <entry name="aeRegions" type="int32" visibility="public"
680             optional="true" container="array" typedef="meteringRectangle">
681           <array>
682             <size>5</size>
683             <size>area_count</size>
684           </array>
685           <description>List of metering areas to use for auto-exposure adjustment.</description>
686           <units>Pixel coordinates within android.sensor.info.activeArraySize</units>
687           <range>Coordinates must be between `[(0,0), (width, height))` of
688           android.sensor.info.activeArraySize</range>
689           <details>
690               Not available if android.control.maxRegionsAe is 0.
691               Otherwise will always be present.
692
693               The maximum number of regions supported by the device is determined by the value
694               of android.control.maxRegionsAe.
695
696               The coordinate system is based on the active pixel array,
697               with (0,0) being the top-left pixel in the active pixel array, and
698               (android.sensor.info.activeArraySize.width - 1,
699               android.sensor.info.activeArraySize.height - 1) being the
700               bottom-right pixel in the active pixel array.
701
702               The weight must be within `[0, 1000]`, and represents a weight
703               for every pixel in the area. This means that a large metering area
704               with the same weight as a smaller area will have more effect in
705               the metering result. Metering areas can partially overlap and the
706               camera device will add the weights in the overlap region.
707
708               The weights are relative to weights of other exposure metering regions, so if only one
709               region is used, all non-zero weights will have the same effect. A region with 0
710               weight is ignored.
711
712               If all regions have 0 weight, then no specific metering area needs to be used by the
713               camera device.
714
715               If the metering region is outside the used android.scaler.cropRegion returned in
716               capture result metadata, the camera device will ignore the sections outside the crop
717               region and output only the intersection rectangle as the metering region in the result
718               metadata.  If the region is entirely outside the crop region, it will be ignored and
719               not reported in the result metadata.
720           </details>
721           <ndk_details>
722               The data representation is `int[5 * area_count]`.
723               Every five elements represent a metering region of `(xmin, ymin, xmax, ymax, weight)`.
724               The rectangle is defined to be inclusive on xmin and ymin, but exclusive on xmax and
725               ymax.
726           </ndk_details>
727           <hal_details>
728               The HAL level representation of MeteringRectangle[] is a
729               int[5 * area_count].
730               Every five elements represent a metering region of
731               (xmin, ymin, xmax, ymax, weight).
732               The rectangle is defined to be inclusive on xmin and ymin, but
733               exclusive on xmax and ymax.
734           </hal_details>
735           <tag id="BC" />
736         </entry>
737         <entry name="aeTargetFpsRange" type="int32" visibility="public"
738                container="array" typedef="rangeInt" hwlevel="legacy">
739           <array>
740             <size>2</size>
741           </array>
742           <description>Range over which the auto-exposure routine can
743           adjust the capture frame rate to maintain good
744           exposure.</description>
745           <units>Frames per second (FPS)</units>
746           <range>Any of the entries in android.control.aeAvailableTargetFpsRanges</range>
747           <details>Only constrains auto-exposure (AE) algorithm, not
748           manual control of android.sensor.exposureTime and
749           android.sensor.frameDuration.</details>
750           <tag id="BC" />
751         </entry>
752         <entry name="aePrecaptureTrigger" type="byte" visibility="public"
753                enum="true" hwlevel="limited">
754           <enum>
755             <value>IDLE
756               <notes>The trigger is idle.</notes>
757             </value>
758             <value>START
759               <notes>The precapture metering sequence will be started
760               by the camera device.
761
762               The exact effect of the precapture trigger depends on
763               the current AE mode and state.</notes>
764             </value>
765             <value>CANCEL
766               <notes>The camera device will cancel any currently active or completed
767               precapture metering sequence, the auto-exposure routine will return to its
768               initial state.</notes>
769             </value>
770           </enum>
771           <description>Whether the camera device will trigger a precapture
772           metering sequence when it processes this request.</description>
773           <details>This entry is normally set to IDLE, or is not
774           included at all in the request settings. When included and
775           set to START, the camera device will trigger the auto-exposure (AE)
776           precapture metering sequence.
777
778           When set to CANCEL, the camera device will cancel any active
779           precapture metering trigger, and return to its initial AE state.
780           If a precapture metering sequence is already completed, and the camera
781           device has implicitly locked the AE for subsequent still capture, the
782           CANCEL trigger will unlock the AE and return to its initial AE state.
783
784           The precapture sequence should be triggered before starting a
785           high-quality still capture for final metering decisions to
786           be made, and for firing pre-capture flash pulses to estimate
787           scene brightness and required final capture flash power, when
788           the flash is enabled.
789
790           Normally, this entry should be set to START for only a
791           single request, and the application should wait until the
792           sequence completes before starting a new one.
793
794           When a precapture metering sequence is finished, the camera device
795           may lock the auto-exposure routine internally to be able to accurately expose the
796           subsequent still capture image (`android.control.captureIntent == STILL_CAPTURE`).
797           For this case, the AE may not resume normal scan if no subsequent still capture is
798           submitted. To ensure that the AE routine restarts normal scan, the application should
799           submit a request with `android.control.aeLock == true`, followed by a request
800           with `android.control.aeLock == false`, if the application decides not to submit a
801           still capture request after the precapture sequence completes. Alternatively, for
802           API level 23 or newer devices, the CANCEL can be used to unlock the camera device
803           internally locked AE if the application doesn't submit a still capture request after
804           the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
805           be used in devices that have earlier API levels.
806
807           The exact effect of auto-exposure (AE) precapture trigger
808           depends on the current AE mode and state; see
809           android.control.aeState for AE precapture state transition
810           details.
811
812           On LEGACY-level devices, the precapture trigger is not supported;
813           capturing a high-resolution JPEG image will automatically trigger a
814           precapture sequence before the high-resolution capture, including
815           potentially firing a pre-capture flash.
816
817           Using the precapture trigger and the auto-focus trigger android.control.afTrigger
818           simultaneously is allowed. However, since these triggers often require cooperation between
819           the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
820           focus sweep), the camera device may delay acting on a later trigger until the previous
821           trigger has been fully handled. This may lead to longer intervals between the trigger and
822           changes to android.control.aeState indicating the start of the precapture sequence, for
823           example.
824
825           If both the precapture and the auto-focus trigger are activated on the same request, then
826           the camera device will complete them in the optimal order for that device.
827           </details>
828           <hal_details>
829           The HAL must support triggering the AE precapture trigger while an AF trigger is active
830           (and vice versa), or at the same time as the AF trigger.  It is acceptable for the HAL to
831           treat these as two consecutive triggers, for example handling the AF trigger and then the
832           AE trigger.  Or the HAL may choose to optimize the case with both triggers fired at once,
833           to minimize the latency for converging both focus and exposure/flash usage.
834           </hal_details>
835           <tag id="BC" />
836         </entry>
837         <entry name="afMode" type="byte" visibility="public" enum="true"
838                hwlevel="legacy">
839           <enum>
840             <value>OFF
841             <notes>The auto-focus routine does not control the lens;
842             android.lens.focusDistance is controlled by the
843             application.</notes></value>
844             <value>AUTO
845             <notes>Basic automatic focus mode.
846
847             In this mode, the lens does not move unless
848             the autofocus trigger action is called. When that trigger
849             is activated, AF will transition to ACTIVE_SCAN, then to
850             the outcome of the scan (FOCUSED or NOT_FOCUSED).
851
852             Always supported if lens is not fixed focus.
853
854             Use android.lens.info.minimumFocusDistance to determine if lens
855             is fixed-focus.
856
857             Triggering AF_CANCEL resets the lens position to default,
858             and sets the AF state to INACTIVE.</notes></value>
859             <value>MACRO
860             <notes>Close-up focusing mode.
861
862             In this mode, the lens does not move unless the
863             autofocus trigger action is called. When that trigger is
864             activated, AF will transition to ACTIVE_SCAN, then to
865             the outcome of the scan (FOCUSED or NOT_FOCUSED). This
866             mode is optimized for focusing on objects very close to
867             the camera.
868
869             When that trigger is activated, AF will transition to
870             ACTIVE_SCAN, then to the outcome of the scan (FOCUSED or
871             NOT_FOCUSED). Triggering cancel AF resets the lens
872             position to default, and sets the AF state to
873             INACTIVE.</notes></value>
874             <value>CONTINUOUS_VIDEO
875             <notes>In this mode, the AF algorithm modifies the lens
876             position continually to attempt to provide a
877             constantly-in-focus image stream.
878
879             The focusing behavior should be suitable for good quality
880             video recording; typically this means slower focus
881             movement and no overshoots. When the AF trigger is not
882             involved, the AF algorithm should start in INACTIVE state,
883             and then transition into PASSIVE_SCAN and PASSIVE_FOCUSED
884             states as appropriate. When the AF trigger is activated,
885             the algorithm should immediately transition into
886             AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the
887             lens position until a cancel AF trigger is received.
888
889             Once cancel is received, the algorithm should transition
890             back to INACTIVE and resume passive scan. Note that this
891             behavior is not identical to CONTINUOUS_PICTURE, since an
892             ongoing PASSIVE_SCAN must immediately be
893             canceled.</notes></value>
894             <value>CONTINUOUS_PICTURE
895             <notes>In this mode, the AF algorithm modifies the lens
896             position continually to attempt to provide a
897             constantly-in-focus image stream.
898
899             The focusing behavior should be suitable for still image
900             capture; typically this means focusing as fast as
901             possible. When the AF trigger is not involved, the AF
902             algorithm should start in INACTIVE state, and then
903             transition into PASSIVE_SCAN and PASSIVE_FOCUSED states as
904             appropriate as it attempts to maintain focus. When the AF
905             trigger is activated, the algorithm should finish its
906             PASSIVE_SCAN if active, and then transition into
907             AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the
908             lens position until a cancel AF trigger is received.
909
910             When the AF cancel trigger is activated, the algorithm
911             should transition back to INACTIVE and then act as if it
912             has just been started.</notes></value>
913             <value>EDOF
914             <notes>Extended depth of field (digital focus) mode.
915
916             The camera device will produce images with an extended
917             depth of field automatically; no special focusing
918             operations need to be done before taking a picture.
919
920             AF triggers are ignored, and the AF state will always be
921             INACTIVE.</notes></value>
922           </enum>
923           <description>Whether auto-focus (AF) is currently enabled, and what
924           mode it is set to.</description>
925           <range>android.control.afAvailableModes</range>
926           <details>Only effective if android.control.mode = AUTO and the lens is not fixed focus
927           (i.e. `android.lens.info.minimumFocusDistance &gt; 0`). Also note that
928           when android.control.aeMode is OFF, the behavior of AF is device
929           dependent. It is recommended to lock AF by using android.control.afTrigger before
930           setting android.control.aeMode to OFF, or set AF mode to OFF when AE is OFF.
931
932           If the lens is controlled by the camera device auto-focus algorithm,
933           the camera device will report the current AF status in android.control.afState
934           in result metadata.</details>
935           <hal_details>
936           When afMode is AUTO or MACRO, the lens must not move until an AF trigger is sent in a
937           request (android.control.afTrigger `==` START). After an AF trigger, the afState will end
938           up with either FOCUSED_LOCKED or NOT_FOCUSED_LOCKED state (see
939           android.control.afState for detailed state transitions), which indicates that the lens is
940           locked and will not move. If camera movement (e.g. tilting camera) causes the lens to move
941           after the lens is locked, the HAL must compensate this movement appropriately such that
942           the same focal plane remains in focus.
943
944           When afMode is one of the continuous auto focus modes, the HAL is free to start a AF
945           scan whenever it's not locked. When the lens is locked after an AF trigger
946           (see android.control.afState for detailed state transitions), the HAL should maintain the
947           same lock behavior as above.
948
949           When afMode is OFF, the application controls focus manually. The accuracy of the
950           focus distance control depends on the android.lens.info.focusDistanceCalibration.
951           However, the lens must not move regardless of the camera movement for any focus distance
952           manual control.
953
954           To put this in concrete terms, if the camera has lens elements which may move based on
955           camera orientation or motion (e.g. due to gravity), then the HAL must drive the lens to
956           remain in a fixed position invariant to the camera's orientation or motion, for example,
957           by using accelerometer measurements in the lens control logic. This is a typical issue
958           that will arise on camera modules with open-loop VCMs.
959           </hal_details>
960           <tag id="BC" />
961         </entry>
962         <entry name="afRegions" type="int32" visibility="public"
963                optional="true" container="array" typedef="meteringRectangle">
964           <array>
965             <size>5</size>
966             <size>area_count</size>
967           </array>
968           <description>List of metering areas to use for auto-focus.</description>
969           <units>Pixel coordinates within android.sensor.info.activeArraySize</units>
970           <range>Coordinates must be between `[(0,0), (width, height))` of
971           android.sensor.info.activeArraySize</range>
972           <details>
973               Not available if android.control.maxRegionsAf is 0.
974               Otherwise will always be present.
975
976               The maximum number of focus areas supported by the device is determined by the value
977               of android.control.maxRegionsAf.
978
979               The coordinate system is based on the active pixel array,
980               with (0,0) being the top-left pixel in the active pixel array, and
981               (android.sensor.info.activeArraySize.width - 1,
982               android.sensor.info.activeArraySize.height - 1) being the
983               bottom-right pixel in the active pixel array.
984
985               The weight must be within `[0, 1000]`, and represents a weight
986               for every pixel in the area. This means that a large metering area
987               with the same weight as a smaller area will have more effect in
988               the metering result. Metering areas can partially overlap and the
989               camera device will add the weights in the overlap region.
990
991               The weights are relative to weights of other metering regions, so if only one region
992               is used, all non-zero weights will have the same effect. A region with 0 weight is
993               ignored.
994
995               If all regions have 0 weight, then no specific metering area needs to be used by the
996               camera device.
997
998               If the metering region is outside the used android.scaler.cropRegion returned in
999               capture result metadata, the camera device will ignore the sections outside the crop
1000               region and output only the intersection rectangle as the metering region in the result
1001               metadata. If the region is entirely outside the crop region, it will be ignored and
1002               not reported in the result metadata.
1003           </details>
1004           <ndk_details>
1005               The data representation is `int[5 * area_count]`.
1006               Every five elements represent a metering region of `(xmin, ymin, xmax, ymax, weight)`.
1007               The rectangle is defined to be inclusive on xmin and ymin, but exclusive on xmax and
1008               ymax.
1009           </ndk_details>
1010           <hal_details>
1011               The HAL level representation of MeteringRectangle[] is a
1012               int[5 * area_count].
1013               Every five elements represent a metering region of
1014               (xmin, ymin, xmax, ymax, weight).
1015               The rectangle is defined to be inclusive on xmin and ymin, but
1016               exclusive on xmax and ymax.
1017           </hal_details>
1018           <tag id="BC" />
1019         </entry>
1020         <entry name="afTrigger" type="byte" visibility="public" enum="true"
1021                hwlevel="legacy">
1022           <enum>
1023             <value>IDLE
1024               <notes>The trigger is idle.</notes>
1025             </value>
1026             <value>START
1027               <notes>Autofocus will trigger now.</notes>
1028             </value>
1029             <value>CANCEL
1030               <notes>Autofocus will return to its initial
1031               state, and cancel any currently active trigger.</notes>
1032             </value>
1033           </enum>
1034           <description>
1035           Whether the camera device will trigger autofocus for this request.
1036           </description>
1037           <details>This entry is normally set to IDLE, or is not
1038           included at all in the request settings.
1039
1040           When included and set to START, the camera device will trigger the
1041           autofocus algorithm. If autofocus is disabled, this trigger has no effect.
1042
1043           When set to CANCEL, the camera device will cancel any active trigger,
1044           and return to its initial AF state.
1045
1046           Generally, applications should set this entry to START or CANCEL for only a
1047           single capture, and then return it to IDLE (or not set at all). Specifying
1048           START for multiple captures in a row means restarting the AF operation over
1049           and over again.
1050
1051           See android.control.afState for what the trigger means for each AF mode.
1052
1053           Using the autofocus trigger and the precapture trigger android.control.aePrecaptureTrigger
1054           simultaneously is allowed. However, since these triggers often require cooperation between
1055           the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1056           focus sweep), the camera device may delay acting on a later trigger until the previous
1057           trigger has been fully handled. This may lead to longer intervals between the trigger and
1058           changes to android.control.afState, for example.
1059           </details>
1060           <hal_details>
1061           The HAL must support triggering the AF trigger while an AE precapture trigger is active
1062           (and vice versa), or at the same time as the AE trigger.  It is acceptable for the HAL to
1063           treat these as two consecutive triggers, for example handling the AF trigger and then the
1064           AE trigger.  Or the HAL may choose to optimize the case with both triggers fired at once,
1065           to minimize the latency for converging both focus and exposure/flash usage.
1066           </hal_details>
1067           <tag id="BC" />
1068         </entry>
1069         <entry name="awbLock" type="byte" visibility="public" enum="true"
1070                typedef="boolean" hwlevel="legacy">
1071           <enum>
1072             <value>OFF
1073             <notes>Auto-white balance lock is disabled; the AWB
1074             algorithm is free to update its parameters if in AUTO
1075             mode.</notes></value>
1076             <value>ON
1077             <notes>Auto-white balance lock is enabled; the AWB
1078             algorithm will not update its parameters while the lock
1079             is active.</notes></value>
1080           </enum>
1081           <description>Whether auto-white balance (AWB) is currently locked to its
1082           latest calculated values.</description>
1083           <details>
1084           When set to `true` (ON), the AWB algorithm is locked to its latest parameters,
1085           and will not change color balance settings until the lock is set to `false` (OFF).
1086
1087           Since the camera device has a pipeline of in-flight requests, the settings that
1088           get locked do not necessarily correspond to the settings that were present in the
1089           latest capture result received from the camera device, since additional captures
1090           and AWB updates may have occurred even before the result was sent out. If an
1091           application is switching between automatic and manual control and wishes to eliminate
1092           any flicker during the switch, the following procedure is recommended:
1093
1094             1. Starting in auto-AWB mode:
1095             2. Lock AWB
1096             3. Wait for the first result to be output that has the AWB locked
1097             4. Copy AWB settings from that result into a request, set the request to manual AWB
1098             5. Submit the capture request, proceed to run manual AWB as desired.
1099
1100           Note that AWB lock is only meaningful when
1101           android.control.awbMode is in the AUTO mode; in other modes,
1102           AWB is already fixed to a specific setting.
1103
1104           Some LEGACY devices may not support ON; the value is then overridden to OFF.
1105           </details>
1106           <tag id="BC" />
1107         </entry>
1108         <entry name="awbMode" type="byte" visibility="public" enum="true"
1109                hwlevel="legacy">
1110           <enum>
1111             <value>OFF
1112             <notes>
1113             The camera device's auto-white balance routine is disabled.
1114
1115             The application-selected color transform matrix
1116             (android.colorCorrection.transform) and gains
1117             (android.colorCorrection.gains) are used by the camera
1118             device for manual white balance control.
1119             </notes>
1120             </value>
1121             <value>AUTO
1122             <notes>
1123             The camera device's auto-white balance routine is active.
1124
1125             The application's values for android.colorCorrection.transform
1126             and android.colorCorrection.gains are ignored.
1127             For devices that support the MANUAL_POST_PROCESSING capability, the
1128             values used by the camera device for the transform and gains
1129             will be available in the capture result for this request.
1130             </notes>
1131             </value>
1132             <value>INCANDESCENT
1133             <notes>
1134             The camera device's auto-white balance routine is disabled;
1135             the camera device uses incandescent light as the assumed scene
1136             illumination for white balance.
1137
1138             While the exact white balance transforms are up to the
1139             camera device, they will approximately match the CIE
1140             standard illuminant A.
1141
1142             The application's values for android.colorCorrection.transform
1143             and android.colorCorrection.gains are ignored.
1144             For devices that support the MANUAL_POST_PROCESSING capability, the
1145             values used by the camera device for the transform and gains
1146             will be available in the capture result for this request.
1147             </notes>
1148             </value>
1149             <value>FLUORESCENT
1150             <notes>
1151             The camera device's auto-white balance routine is disabled;
1152             the camera device uses fluorescent light as the assumed scene
1153             illumination for white balance.
1154
1155             While the exact white balance transforms are up to the
1156             camera device, they will approximately match the CIE
1157             standard illuminant F2.
1158
1159             The application's values for android.colorCorrection.transform
1160             and android.colorCorrection.gains are ignored.
1161             For devices that support the MANUAL_POST_PROCESSING capability, the
1162             values used by the camera device for the transform and gains
1163             will be available in the capture result for this request.
1164             </notes>
1165             </value>
1166             <value>WARM_FLUORESCENT
1167             <notes>
1168             The camera device's auto-white balance routine is disabled;
1169             the camera device uses warm fluorescent light as the assumed scene
1170             illumination for white balance.
1171
1172             While the exact white balance transforms are up to the
1173             camera device, they will approximately match the CIE
1174             standard illuminant F4.
1175
1176             The application's values for android.colorCorrection.transform
1177             and android.colorCorrection.gains are ignored.
1178             For devices that support the MANUAL_POST_PROCESSING capability, the
1179             values used by the camera device for the transform and gains
1180             will be available in the capture result for this request.
1181             </notes>
1182             </value>
1183             <value>DAYLIGHT
1184             <notes>
1185             The camera device's auto-white balance routine is disabled;
1186             the camera device uses daylight light as the assumed scene
1187             illumination for white balance.
1188
1189             While the exact white balance transforms are up to the
1190             camera device, they will approximately match the CIE
1191             standard illuminant D65.
1192
1193             The application's values for android.colorCorrection.transform
1194             and android.colorCorrection.gains are ignored.
1195             For devices that support the MANUAL_POST_PROCESSING capability, the
1196             values used by the camera device for the transform and gains
1197             will be available in the capture result for this request.
1198             </notes>
1199             </value>
1200             <value>CLOUDY_DAYLIGHT
1201             <notes>
1202             The camera device's auto-white balance routine is disabled;
1203             the camera device uses cloudy daylight light as the assumed scene
1204             illumination for white balance.
1205
1206             The application's values for android.colorCorrection.transform
1207             and android.colorCorrection.gains are ignored.
1208             For devices that support the MANUAL_POST_PROCESSING capability, the
1209             values used by the camera device for the transform and gains
1210             will be available in the capture result for this request.
1211             </notes>
1212             </value>
1213             <value>TWILIGHT
1214             <notes>
1215             The camera device's auto-white balance routine is disabled;
1216             the camera device uses twilight light as the assumed scene
1217             illumination for white balance.
1218
1219             The application's values for android.colorCorrection.transform
1220             and android.colorCorrection.gains are ignored.
1221             For devices that support the MANUAL_POST_PROCESSING capability, the
1222             values used by the camera device for the transform and gains
1223             will be available in the capture result for this request.
1224             </notes>
1225             </value>
1226             <value>SHADE
1227             <notes>
1228             The camera device's auto-white balance routine is disabled;
1229             the camera device uses shade light as the assumed scene
1230             illumination for white balance.
1231
1232             The application's values for android.colorCorrection.transform
1233             and android.colorCorrection.gains are ignored.
1234             For devices that support the MANUAL_POST_PROCESSING capability, the
1235             values used by the camera device for the transform and gains
1236             will be available in the capture result for this request.
1237             </notes>
1238             </value>
1239           </enum>
1240           <description>Whether auto-white balance (AWB) is currently setting the color
1241           transform fields, and what its illumination target
1242           is.</description>
1243           <range>android.control.awbAvailableModes</range>
1244           <details>
1245           This control is only effective if android.control.mode is AUTO.
1246
1247           When set to the ON mode, the camera device's auto-white balance
1248           routine is enabled, overriding the application's selected
1249           android.colorCorrection.transform, android.colorCorrection.gains and
1250           android.colorCorrection.mode. Note that when android.control.aeMode
1251           is OFF, the behavior of AWB is device dependent. It is recommened to
1252           also set AWB mode to OFF or lock AWB by using android.control.awbLock before
1253           setting AE mode to OFF.
1254
1255           When set to the OFF mode, the camera device's auto-white balance
1256           routine is disabled. The application manually controls the white
1257           balance by android.colorCorrection.transform, android.colorCorrection.gains
1258           and android.colorCorrection.mode.
1259
1260           When set to any other modes, the camera device's auto-white
1261           balance routine is disabled. The camera device uses each
1262           particular illumination target for white balance
1263           adjustment. The application's values for
1264           android.colorCorrection.transform,
1265           android.colorCorrection.gains and
1266           android.colorCorrection.mode are ignored.
1267           </details>
1268           <tag id="BC" />
1269         </entry>
1270         <entry name="awbRegions" type="int32" visibility="public"
1271                optional="true" container="array" typedef="meteringRectangle">
1272           <array>
1273             <size>5</size>
1274             <size>area_count</size>
1275           </array>
1276           <description>List of metering areas to use for auto-white-balance illuminant
1277           estimation.</description>
1278           <units>Pixel coordinates within android.sensor.info.activeArraySize</units>
1279           <range>Coordinates must be between `[(0,0), (width, height))` of
1280           android.sensor.info.activeArraySize</range>
1281           <details>
1282               Not available if android.control.maxRegionsAwb is 0.
1283               Otherwise will always be present.
1284
1285               The maximum number of regions supported by the device is determined by the value
1286               of android.control.maxRegionsAwb.
1287
1288               The coordinate system is based on the active pixel array,
1289               with (0,0) being the top-left pixel in the active pixel array, and
1290               (android.sensor.info.activeArraySize.width - 1,
1291               android.sensor.info.activeArraySize.height - 1) being the
1292               bottom-right pixel in the active pixel array.
1293
1294               The weight must range from 0 to 1000, and represents a weight
1295               for every pixel in the area. This means that a large metering area
1296               with the same weight as a smaller area will have more effect in
1297               the metering result. Metering areas can partially overlap and the
1298               camera device will add the weights in the overlap region.
1299
1300               The weights are relative to weights of other white balance metering regions, so if
1301               only one region is used, all non-zero weights will have the same effect. A region with
1302               0 weight is ignored.
1303
1304               If all regions have 0 weight, then no specific metering area needs to be used by the
1305               camera device.
1306
1307               If the metering region is outside the used android.scaler.cropRegion returned in
1308               capture result metadata, the camera device will ignore the sections outside the crop
1309               region and output only the intersection rectangle as the metering region in the result
1310               metadata.  If the region is entirely outside the crop region, it will be ignored and
1311               not reported in the result metadata.
1312           </details>
1313           <ndk_details>
1314               The data representation is `int[5 * area_count]`.
1315               Every five elements represent a metering region of `(xmin, ymin, xmax, ymax, weight)`.
1316               The rectangle is defined to be inclusive on xmin and ymin, but exclusive on xmax and
1317               ymax.
1318           </ndk_details>
1319           <hal_details>
1320               The HAL level representation of MeteringRectangle[] is a
1321               int[5 * area_count].
1322               Every five elements represent a metering region of
1323               (xmin, ymin, xmax, ymax, weight).
1324               The rectangle is defined to be inclusive on xmin and ymin, but
1325               exclusive on xmax and ymax.
1326           </hal_details>
1327           <tag id="BC" />
1328         </entry>
1329         <entry name="captureIntent" type="byte" visibility="public" enum="true"
1330                hwlevel="legacy">
1331           <enum>
1332             <value>CUSTOM
1333             <notes>The goal of this request doesn't fall into the other
1334             categories. The camera device will default to preview-like
1335             behavior.</notes></value>
1336             <value>PREVIEW
1337             <notes>This request is for a preview-like use case.
1338
1339             The precapture trigger may be used to start off a metering
1340             w/flash sequence.
1341             </notes></value>
1342             <value>STILL_CAPTURE
1343             <notes>This request is for a still capture-type
1344             use case.
1345
1346             If the flash unit is under automatic control, it may fire as needed.
1347             </notes></value>
1348             <value>VIDEO_RECORD
1349             <notes>This request is for a video recording
1350             use case.</notes></value>
1351             <value>VIDEO_SNAPSHOT
1352             <notes>This request is for a video snapshot (still
1353             image while recording video) use case.
1354
1355             The camera device should take the highest-quality image
1356             possible (given the other settings) without disrupting the
1357             frame rate of video recording.  </notes></value>
1358             <value>ZERO_SHUTTER_LAG
1359             <notes>This request is for a ZSL usecase; the
1360             application will stream full-resolution images and
1361             reprocess one or several later for a final
1362             capture.
1363             </notes></value>
1364             <value>MANUAL
1365             <notes>This request is for manual capture use case where
1366             the applications want to directly control the capture parameters.
1367
1368             For example, the application may wish to manually control
1369             android.sensor.exposureTime, android.sensor.sensitivity, etc.
1370             </notes></value>
1371             <value hal_version="3.3">MOTION_TRACKING
1372             <notes>This request is for a motion tracking use case, where
1373             the application will use camera and inertial sensor data to
1374             locate and track objects in the world.
1375
1376             The camera device auto-exposure routine will limit the exposure time
1377             of the camera to no more than 20 milliseconds, to minimize motion blur.
1378             </notes></value>
1379           </enum>
1380           <description>Information to the camera device 3A (auto-exposure,
1381           auto-focus, auto-white balance) routines about the purpose
1382           of this capture, to help the camera device to decide optimal 3A
1383           strategy.</description>
1384           <details>This control (except for MANUAL) is only effective if
1385           `android.control.mode != OFF` and any 3A routine is active.
1386
1387           All intents are supported by all devices, except that:
1388             * ZERO_SHUTTER_LAG will be supported if android.request.availableCapabilities contains
1389           PRIVATE_REPROCESSING or YUV_REPROCESSING.
1390             * MANUAL will be supported if android.request.availableCapabilities contains
1391           MANUAL_SENSOR.
1392             * MOTION_TRACKING will be supported if android.request.availableCapabilities contains
1393           MOTION_TRACKING.
1394           </details>
1395           <tag id="BC" />
1396         </entry>
1397         <entry name="effectMode" type="byte" visibility="public" enum="true"
1398                hwlevel="legacy">
1399           <enum>
1400             <value>OFF
1401               <notes>
1402               No color effect will be applied.
1403               </notes>
1404             </value>
1405             <value optional="true">MONO
1406               <notes>
1407               A "monocolor" effect where the image is mapped into
1408               a single color.
1409
1410               This will typically be grayscale.
1411               </notes>
1412             </value>
1413             <value optional="true">NEGATIVE
1414               <notes>
1415               A "photo-negative" effect where the image's colors
1416               are inverted.
1417               </notes>
1418             </value>
1419             <value optional="true">SOLARIZE
1420               <notes>
1421               A "solarisation" effect (Sabattier effect) where the
1422               image is wholly or partially reversed in
1423               tone.
1424               </notes>
1425             </value>
1426             <value optional="true">SEPIA
1427               <notes>
1428               A "sepia" effect where the image is mapped into warm
1429               gray, red, and brown tones.
1430               </notes>
1431             </value>
1432             <value optional="true">POSTERIZE
1433               <notes>
1434               A "posterization" effect where the image uses
1435               discrete regions of tone rather than a continuous
1436               gradient of tones.
1437               </notes>
1438             </value>
1439             <value optional="true">WHITEBOARD
1440               <notes>
1441               A "whiteboard" effect where the image is typically displayed
1442               as regions of white, with black or grey details.
1443               </notes>
1444             </value>
1445             <value optional="true">BLACKBOARD
1446               <notes>
1447               A "blackboard" effect where the image is typically displayed
1448               as regions of black, with white or grey details.
1449               </notes>
1450             </value>
1451             <value optional="true">AQUA
1452               <notes>
1453               An "aqua" effect where a blue hue is added to the image.
1454               </notes>
1455             </value>
1456           </enum>
1457           <description>A special color effect to apply.</description>
1458           <range>android.control.availableEffects</range>
1459           <details>
1460           When this mode is set, a color effect will be applied
1461           to images produced by the camera device. The interpretation
1462           and implementation of these color effects is left to the
1463           implementor of the camera device, and should not be
1464           depended on to be consistent (or present) across all
1465           devices.
1466           </details>
1467           <tag id="BC" />
1468         </entry>
1469         <entry name="mode" type="byte" visibility="public" enum="true"
1470                hwlevel="legacy">
1471           <enum>
1472             <value>OFF
1473             <notes>Full application control of pipeline.
1474
1475             All control by the device's metering and focusing (3A)
1476             routines is disabled, and no other settings in
1477             android.control.* have any effect, except that
1478             android.control.captureIntent may be used by the camera
1479             device to select post-processing values for processing
1480             blocks that do not allow for manual control, or are not
1481             exposed by the camera API.
1482
1483             However, the camera device's 3A routines may continue to
1484             collect statistics and update their internal state so that
1485             when control is switched to AUTO mode, good control values
1486             can be immediately applied.
1487             </notes></value>
1488             <value>AUTO
1489             <notes>Use settings for each individual 3A routine.
1490
1491             Manual control of capture parameters is disabled. All
1492             controls in android.control.* besides sceneMode take
1493             effect.</notes></value>
1494             <value optional="true">USE_SCENE_MODE
1495             <notes>Use a specific scene mode.
1496
1497             Enabling this disables control.aeMode, control.awbMode and
1498             control.afMode controls; the camera device will ignore
1499             those settings while USE_SCENE_MODE is active (except for
1500             FACE_PRIORITY scene mode). Other control entries are still active.
1501             This setting can only be used if scene mode is supported (i.e.
1502             android.control.availableSceneModes
1503             contain some modes other than DISABLED).</notes></value>
1504             <value optional="true">OFF_KEEP_STATE
1505             <notes>Same as OFF mode, except that this capture will not be
1506             used by camera device background auto-exposure, auto-white balance and
1507             auto-focus algorithms (3A) to update their statistics.
1508
1509             Specifically, the 3A routines are locked to the last
1510             values set from a request with AUTO, OFF, or
1511             USE_SCENE_MODE, and any statistics or state updates
1512             collected from manual captures with OFF_KEEP_STATE will be
1513             discarded by the camera device.
1514             </notes></value>
1515           </enum>
1516           <description>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
1517           routines.</description>
1518           <range>android.control.availableModes</range>
1519           <details>
1520           This is a top-level 3A control switch. When set to OFF, all 3A control
1521           by the camera device is disabled. The application must set the fields for
1522           capture parameters itself.
1523
1524           When set to AUTO, the individual algorithm controls in
1525           android.control.* are in effect, such as android.control.afMode.
1526
1527           When set to USE_SCENE_MODE, the individual controls in
1528           android.control.* are mostly disabled, and the camera device
1529           implements one of the scene mode settings (such as ACTION,
1530           SUNSET, or PARTY) as it wishes. The camera device scene mode
1531           3A settings are provided by {@link
1532           android.hardware.camera2.CaptureResult|ACameraCaptureSession_captureCallback_result
1533           capture results}.
1534
1535           When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1536           is that this frame will not be used by camera device background 3A statistics
1537           update, as if this frame is never captured. This mode can be used in the scenario
1538           where the application doesn't want a 3A manual control capture to affect
1539           the subsequent auto 3A capture results.
1540           </details>
1541           <tag id="BC" />
1542         </entry>
1543         <entry name="sceneMode" type="byte" visibility="public" enum="true"
1544                hwlevel="legacy">
1545           <enum>
1546             <value id="0">DISABLED
1547               <notes>
1548               Indicates that no scene modes are set for a given capture request.
1549               </notes>
1550             </value>
1551             <value>FACE_PRIORITY
1552               <notes>If face detection support exists, use face
1553               detection data for auto-focus, auto-white balance, and
1554               auto-exposure routines.
1555
1556               If face detection statistics are disabled
1557               (i.e. android.statistics.faceDetectMode is set to OFF),
1558               this should still operate correctly (but will not return
1559               face detection statistics to the framework).
1560
1561               Unlike the other scene modes, android.control.aeMode,
1562               android.control.awbMode, and android.control.afMode
1563               remain active when FACE_PRIORITY is set.
1564               </notes>
1565             </value>
1566             <value optional="true">ACTION
1567               <notes>
1568               Optimized for photos of quickly moving objects.
1569
1570               Similar to SPORTS.
1571               </notes>
1572             </value>
1573             <value optional="true">PORTRAIT
1574               <notes>
1575               Optimized for still photos of people.
1576               </notes>
1577             </value>
1578             <value optional="true">LANDSCAPE
1579               <notes>
1580               Optimized for photos of distant macroscopic objects.
1581               </notes>
1582             </value>
1583             <value optional="true">NIGHT
1584               <notes>
1585               Optimized for low-light settings.
1586               </notes>
1587             </value>
1588             <value optional="true">NIGHT_PORTRAIT
1589               <notes>
1590               Optimized for still photos of people in low-light
1591               settings.
1592               </notes>
1593             </value>
1594             <value optional="true">THEATRE
1595               <notes>
1596               Optimized for dim, indoor settings where flash must
1597               remain off.
1598               </notes>
1599             </value>
1600             <value optional="true">BEACH
1601               <notes>
1602               Optimized for bright, outdoor beach settings.
1603               </notes>
1604             </value>
1605             <value optional="true">SNOW
1606               <notes>
1607               Optimized for bright, outdoor settings containing snow.
1608               </notes>
1609             </value>
1610             <value optional="true">SUNSET
1611               <notes>
1612               Optimized for scenes of the setting sun.
1613               </notes>
1614             </value>
1615             <value optional="true">STEADYPHOTO
1616               <notes>
1617               Optimized to avoid blurry photos due to small amounts of
1618               device motion (for example: due to hand shake).
1619               </notes>
1620             </value>
1621             <value optional="true">FIREWORKS
1622               <notes>
1623               Optimized for nighttime photos of fireworks.
1624               </notes>
1625             </value>
1626             <value optional="true">SPORTS
1627               <notes>
1628               Optimized for photos of quickly moving people.
1629
1630               Similar to ACTION.
1631               </notes>
1632             </value>
1633             <value optional="true">PARTY
1634               <notes>
1635               Optimized for dim, indoor settings with multiple moving
1636               people.
1637               </notes>
1638             </value>
1639             <value optional="true">CANDLELIGHT
1640               <notes>
1641               Optimized for dim settings where the main light source
1642               is a flame.
1643               </notes>
1644             </value>
1645             <value optional="true">BARCODE
1646               <notes>
1647               Optimized for accurately capturing a photo of barcode
1648               for use by camera applications that wish to read the
1649               barcode value.
1650               </notes>
1651             </value>
1652             <value deprecated="true" optional="true" ndk_hidden="true">HIGH_SPEED_VIDEO
1653               <notes>
1654               This is deprecated, please use {@link
1655               android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession}
1656               and {@link
1657               android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}
1658               for high speed video recording.
1659
1660               Optimized for high speed video recording (frame rate >=60fps) use case.
1661
1662               The supported high speed video sizes and fps ranges are specified in
1663               android.control.availableHighSpeedVideoConfigurations. To get desired
1664               output frame rates, the application is only allowed to select video size
1665               and fps range combinations listed in this static metadata. The fps range
1666               can be control via android.control.aeTargetFpsRange.
1667
1668               In this mode, the camera device will override aeMode, awbMode, and afMode to
1669               ON, ON, and CONTINUOUS_VIDEO, respectively. All post-processing block mode
1670               controls will be overridden to be FAST. Therefore, no manual control of capture
1671               and post-processing parameters is possible. All other controls operate the
1672               same as when android.control.mode == AUTO. This means that all other
1673               android.control.* fields continue to work, such as
1674
1675               * android.control.aeTargetFpsRange
1676               * android.control.aeExposureCompensation
1677               * android.control.aeLock
1678               * android.control.awbLock
1679               * android.control.effectMode
1680               * android.control.aeRegions
1681               * android.control.afRegions
1682               * android.control.awbRegions
1683               * android.control.afTrigger
1684               * android.control.aePrecaptureTrigger
1685
1686               Outside of android.control.*, the following controls will work:
1687
1688               * android.flash.mode (automatic flash for still capture will not work since aeMode is ON)
1689               * android.lens.opticalStabilizationMode (if it is supported)
1690               * android.scaler.cropRegion
1691               * android.statistics.faceDetectMode
1692
1693               For high speed recording use case, the actual maximum supported frame rate may
1694               be lower than what camera can output, depending on the destination Surfaces for
1695               the image data. For example, if the destination surface is from video encoder,
1696               the application need check if the video encoder is capable of supporting the
1697               high frame rate for a given video size, or it will end up with lower recording
1698               frame rate. If the destination surface is from preview window, the preview frame
1699               rate will be bounded by the screen refresh rate.
1700
1701               The camera device will only support up to 2 output high speed streams
1702               (processed non-stalling format defined in android.request.maxNumOutputStreams)
1703               in this mode. This control will be effective only if all of below conditions are true:
1704
1705               * The application created no more than maxNumHighSpeedStreams processed non-stalling
1706               format output streams, where maxNumHighSpeedStreams is calculated as
1707               min(2, android.request.maxNumOutputStreams[Processed (but not-stalling)]).
1708               * The stream sizes are selected from the sizes reported by
1709               android.control.availableHighSpeedVideoConfigurations.
1710               * No processed non-stalling or raw streams are configured.
1711
1712               When above conditions are NOT satistied, the controls of this mode and
1713               android.control.aeTargetFpsRange will be ignored by the camera device,
1714               the camera device will fall back to android.control.mode `==` AUTO,
1715               and the returned capture result metadata will give the fps range choosen
1716               by the camera device.
1717
1718               Switching into or out of this mode may trigger some camera ISP/sensor
1719               reconfigurations, which may introduce extra latency. It is recommended that
1720               the application avoids unnecessary scene mode switch as much as possible.
1721               </notes>
1722             </value>
1723             <value optional="true">HDR
1724               <notes>
1725               Turn on a device-specific high dynamic range (HDR) mode.
1726
1727               In this scene mode, the camera device captures images
1728               that keep a larger range of scene illumination levels
1729               visible in the final image. For example, when taking a
1730               picture of a object in front of a bright window, both
1731               the object and the scene through the window may be
1732               visible when using HDR mode, while in normal AUTO mode,
1733               one or the other may be poorly exposed. As a tradeoff,
1734               HDR mode generally takes much longer to capture a single
1735               image, has no user control, and may have other artifacts
1736               depending on the HDR method used.
1737
1738               Therefore, HDR captures operate at a much slower rate
1739               than regular captures.
1740
1741               In this mode, on LIMITED or FULL devices, when a request
1742               is made with a android.control.captureIntent of
1743               STILL_CAPTURE, the camera device will capture an image
1744               using a high dynamic range capture technique.  On LEGACY
1745               devices, captures that target a JPEG-format output will
1746               be captured with HDR, and the capture intent is not
1747               relevant.
1748
1749               The HDR capture may involve the device capturing a burst
1750               of images internally and combining them into one, or it
1751               may involve the device using specialized high dynamic
1752               range capture hardware. In all cases, a single image is
1753               produced in response to a capture request submitted
1754               while in HDR mode.
1755
1756               Since substantial post-processing is generally needed to
1757               produce an HDR image, only YUV, PRIVATE, and JPEG
1758               outputs are supported for LIMITED/FULL device HDR
1759               captures, and only JPEG outputs are supported for LEGACY
1760               HDR captures. Using a RAW output for HDR capture is not
1761               supported.
1762
1763               Some devices may also support always-on HDR, which
1764               applies HDR processing at full frame rate.  For these
1765               devices, intents other than STILL_CAPTURE will also
1766               produce an HDR output with no frame rate impact compared
1767               to normal operation, though the quality may be lower
1768               than for STILL_CAPTURE intents.
1769
1770               If SCENE_MODE_HDR is used with unsupported output types
1771               or capture intents, the images captured will be as if
1772               the SCENE_MODE was not enabled at all.
1773               </notes>
1774             </value>
1775             <value optional="true" hidden="true">FACE_PRIORITY_LOW_LIGHT
1776               <notes>Same as FACE_PRIORITY scene mode, except that the camera
1777               device will choose higher sensitivity values (android.sensor.sensitivity)
1778               under low light conditions.
1779
1780               The camera device may be tuned to expose the images in a reduced
1781               sensitivity range to produce the best quality images. For example,
1782               if the android.sensor.info.sensitivityRange gives range of [100, 1600],
1783               the camera device auto-exposure routine tuning process may limit the actual
1784               exposure sensitivity range to [100, 1200] to ensure that the noise level isn't
1785               exessive in order to preserve the image quality. Under this situation, the image under
1786               low light may be under-exposed when the sensor max exposure time (bounded by the
1787               android.control.aeTargetFpsRange when android.control.aeMode is one of the
1788               ON_* modes) and effective max sensitivity are reached. This scene mode allows the
1789               camera device auto-exposure routine to increase the sensitivity up to the max
1790               sensitivity specified by android.sensor.info.sensitivityRange when the scene is too
1791               dark and the max exposure time is reached. The captured images may be noisier
1792               compared with the images captured in normal FACE_PRIORITY mode; therefore, it is
1793               recommended that the application only use this scene mode when it is capable of
1794               reducing the noise level of the captured images.
1795
1796               Unlike the other scene modes, android.control.aeMode,
1797               android.control.awbMode, and android.control.afMode
1798               remain active when FACE_PRIORITY_LOW_LIGHT is set.
1799               </notes>
1800             </value>
1801             <value optional="true" hidden="true" id="100">DEVICE_CUSTOM_START
1802               <notes>
1803                 Scene mode values within the range of
1804                 `[DEVICE_CUSTOM_START, DEVICE_CUSTOM_END]` are reserved for device specific
1805                 customized scene modes.
1806               </notes>
1807             </value>
1808             <value optional="true" hidden="true" id="127">DEVICE_CUSTOM_END
1809               <notes>
1810                 Scene mode values within the range of
1811                 `[DEVICE_CUSTOM_START, DEVICE_CUSTOM_END]` are reserved for device specific
1812                 customized scene modes.
1813               </notes>
1814             </value>
1815           </enum>
1816           <description>
1817           Control for which scene mode is currently active.
1818           </description>
1819           <range>android.control.availableSceneModes</range>
1820           <details>
1821           Scene modes are custom camera modes optimized for a certain set of conditions and
1822           capture settings.
1823
1824           This is the mode that that is active when
1825           `android.control.mode == USE_SCENE_MODE`. Aside from FACE_PRIORITY, these modes will
1826           disable android.control.aeMode, android.control.awbMode, and android.control.afMode
1827           while in use.
1828
1829           The interpretation and implementation of these scene modes is left
1830           to the implementor of the camera device. Their behavior will not be
1831           consistent across all devices, and any given device may only implement
1832           a subset of these modes.
1833           </details>
1834           <hal_details>
1835           HAL implementations that include scene modes are expected to provide
1836           the per-scene settings to use for android.control.aeMode,
1837           android.control.awbMode, and android.control.afMode in
1838           android.control.sceneModeOverrides.
1839
1840           For HIGH_SPEED_VIDEO mode, if it is included in android.control.availableSceneModes, the
1841           HAL must list supported video size and fps range in
1842           android.control.availableHighSpeedVideoConfigurations. For a given size, e.g.  1280x720,
1843           if the HAL has two different sensor configurations for normal streaming mode and high
1844           speed streaming, when this scene mode is set/reset in a sequence of capture requests, the
1845           HAL may have to switch between different sensor modes.  This mode is deprecated in legacy
1846           HAL3.3, to support high speed video recording, please implement
1847           android.control.availableHighSpeedVideoConfigurations and CONSTRAINED_HIGH_SPEED_VIDEO
1848           capbility defined in android.request.availableCapabilities.
1849           </hal_details>
1850           <tag id="BC" />
1851         </entry>
1852         <entry name="videoStabilizationMode" type="byte" visibility="public"
1853                enum="true" hwlevel="legacy">
1854           <enum>
1855             <value>OFF
1856             <notes>
1857               Video stabilization is disabled.
1858             </notes></value>
1859             <value>ON
1860             <notes>
1861               Video stabilization is enabled.
1862             </notes></value>
1863           </enum>
1864           <description>Whether video stabilization is
1865           active.</description>
1866           <details>
1867           Video stabilization automatically warps images from
1868           the camera in order to stabilize motion between consecutive frames.
1869
1870           If enabled, video stabilization can modify the
1871           android.scaler.cropRegion to keep the video stream stabilized.
1872
1873           Switching between different video stabilization modes may take several
1874           frames to initialize, the camera device will report the current mode
1875           in capture result metadata. For example, When "ON" mode is requested,
1876           the video stabilization modes in the first several capture results may
1877           still be "OFF", and it will become "ON" when the initialization is
1878           done.
1879
1880           In addition, not all recording sizes or frame rates may be supported for
1881           stabilization by a device that reports stabilization support. It is guaranteed
1882           that an output targeting a MediaRecorder or MediaCodec will be stabilized if
1883           the recording resolution is less than or equal to 1920 x 1080 (width less than
1884           or equal to 1920, height less than or equal to 1080), and the recording
1885           frame rate is less than or equal to 30fps.  At other sizes, the CaptureResult
1886           android.control.videoStabilizationMode field will return
1887           OFF if the recording output is not stabilized, or if there are no output
1888           Surface types that can be stabilized.
1889
1890           If a camera device supports both this mode and OIS
1891           (android.lens.opticalStabilizationMode), turning both modes on may
1892           produce undesirable interaction, so it is recommended not to enable
1893           both at the same time.
1894           </details>
1895           <tag id="BC" />
1896         </entry>
1897       </controls>
1898       <static>
1899         <entry name="aeAvailableAntibandingModes" type="byte" visibility="public"
1900                type_notes="list of enums" container="array" typedef="enumList"
1901                hwlevel="legacy">
1902           <array>
1903             <size>n</size>
1904           </array>
1905           <description>
1906             List of auto-exposure antibanding modes for android.control.aeAntibandingMode that are
1907             supported by this camera device.
1908           </description>
1909           <range>Any value listed in android.control.aeAntibandingMode</range>
1910           <details>
1911             Not all of the auto-exposure anti-banding modes may be
1912             supported by a given camera device. This field lists the
1913             valid anti-banding modes that the application may request
1914             for this camera device with the
1915             android.control.aeAntibandingMode control.
1916           </details>
1917           <tag id="BC" />
1918         </entry>
1919         <entry name="aeAvailableModes" type="byte" visibility="public"
1920                type_notes="list of enums" container="array" typedef="enumList"
1921                hwlevel="legacy">
1922           <array>
1923             <size>n</size>
1924           </array>
1925           <description>
1926             List of auto-exposure modes for android.control.aeMode that are supported by this camera
1927             device.
1928           </description>
1929           <range>Any value listed in android.control.aeMode</range>
1930           <details>
1931             Not all the auto-exposure modes may be supported by a
1932             given camera device, especially if no flash unit is
1933             available. This entry lists the valid modes for
1934             android.control.aeMode for this camera device.
1935
1936             All camera devices support ON, and all camera devices with flash
1937             units support ON_AUTO_FLASH and ON_ALWAYS_FLASH.
1938
1939             FULL mode camera devices always support OFF mode,
1940             which enables application control of camera exposure time,
1941             sensitivity, and frame duration.
1942
1943             LEGACY mode camera devices never support OFF mode.
1944             LIMITED mode devices support OFF if they support the MANUAL_SENSOR
1945             capability.
1946           </details>
1947           <tag id="BC" />
1948         </entry>
1949         <entry name="aeAvailableTargetFpsRanges" type="int32" visibility="public"
1950                type_notes="list of pairs of frame rates"
1951                container="array" typedef="rangeInt"
1952                hwlevel="legacy">
1953           <array>
1954             <size>2</size>
1955             <size>n</size>
1956           </array>
1957           <description>List of frame rate ranges for android.control.aeTargetFpsRange supported by
1958           this camera device.</description>
1959           <units>Frames per second (FPS)</units>
1960           <details>
1961           For devices at the LEGACY level or above:
1962
1963           * For constant-framerate recording, for each normal
1964           {@link android.media.CamcorderProfile CamcorderProfile}, that is, a
1965           {@link android.media.CamcorderProfile CamcorderProfile} that has
1966           {@link android.media.CamcorderProfile#quality quality} in
1967           the range [{@link android.media.CamcorderProfile#QUALITY_LOW QUALITY_LOW},
1968           {@link android.media.CamcorderProfile#QUALITY_2160P QUALITY_2160P}], if the profile is
1969           supported by the device and has
1970           {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} `x`, this list will
1971           always include (`x`,`x`).
1972
1973           * Also, a camera device must either not support any
1974           {@link android.media.CamcorderProfile CamcorderProfile},
1975           or support at least one
1976           normal {@link android.media.CamcorderProfile CamcorderProfile} that has
1977           {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} `x` &gt;= 24.
1978
1979           For devices at the LIMITED level or above:
1980
1981           * For YUV_420_888 burst capture use case, this list will always include (`min`, `max`)
1982           and (`max`, `max`) where `min` &lt;= 15 and `max` = the maximum output frame rate of the
1983           maximum YUV_420_888 output size.
1984           </details>
1985           <tag id="BC" />
1986         </entry>
1987         <entry name="aeCompensationRange" type="int32" visibility="public"
1988                container="array" typedef="rangeInt"
1989                hwlevel="legacy">
1990           <array>
1991             <size>2</size>
1992           </array>
1993           <description>Maximum and minimum exposure compensation values for
1994           android.control.aeExposureCompensation, in counts of android.control.aeCompensationStep,
1995           that are supported by this camera device.</description>
1996           <range>
1997             Range [0,0] indicates that exposure compensation is not supported.
1998
1999             For LIMITED and FULL devices, range must follow below requirements if exposure
2000             compensation is supported (`range != [0, 0]`):
2001
2002             `Min.exposure compensation * android.control.aeCompensationStep &lt;= -2 EV`
2003
2004             `Max.exposure compensation * android.control.aeCompensationStep &gt;= 2 EV`
2005
2006             LEGACY devices may support a smaller range than this.
2007           </range>
2008           <tag id="BC" />
2009         </entry>
2010         <entry name="aeCompensationStep" type="rational" visibility="public"
2011                hwlevel="legacy">
2012           <description>Smallest step by which the exposure compensation
2013           can be changed.</description>
2014           <units>Exposure Value (EV)</units>
2015           <details>
2016           This is the unit for android.control.aeExposureCompensation. For example, if this key has
2017           a value of `1/2`, then a setting of `-2` for android.control.aeExposureCompensation means
2018           that the target EV offset for the auto-exposure routine is -1 EV.
2019
2020           One unit of EV compensation changes the brightness of the captured image by a factor
2021           of two. +1 EV doubles the image brightness, while -1 EV halves the image brightness.
2022           </details>
2023           <hal_details>
2024             This must be less than or equal to 1/2.
2025           </hal_details>
2026           <tag id="BC" />
2027         </entry>
2028         <entry name="afAvailableModes" type="byte" visibility="public"
2029                type_notes="List of enums" container="array" typedef="enumList"
2030                hwlevel="legacy">
2031           <array>
2032             <size>n</size>
2033           </array>
2034           <description>
2035           List of auto-focus (AF) modes for android.control.afMode that are
2036           supported by this camera device.
2037           </description>
2038           <range>Any value listed in android.control.afMode</range>
2039           <details>
2040           Not all the auto-focus modes may be supported by a
2041           given camera device. This entry lists the valid modes for
2042           android.control.afMode for this camera device.
2043
2044           All LIMITED and FULL mode camera devices will support OFF mode, and all
2045           camera devices with adjustable focuser units
2046           (`android.lens.info.minimumFocusDistance &gt; 0`) will support AUTO mode.
2047
2048           LEGACY devices will support OFF mode only if they support
2049           focusing to infinity (by also setting android.lens.focusDistance to
2050           `0.0f`).
2051           </details>
2052           <tag id="BC" />
2053         </entry>
2054         <entry name="availableEffects" type="byte" visibility="public"
2055                type_notes="List of enums (android.control.effectMode)." container="array"
2056                typedef="enumList" hwlevel="legacy">
2057           <array>
2058             <size>n</size>
2059           </array>
2060           <description>
2061           List of color effects for android.control.effectMode that are supported by this camera
2062           device.
2063           </description>
2064           <range>Any value listed in android.control.effectMode</range>
2065           <details>
2066           This list contains the color effect modes that can be applied to
2067           images produced by the camera device.
2068           Implementations are not expected to be consistent across all devices.
2069           If no color effect modes are available for a device, this will only list
2070           OFF.
2071
2072           A color effect will only be applied if
2073           android.control.mode != OFF.  OFF is always included in this list.
2074
2075           This control has no effect on the operation of other control routines such
2076           as auto-exposure, white balance, or focus.
2077           </details>
2078           <tag id="BC" />
2079         </entry>
2080         <entry name="availableSceneModes" type="byte" visibility="public"
2081                type_notes="List of enums (android.control.sceneMode)."
2082                container="array" typedef="enumList" hwlevel="legacy">
2083           <array>
2084             <size>n</size>
2085           </array>
2086           <description>
2087           List of scene modes for android.control.sceneMode that are supported by this camera
2088           device.
2089           </description>
2090           <range>Any value listed in android.control.sceneMode</range>
2091           <details>
2092           This list contains scene modes that can be set for the camera device.
2093           Only scene modes that have been fully implemented for the
2094           camera device may be included here. Implementations are not expected
2095           to be consistent across all devices.
2096
2097           If no scene modes are supported by the camera device, this
2098           will be set to DISABLED. Otherwise DISABLED will not be listed.
2099
2100           FACE_PRIORITY is always listed if face detection is
2101           supported (i.e.`android.statistics.info.maxFaceCount &gt;
2102           0`).
2103           </details>
2104           <tag id="BC" />
2105         </entry>
2106         <entry name="availableVideoStabilizationModes" type="byte"
2107                visibility="public" type_notes="List of enums." container="array"
2108                typedef="enumList" hwlevel="legacy">
2109           <array>
2110             <size>n</size>
2111           </array>
2112           <description>
2113           List of video stabilization modes for android.control.videoStabilizationMode
2114           that are supported by this camera device.
2115           </description>
2116           <range>Any value listed in android.control.videoStabilizationMode</range>
2117           <details>
2118           OFF will always be listed.
2119           </details>
2120           <tag id="BC" />
2121         </entry>
2122         <entry name="awbAvailableModes" type="byte" visibility="public"
2123                type_notes="List of enums"
2124                container="array" typedef="enumList" hwlevel="legacy">
2125           <array>
2126             <size>n</size>
2127           </array>
2128           <description>
2129           List of auto-white-balance modes for android.control.awbMode that are supported by this
2130           camera device.
2131           </description>
2132           <range>Any value listed in android.control.awbMode</range>
2133           <details>
2134           Not all the auto-white-balance modes may be supported by a
2135           given camera device. This entry lists the valid modes for
2136           android.control.awbMode for this camera device.
2137
2138           All camera devices will support ON mode.
2139
2140           Camera devices that support the MANUAL_POST_PROCESSING capability will always support OFF
2141           mode, which enables application control of white balance, by using
2142           android.colorCorrection.transform and android.colorCorrection.gains
2143           (android.colorCorrection.mode must be set to TRANSFORM_MATRIX). This includes all FULL
2144           mode camera devices.
2145           </details>
2146           <tag id="BC" />
2147         </entry>
2148         <entry name="maxRegions" type="int32" visibility="ndk_public"
2149                container="array" hwlevel="legacy">
2150           <array>
2151             <size>3</size>
2152           </array>
2153           <description>
2154           List of the maximum number of regions that can be used for metering in
2155           auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF);
2156           this corresponds to the the maximum number of elements in
2157           android.control.aeRegions, android.control.awbRegions,
2158           and android.control.afRegions.
2159           </description>
2160           <range>
2161           Value must be &amp;gt;= 0 for each element. For full-capability devices
2162           this value must be &amp;gt;= 1 for AE and AF. The order of the elements is:
2163           `(AE, AWB, AF)`.</range>
2164           <tag id="BC" />
2165         </entry>
2166         <entry name="maxRegionsAe" type="int32" visibility="java_public"
2167                synthetic="true" hwlevel="legacy">
2168           <description>
2169           The maximum number of metering regions that can be used by the auto-exposure (AE)
2170           routine.
2171           </description>
2172           <range>Value will be &amp;gt;= 0. For FULL-capability devices, this
2173           value will be &amp;gt;= 1.
2174           </range>
2175           <details>
2176           This corresponds to the the maximum allowed number of elements in
2177           android.control.aeRegions.
2178           </details>
2179           <hal_details>This entry is private to the framework. Fill in
2180           maxRegions to have this entry be automatically populated.
2181           </hal_details>
2182         </entry>
2183         <entry name="maxRegionsAwb" type="int32" visibility="java_public"
2184                synthetic="true" hwlevel="legacy">
2185           <description>
2186           The maximum number of metering regions that can be used by the auto-white balance (AWB)
2187           routine.
2188           </description>
2189           <range>Value will be &amp;gt;= 0.
2190           </range>
2191           <details>
2192           This corresponds to the the maximum allowed number of elements in
2193           android.control.awbRegions.
2194           </details>
2195           <hal_details>This entry is private to the framework. Fill in
2196           maxRegions to have this entry be automatically populated.
2197           </hal_details>
2198         </entry>
2199         <entry name="maxRegionsAf" type="int32" visibility="java_public"
2200                synthetic="true" hwlevel="legacy">
2201           <description>
2202           The maximum number of metering regions that can be used by the auto-focus (AF) routine.
2203           </description>
2204           <range>Value will be &amp;gt;= 0. For FULL-capability devices, this
2205           value will be &amp;gt;= 1.
2206           </range>
2207           <details>
2208           This corresponds to the the maximum allowed number of elements in
2209           android.control.afRegions.
2210           </details>
2211           <hal_details>This entry is private to the framework. Fill in
2212           maxRegions to have this entry be automatically populated.
2213           </hal_details>
2214         </entry>
2215         <entry name="sceneModeOverrides" type="byte" visibility="system"
2216                container="array" hwlevel="limited">
2217           <array>
2218             <size>3</size>
2219             <size>length(availableSceneModes)</size>
2220           </array>
2221           <description>
2222           Ordered list of auto-exposure, auto-white balance, and auto-focus
2223           settings to use with each available scene mode.
2224           </description>
2225           <range>
2226           For each available scene mode, the list must contain three
2227           entries containing the android.control.aeMode,
2228           android.control.awbMode, and android.control.afMode values used
2229           by the camera device. The entry order is `(aeMode, awbMode, afMode)`
2230           where aeMode has the lowest index position.
2231           </range>
2232           <details>
2233           When a scene mode is enabled, the camera device is expected
2234           to override android.control.aeMode, android.control.awbMode,
2235           and android.control.afMode with its preferred settings for
2236           that scene mode.
2237
2238           The order of this list matches that of availableSceneModes,
2239           with 3 entries for each mode.  The overrides listed
2240           for FACE_PRIORITY and FACE_PRIORITY_LOW_LIGHT (if supported) are ignored,
2241           since for that mode the application-set android.control.aeMode,
2242           android.control.awbMode, and android.control.afMode values are
2243           used instead, matching the behavior when android.control.mode
2244           is set to AUTO. It is recommended that the FACE_PRIORITY and
2245           FACE_PRIORITY_LOW_LIGHT (if supported) overrides should be set to 0.
2246
2247           For example, if availableSceneModes contains
2248           `(FACE_PRIORITY, ACTION, NIGHT)`,  then the camera framework
2249           expects sceneModeOverrides to have 9 entries formatted like:
2250           `(0, 0, 0, ON_AUTO_FLASH, AUTO, CONTINUOUS_PICTURE,
2251           ON_AUTO_FLASH, INCANDESCENT, AUTO)`.
2252           </details>
2253           <hal_details>
2254           To maintain backward compatibility, this list will be made available
2255           in the static metadata of the camera service.  The camera service will
2256           use these values to set android.control.aeMode,
2257           android.control.awbMode, and android.control.afMode when using a scene
2258           mode other than FACE_PRIORITY and FACE_PRIORITY_LOW_LIGHT (if supported).
2259           </hal_details>
2260           <tag id="BC" />
2261         </entry>
2262       </static>
2263       <dynamic>
2264         <entry name="aePrecaptureId" type="int32" visibility="system" deprecated="true">
2265           <description>The ID sent with the latest
2266           CAMERA2_TRIGGER_PRECAPTURE_METERING call</description>
2267           <details>Must be 0 if no
2268           CAMERA2_TRIGGER_PRECAPTURE_METERING trigger received yet
2269           by HAL. Always updated even if AE algorithm ignores the
2270           trigger</details>
2271         </entry>
2272         <clone entry="android.control.aeAntibandingMode" kind="controls">
2273         </clone>
2274         <clone entry="android.control.aeExposureCompensation" kind="controls">
2275         </clone>
2276         <clone entry="android.control.aeLock" kind="controls">
2277         </clone>
2278         <clone entry="android.control.aeMode" kind="controls">
2279         </clone>
2280         <clone entry="android.control.aeRegions" kind="controls">
2281         </clone>
2282         <clone entry="android.control.aeTargetFpsRange" kind="controls">
2283         </clone>
2284         <clone entry="android.control.aePrecaptureTrigger" kind="controls">
2285         </clone>
2286         <entry name="aeState" type="byte" visibility="public" enum="true"
2287                hwlevel="limited">
2288           <enum>
2289             <value>INACTIVE
2290             <notes>AE is off or recently reset.
2291
2292             When a camera device is opened, it starts in
2293             this state. This is a transient state, the camera device may skip reporting
2294             this state in capture result.</notes></value>
2295             <value>SEARCHING
2296             <notes>AE doesn't yet have a good set of control values
2297             for the current scene.
2298
2299             This is a transient state, the camera device may skip
2300             reporting this state in capture result.</notes></value>
2301             <value>CONVERGED
2302             <notes>AE has a good set of control values for the
2303             current scene.</notes></value>
2304             <value>LOCKED
2305             <notes>AE has been locked.</notes></value>
2306             <value>FLASH_REQUIRED
2307             <notes>AE has a good set of control values, but flash
2308             needs to be fired for good quality still
2309             capture.</notes></value>
2310             <value>PRECAPTURE
2311             <notes>AE has been asked to do a precapture sequence
2312             and is currently executing it.
2313
2314             Precapture can be triggered through setting
2315             android.control.aePrecaptureTrigger to START. Currently
2316             active and completed (if it causes camera device internal AE lock) precapture
2317             metering sequence can be canceled through setting
2318             android.control.aePrecaptureTrigger to CANCEL.
2319
2320             Once PRECAPTURE completes, AE will transition to CONVERGED
2321             or FLASH_REQUIRED as appropriate. This is a transient
2322             state, the camera device may skip reporting this state in
2323             capture result.</notes></value>
2324           </enum>
2325           <description>Current state of the auto-exposure (AE) algorithm.</description>
2326           <details>Switching between or enabling AE modes (android.control.aeMode) always
2327           resets the AE state to INACTIVE. Similarly, switching between android.control.mode,
2328           or android.control.sceneMode if `android.control.mode == USE_SCENE_MODE` resets all
2329           the algorithm states to INACTIVE.
2330
2331           The camera device can do several state transitions between two results, if it is
2332           allowed by the state transition table. For example: INACTIVE may never actually be
2333           seen in a result.
2334
2335           The state in the result is the state for this image (in sync with this image): if
2336           AE state becomes CONVERGED, then the image data associated with this result should
2337           be good to use.
2338
2339           Below are state transition tables for different AE modes.
2340
2341             State       | Transition Cause | New State | Notes
2342           :------------:|:----------------:|:---------:|:-----------------------:
2343           INACTIVE      |                  | INACTIVE  | Camera device auto exposure algorithm is disabled
2344
2345           When android.control.aeMode is AE_MODE_ON*:
2346
2347             State        | Transition Cause                             | New State      | Notes
2348           :-------------:|:--------------------------------------------:|:--------------:|:-----------------:
2349           INACTIVE       | Camera device initiates AE scan              | SEARCHING      | Values changing
2350           INACTIVE       | android.control.aeLock is ON                 | LOCKED         | Values locked
2351           SEARCHING      | Camera device finishes AE scan               | CONVERGED      | Good values, not changing
2352           SEARCHING      | Camera device finishes AE scan               | FLASH_REQUIRED | Converged but too dark w/o flash
2353           SEARCHING      | android.control.aeLock is ON                 | LOCKED         | Values locked
2354           CONVERGED      | Camera device initiates AE scan              | SEARCHING      | Values changing
2355           CONVERGED      | android.control.aeLock is ON                 | LOCKED         | Values locked
2356           FLASH_REQUIRED | Camera device initiates AE scan              | SEARCHING      | Values changing
2357           FLASH_REQUIRED | android.control.aeLock is ON                 | LOCKED         | Values locked
2358           LOCKED         | android.control.aeLock is OFF                | SEARCHING      | Values not good after unlock
2359           LOCKED         | android.control.aeLock is OFF                | CONVERGED      | Values good after unlock
2360           LOCKED         | android.control.aeLock is OFF                | FLASH_REQUIRED | Exposure good, but too dark
2361           PRECAPTURE     | Sequence done. android.control.aeLock is OFF | CONVERGED      | Ready for high-quality capture
2362           PRECAPTURE     | Sequence done. android.control.aeLock is ON  | LOCKED         | Ready for high-quality capture
2363           LOCKED         | aeLock is ON and aePrecaptureTrigger is START | LOCKED        | Precapture trigger is ignored when AE is already locked
2364           LOCKED         | aeLock is ON and aePrecaptureTrigger is CANCEL| LOCKED        | Precapture trigger is ignored when AE is already locked
2365           Any state (excluding LOCKED) | android.control.aePrecaptureTrigger is START | PRECAPTURE     | Start AE precapture metering sequence
2366           Any state (excluding LOCKED) | android.control.aePrecaptureTrigger is CANCEL| INACTIVE       | Currently active precapture metering sequence is canceled
2367
2368           If the camera device supports AE external flash mode (ON_EXTERNAL_FLASH is included in
2369           android.control.aeAvailableModes), aeState must be FLASH_REQUIRED after the camera device
2370           finishes AE scan and it's too dark without flash.
2371
2372           For the above table, the camera device may skip reporting any state changes that happen
2373           without application intervention (i.e. mode switch, trigger, locking). Any state that
2374           can be skipped in that manner is called a transient state.
2375
2376           For example, for above AE modes (AE_MODE_ON*), in addition to the state transitions
2377           listed in above table, it is also legal for the camera device to skip one or more
2378           transient states between two results. See below table for examples:
2379
2380             State        | Transition Cause                                            | New State      | Notes
2381           :-------------:|:-----------------------------------------------------------:|:--------------:|:-----------------:
2382           INACTIVE       | Camera device finished AE scan                              | CONVERGED      | Values are already good, transient states are skipped by camera device.
2383           Any state (excluding LOCKED) | android.control.aePrecaptureTrigger is START, sequence done | FLASH_REQUIRED | Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.
2384           Any state (excluding LOCKED) | android.control.aePrecaptureTrigger is START, sequence done | CONVERGED      | Converged after a precapture sequence, transient states are skipped by camera device.
2385           Any state (excluding LOCKED) | android.control.aePrecaptureTrigger is CANCEL, converged    | FLASH_REQUIRED | Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.
2386           Any state (excluding LOCKED) | android.control.aePrecaptureTrigger is CANCEL, converged    | CONVERGED      | Converged after a precapture sequenceis canceled, transient states are skipped by camera device.
2387           CONVERGED      | Camera device finished AE scan                              | FLASH_REQUIRED | Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.
2388           FLASH_REQUIRED | Camera device finished AE scan                              | CONVERGED      | Converged after a new scan, transient states are skipped by camera device.
2389           </details>
2390         </entry>
2391         <clone entry="android.control.afMode" kind="controls">
2392         </clone>
2393         <clone entry="android.control.afRegions" kind="controls">
2394         </clone>
2395         <clone entry="android.control.afTrigger" kind="controls">
2396         </clone>
2397         <entry name="afState" type="byte" visibility="public" enum="true"
2398                hwlevel="legacy">
2399           <enum>
2400             <value>INACTIVE
2401             <notes>AF is off or has not yet tried to scan/been asked
2402             to scan.
2403
2404             When a camera device is opened, it starts in this
2405             state. This is a transient state, the camera device may
2406             skip reporting this state in capture
2407             result.</notes></value>
2408             <value>PASSIVE_SCAN
2409             <notes>AF is currently performing an AF scan initiated the
2410             camera device in a continuous autofocus mode.
2411
2412             Only used by CONTINUOUS_* AF modes. This is a transient
2413             state, the camera device may skip reporting this state in
2414             capture result.</notes></value>
2415             <value>PASSIVE_FOCUSED
2416             <notes>AF currently believes it is in focus, but may
2417             restart scanning at any time.
2418
2419             Only used by CONTINUOUS_* AF modes. This is a transient
2420             state, the camera device may skip reporting this state in
2421             capture result.</notes></value>
2422             <value>ACTIVE_SCAN
2423             <notes>AF is performing an AF scan because it was
2424             triggered by AF trigger.
2425
2426             Only used by AUTO or MACRO AF modes. This is a transient
2427             state, the camera device may skip reporting this state in
2428             capture result.</notes></value>
2429             <value>FOCUSED_LOCKED
2430             <notes>AF believes it is focused correctly and has locked
2431             focus.
2432
2433             This state is reached only after an explicit START AF trigger has been
2434             sent (android.control.afTrigger), when good focus has been obtained.
2435
2436             The lens will remain stationary until the AF mode (android.control.afMode) is changed or
2437             a new AF trigger is sent to the camera device (android.control.afTrigger).
2438             </notes></value>
2439             <value>NOT_FOCUSED_LOCKED
2440             <notes>AF has failed to focus successfully and has locked
2441             focus.
2442
2443             This state is reached only after an explicit START AF trigger has been
2444             sent (android.control.afTrigger), when good focus cannot be obtained.
2445
2446             The lens will remain stationary until the AF mode (android.control.afMode) is changed or
2447             a new AF trigger is sent to the camera device (android.control.afTrigger).
2448             </notes></value>
2449             <value>PASSIVE_UNFOCUSED
2450             <notes>AF finished a passive scan without finding focus,
2451             and may restart scanning at any time.
2452
2453             Only used by CONTINUOUS_* AF modes. This is a transient state, the camera
2454             device may skip reporting this state in capture result.
2455
2456             LEGACY camera devices do not support this state. When a passive
2457             scan has finished, it will always go to PASSIVE_FOCUSED.
2458             </notes></value>
2459           </enum>
2460           <description>Current state of auto-focus (AF) algorithm.</description>
2461           <details>
2462           Switching between or enabling AF modes (android.control.afMode) always
2463           resets the AF state to INACTIVE. Similarly, switching between android.control.mode,
2464           or android.control.sceneMode if `android.control.mode == USE_SCENE_MODE` resets all
2465           the algorithm states to INACTIVE.
2466
2467           The camera device can do several state transitions between two results, if it is
2468           allowed by the state transition table. For example: INACTIVE may never actually be
2469           seen in a result.
2470
2471           The state in the result is the state for this image (in sync with this image): if
2472           AF state becomes FOCUSED, then the image data associated with this result should
2473           be sharp.
2474
2475           Below are state transition tables for different AF modes.
2476
2477           When android.control.afMode is AF_MODE_OFF or AF_MODE_EDOF:
2478
2479             State       | Transition Cause | New State | Notes
2480           :------------:|:----------------:|:---------:|:-----------:
2481           INACTIVE      |                  | INACTIVE  | Never changes
2482
2483           When android.control.afMode is AF_MODE_AUTO or AF_MODE_MACRO:
2484
2485             State            | Transition Cause | New State          | Notes
2486           :-----------------:|:----------------:|:------------------:|:--------------:
2487           INACTIVE           | AF_TRIGGER       | ACTIVE_SCAN        | Start AF sweep, Lens now moving
2488           ACTIVE_SCAN        | AF sweep done    | FOCUSED_LOCKED     | Focused, Lens now locked
2489           ACTIVE_SCAN        | AF sweep done    | NOT_FOCUSED_LOCKED | Not focused, Lens now locked
2490           ACTIVE_SCAN        | AF_CANCEL        | INACTIVE           | Cancel/reset AF, Lens now locked
2491           FOCUSED_LOCKED     | AF_CANCEL        | INACTIVE           | Cancel/reset AF
2492           FOCUSED_LOCKED     | AF_TRIGGER       | ACTIVE_SCAN        | Start new sweep, Lens now moving
2493           NOT_FOCUSED_LOCKED | AF_CANCEL        | INACTIVE           | Cancel/reset AF
2494           NOT_FOCUSED_LOCKED | AF_TRIGGER       | ACTIVE_SCAN        | Start new sweep, Lens now moving
2495           Any state          | Mode change      | INACTIVE           |
2496
2497           For the above table, the camera device may skip reporting any state changes that happen
2498           without application intervention (i.e. mode switch, trigger, locking). Any state that
2499           can be skipped in that manner is called a transient state.
2500
2501           For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
2502           state transitions listed in above table, it is also legal for the camera device to skip
2503           one or more transient states between two results. See below table for examples:
2504
2505             State            | Transition Cause | New State          | Notes
2506           :-----------------:|:----------------:|:------------------:|:--------------:
2507           INACTIVE           | AF_TRIGGER       | FOCUSED_LOCKED     | Focus is already good or good after a scan, lens is now locked.
2508           INACTIVE           | AF_TRIGGER       | NOT_FOCUSED_LOCKED | Focus failed after a scan, lens is now locked.
2509           FOCUSED_LOCKED     | AF_TRIGGER       | FOCUSED_LOCKED     | Focus is already good or good after a scan, lens is now locked.
2510           NOT_FOCUSED_LOCKED | AF_TRIGGER       | FOCUSED_LOCKED     | Focus is good after a scan, lens is not locked.
2511
2512
2513           When android.control.afMode is AF_MODE_CONTINUOUS_VIDEO:
2514
2515             State            | Transition Cause                    | New State          | Notes
2516           :-----------------:|:-----------------------------------:|:------------------:|:--------------:
2517           INACTIVE           | Camera device initiates new scan    | PASSIVE_SCAN       | Start AF scan, Lens now moving
2518           INACTIVE           | AF_TRIGGER                          | NOT_FOCUSED_LOCKED | AF state query, Lens now locked
2519           PASSIVE_SCAN       | Camera device completes current scan| PASSIVE_FOCUSED    | End AF scan, Lens now locked
2520           PASSIVE_SCAN       | Camera device fails current scan    | PASSIVE_UNFOCUSED  | End AF scan, Lens now locked
2521           PASSIVE_SCAN       | AF_TRIGGER                          | FOCUSED_LOCKED     | Immediate transition, if focus is good. Lens now locked
2522           PASSIVE_SCAN       | AF_TRIGGER                          | NOT_FOCUSED_LOCKED | Immediate transition, if focus is bad. Lens now locked
2523           PASSIVE_SCAN       | AF_CANCEL                           | INACTIVE           | Reset lens position, Lens now locked
2524           PASSIVE_FOCUSED    | Camera device initiates new scan    | PASSIVE_SCAN       | Start AF scan, Lens now moving
2525           PASSIVE_UNFOCUSED  | Camera device initiates new scan    | PASSIVE_SCAN       | Start AF scan, Lens now moving
2526           PASSIVE_FOCUSED    | AF_TRIGGER                          | FOCUSED_LOCKED     | Immediate transition, lens now locked
2527           PASSIVE_UNFOCUSED  | AF_TRIGGER                          | NOT_FOCUSED_LOCKED | Immediate transition, lens now locked
2528           FOCUSED_LOCKED     | AF_TRIGGER                          | FOCUSED_LOCKED     | No effect
2529           FOCUSED_LOCKED     | AF_CANCEL                           | INACTIVE           | Restart AF scan
2530           NOT_FOCUSED_LOCKED | AF_TRIGGER                          | NOT_FOCUSED_LOCKED | No effect
2531           NOT_FOCUSED_LOCKED | AF_CANCEL                           | INACTIVE           | Restart AF scan
2532
2533           When android.control.afMode is AF_MODE_CONTINUOUS_PICTURE:
2534
2535             State            | Transition Cause                     | New State          | Notes
2536           :-----------------:|:------------------------------------:|:------------------:|:--------------:
2537           INACTIVE           | Camera device initiates new scan     | PASSIVE_SCAN       | Start AF scan, Lens now moving
2538           INACTIVE           | AF_TRIGGER                           | NOT_FOCUSED_LOCKED | AF state query, Lens now locked
2539           PASSIVE_SCAN       | Camera device completes current scan | PASSIVE_FOCUSED    | End AF scan, Lens now locked
2540           PASSIVE_SCAN       | Camera device fails current scan     | PASSIVE_UNFOCUSED  | End AF scan, Lens now locked
2541           PASSIVE_SCAN       | AF_TRIGGER                           | FOCUSED_LOCKED     | Eventual transition once the focus is good. Lens now locked
2542           PASSIVE_SCAN       | AF_TRIGGER                           | NOT_FOCUSED_LOCKED | Eventual transition if cannot find focus. Lens now locked
2543           PASSIVE_SCAN       | AF_CANCEL                            | INACTIVE           | Reset lens position, Lens now locked
2544           PASSIVE_FOCUSED    | Camera device initiates new scan     | PASSIVE_SCAN       | Start AF scan, Lens now moving
2545           PASSIVE_UNFOCUSED  | Camera device initiates new scan     | PASSIVE_SCAN       | Start AF scan, Lens now moving
2546           PASSIVE_FOCUSED    | AF_TRIGGER                           | FOCUSED_LOCKED     | Immediate trans. Lens now locked
2547           PASSIVE_UNFOCUSED  | AF_TRIGGER                           | NOT_FOCUSED_LOCKED | Immediate trans. Lens now locked
2548           FOCUSED_LOCKED     | AF_TRIGGER                           | FOCUSED_LOCKED     | No effect
2549           FOCUSED_LOCKED     | AF_CANCEL                            | INACTIVE           | Restart AF scan
2550           NOT_FOCUSED_LOCKED | AF_TRIGGER                           | NOT_FOCUSED_LOCKED | No effect
2551           NOT_FOCUSED_LOCKED | AF_CANCEL                            | INACTIVE           | Restart AF scan
2552
2553           When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
2554           (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
2555           camera device. When a trigger is included in a mode switch request, the trigger
2556           will be evaluated in the context of the new mode in the request.
2557           See below table for examples:
2558
2559             State      | Transition Cause                       | New State                                | Notes
2560           :-----------:|:--------------------------------------:|:----------------------------------------:|:--------------:
2561           any state    | CAF-->AUTO mode switch                 | INACTIVE                                 | Mode switch without trigger, initial state must be INACTIVE
2562           any state    | CAF-->AUTO mode switch with AF_TRIGGER | trigger-reachable states from INACTIVE   | Mode switch with trigger, INACTIVE is skipped
2563           any state    | AUTO-->CAF mode switch                 | passively reachable states from INACTIVE | Mode switch without trigger, passive transient state is skipped
2564           </details>
2565         </entry>
2566         <entry name="afTriggerId" type="int32" visibility="system" deprecated="true">
2567           <description>The ID sent with the latest
2568           CAMERA2_TRIGGER_AUTOFOCUS call</description>
2569           <details>Must be 0 if no CAMERA2_TRIGGER_AUTOFOCUS trigger
2570           received yet by HAL. Always updated even if AF algorithm
2571           ignores the trigger</details>
2572         </entry>
2573         <clone entry="android.control.awbLock" kind="controls">
2574         </clone>
2575         <clone entry="android.control.awbMode" kind="controls">
2576         </clone>
2577         <clone entry="android.control.awbRegions" kind="controls">
2578         </clone>
2579         <clone entry="android.control.captureIntent" kind="controls">
2580         </clone>
2581         <entry name="awbState" type="byte" visibility="public" enum="true"
2582                hwlevel="limited">
2583           <enum>
2584             <value>INACTIVE
2585             <notes>AWB is not in auto mode, or has not yet started metering.
2586
2587             When a camera device is opened, it starts in this
2588             state. This is a transient state, the camera device may
2589             skip reporting this state in capture
2590             result.</notes></value>
2591             <value>SEARCHING
2592             <notes>AWB doesn't yet have a good set of control
2593             values for the current scene.
2594
2595             This is a transient state, the camera device
2596             may skip reporting this state in capture result.</notes></value>
2597             <value>CONVERGED
2598             <notes>AWB has a good set of control values for the
2599             current scene.</notes></value>
2600             <value>LOCKED
2601             <notes>AWB has been locked.
2602             </notes></value>
2603           </enum>
2604           <description>Current state of auto-white balance (AWB) algorithm.</description>
2605           <details>Switching between or enabling AWB modes (android.control.awbMode) always
2606           resets the AWB state to INACTIVE. Similarly, switching between android.control.mode,
2607           or android.control.sceneMode if `android.control.mode == USE_SCENE_MODE` resets all
2608           the algorithm states to INACTIVE.
2609
2610           The camera device can do several state transitions between two results, if it is
2611           allowed by the state transition table. So INACTIVE may never actually be seen in
2612           a result.
2613
2614           The state in the result is the state for this image (in sync with this image): if
2615           AWB state becomes CONVERGED, then the image data associated with this result should
2616           be good to use.
2617
2618           Below are state transition tables for different AWB modes.
2619
2620           When `android.control.awbMode != AWB_MODE_AUTO`:
2621
2622             State       | Transition Cause | New State | Notes
2623           :------------:|:----------------:|:---------:|:-----------------------:
2624           INACTIVE      |                  |INACTIVE   |Camera device auto white balance algorithm is disabled
2625
2626           When android.control.awbMode is AWB_MODE_AUTO:
2627
2628             State        | Transition Cause                 | New State     | Notes
2629           :-------------:|:--------------------------------:|:-------------:|:-----------------:
2630           INACTIVE       | Camera device initiates AWB scan | SEARCHING     | Values changing
2631           INACTIVE       | android.control.awbLock is ON    | LOCKED        | Values locked
2632           SEARCHING      | Camera device finishes AWB scan  | CONVERGED     | Good values, not changing
2633           SEARCHING      | android.control.awbLock is ON    | LOCKED        | Values locked
2634           CONVERGED      | Camera device initiates AWB scan | SEARCHING     | Values changing
2635           CONVERGED      | android.control.awbLock is ON    | LOCKED        | Values locked
2636           LOCKED         | android.control.awbLock is OFF   | SEARCHING     | Values not good after unlock
2637
2638           For the above table, the camera device may skip reporting any state changes that happen
2639           without application intervention (i.e. mode switch, trigger, locking). Any state that
2640           can be skipped in that manner is called a transient state.
2641
2642           For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
2643           listed in above table, it is also legal for the camera device to skip one or more
2644           transient states between two results. See below table for examples:
2645
2646             State        | Transition Cause                 | New State     | Notes
2647           :-------------:|:--------------------------------:|:-------------:|:-----------------:
2648           INACTIVE       | Camera device finished AWB scan  | CONVERGED     | Values are already good, transient states are skipped by camera device.
2649           LOCKED         | android.control.awbLock is OFF   | CONVERGED     | Values good after unlock, transient states are skipped by camera device.
2650           </details>
2651         </entry>
2652         <clone entry="android.control.effectMode" kind="controls">
2653         </clone>
2654         <clone entry="android.control.mode" kind="controls">
2655         </clone>
2656         <clone entry="android.control.sceneMode" kind="controls">
2657         </clone>
2658         <clone entry="android.control.videoStabilizationMode" kind="controls">
2659         </clone>
2660       </dynamic>
2661       <static>
2662         <entry name="availableHighSpeedVideoConfigurations" type="int32" visibility="hidden"
2663                container="array" typedef="highSpeedVideoConfiguration" hwlevel="limited">
2664           <array>
2665             <size>5</size>
2666             <size>n</size>
2667           </array>
2668           <description>
2669           List of available high speed video size, fps range and max batch size configurations
2670           supported by the camera device, in the format of (width, height, fps_min, fps_max, batch_size_max).
2671           </description>
2672           <range>
2673           For each configuration, the fps_max &amp;gt;= 120fps.
2674           </range>
2675           <details>
2676           When CONSTRAINED_HIGH_SPEED_VIDEO is supported in android.request.availableCapabilities,
2677           this metadata will list the supported high speed video size, fps range and max batch size
2678           configurations. All the sizes listed in this configuration will be a subset of the sizes
2679           reported by {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes}
2680           for processed non-stalling formats.
2681
2682           For the high speed video use case, the application must
2683           select the video size and fps range from this metadata to configure the recording and
2684           preview streams and setup the recording requests. For example, if the application intends
2685           to do high speed recording, it can select the maximum size reported by this metadata to
2686           configure output streams. Once the size is selected, application can filter this metadata
2687           by selected size and get the supported fps ranges, and use these fps ranges to setup the
2688           recording requests. Note that for the use case of multiple output streams, application
2689           must select one unique size from this metadata to use (e.g., preview and recording streams
2690           must have the same size). Otherwise, the high speed capture session creation will fail.
2691
2692           The min and max fps will be multiple times of 30fps.
2693
2694           High speed video streaming extends significant performance pressue to camera hardware,
2695           to achieve efficient high speed streaming, the camera device may have to aggregate
2696           multiple frames together and send to camera device for processing where the request
2697           controls are same for all the frames in this batch. Max batch size indicates
2698           the max possible number of frames the camera device will group together for this high
2699           speed stream configuration. This max batch size will be used to generate a high speed
2700           recording request list by
2701           {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}.
2702           The max batch size for each configuration will satisfy below conditions:
2703
2704           * Each max batch size will be a divisor of its corresponding fps_max / 30. For example,
2705           if max_fps is 300, max batch size will only be 1, 2, 5, or 10.
2706           * The camera device may choose smaller internal batch size for each configuration, but
2707           the actual batch size will be a divisor of max batch size. For example, if the max batch
2708           size is 8, the actual batch size used by camera device will only be 1, 2, 4, or 8.
2709           * The max batch size in each configuration entry must be no larger than 32.
2710
2711           The camera device doesn't have to support batch mode to achieve high speed video recording,
2712           in such case, batch_size_max will be reported as 1 in each configuration entry.
2713
2714           This fps ranges in this configuration list can only be used to create requests
2715           that are submitted to a high speed camera capture session created by
2716           {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession}.
2717           The fps ranges reported in this metadata must not be used to setup capture requests for
2718           normal capture session, or it will cause request error.
2719           </details>
2720           <hal_details>
2721           All the sizes listed in this configuration will be a subset of the sizes reported by
2722           android.scaler.availableStreamConfigurations for processed non-stalling output formats.
2723           Note that for all high speed video configurations, HAL must be able to support a minimum
2724           of two streams, though the application might choose to configure just one stream.
2725
2726           The HAL may support multiple sensor modes for high speed outputs, for example, 120fps
2727           sensor mode and 120fps recording, 240fps sensor mode for 240fps recording. The application
2728           usually starts preview first, then starts recording. To avoid sensor mode switch caused
2729           stutter when starting recording as much as possible, the application may want to ensure
2730           the same sensor mode is used for preview and recording. Therefore, The HAL must advertise
2731           the variable fps range [30, fps_max] for each fixed fps range in this configuration list.
2732           For example, if the HAL advertises [120, 120] and [240, 240], the HAL must also advertise
2733           [30, 120] and [30, 240] for each configuration. In doing so, if the application intends to
2734           do 120fps recording, it can select [30, 120] to start preview, and [120, 120] to start
2735           recording. For these variable fps ranges, it's up to the HAL to decide the actual fps
2736           values that are suitable for smooth preview streaming. If the HAL sees different max_fps
2737           values that fall into different sensor modes in a sequence of requests, the HAL must
2738           switch the sensor mode as quick as possible to minimize the mode switch caused stutter.
2739           </hal_details>
2740           <tag id="V1" />
2741         </entry>
2742         <entry name="aeLockAvailable" type="byte" visibility="public" enum="true"
2743                typedef="boolean" hwlevel="legacy">
2744           <enum>
2745             <value>FALSE</value>
2746             <value>TRUE</value>
2747           </enum>
2748           <description>Whether the camera device supports android.control.aeLock</description>
2749           <details>
2750               Devices with MANUAL_SENSOR capability or BURST_CAPTURE capability will always
2751               list `true`. This includes FULL devices.
2752           </details>
2753           <tag id="BC"/>
2754         </entry>
2755         <entry name="awbLockAvailable" type="byte" visibility="public" enum="true"
2756                typedef="boolean" hwlevel="legacy">
2757           <enum>
2758             <value>FALSE</value>
2759             <value>TRUE</value>
2760           </enum>
2761           <description>Whether the camera device supports android.control.awbLock</description>
2762           <details>
2763               Devices with MANUAL_POST_PROCESSING capability or BURST_CAPTURE capability will
2764               always list `true`. This includes FULL devices.
2765           </details>
2766           <tag id="BC"/>
2767         </entry>
2768         <entry name="availableModes" type="byte" visibility="public"
2769             type_notes="List of enums (android.control.mode)." container="array"
2770             typedef="enumList" hwlevel="legacy">
2771           <array>
2772             <size>n</size>
2773           </array>
2774           <description>
2775           List of control modes for android.control.mode that are supported by this camera
2776           device.
2777           </description>
2778           <range>Any value listed in android.control.mode</range>
2779           <details>
2780               This list contains control modes that can be set for the camera device.
2781               LEGACY mode devices will always support AUTO mode. LIMITED and FULL
2782               devices will always support OFF, AUTO modes.
2783           </details>
2784         </entry>
2785         <entry name="postRawSensitivityBoostRange" type="int32" visibility="public"
2786             type_notes="Range of supported post RAW sensitivitiy boosts"
2787             container="array" typedef="rangeInt">
2788           <array>
2789             <size>2</size>
2790           </array>
2791           <description>Range of boosts for android.control.postRawSensitivityBoost supported
2792             by this camera device.
2793           </description>
2794           <units>ISO arithmetic units, the same as android.sensor.sensitivity</units>
2795           <details>
2796             Devices support post RAW sensitivity boost  will advertise
2797             android.control.postRawSensitivityBoost key for controling
2798             post RAW sensitivity boost.
2799
2800             This key will be `null` for devices that do not support any RAW format
2801             outputs. For devices that do support RAW format outputs, this key will always
2802             present, and if a device does not support post RAW sensitivity boost, it will
2803             list `(100, 100)` in this key.
2804           </details>
2805           <hal_details>
2806              This key is added in legacy HAL3.4. For legacy HAL3.3 or earlier devices, camera
2807              framework will generate this key as `(100, 100)` if device supports any of RAW output
2808              formats.  All legacy HAL3.4 and above devices should list this key if device supports
2809              any of RAW output formats.
2810           </hal_details>
2811         </entry>
2812       </static>
2813       <controls>
2814         <entry name="postRawSensitivityBoost" type="int32" visibility="public">
2815           <description>The amount of additional sensitivity boost applied to output images
2816              after RAW sensor data is captured.
2817           </description>
2818           <units>ISO arithmetic units, the same as android.sensor.sensitivity</units>
2819           <range>android.control.postRawSensitivityBoostRange</range>
2820           <details>
2821           Some camera devices support additional digital sensitivity boosting in the
2822           camera processing pipeline after sensor RAW image is captured.
2823           Such a boost will be applied to YUV/JPEG format output images but will not
2824           have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.
2825
2826           This key will be `null` for devices that do not support any RAW format
2827           outputs. For devices that do support RAW format outputs, this key will always
2828           present, and if a device does not support post RAW sensitivity boost, it will
2829           list `100` in this key.
2830
2831           If the camera device cannot apply the exact boost requested, it will reduce the
2832           boost to the nearest supported value.
2833           The final boost value used will be available in the output capture result.
2834
2835           For devices that support post RAW sensitivity boost, the YUV/JPEG output images
2836           of such device will have the total sensitivity of
2837           `android.sensor.sensitivity * android.control.postRawSensitivityBoost / 100`
2838           The sensitivity of RAW format images will always be `android.sensor.sensitivity`
2839
2840           This control is only effective if android.control.aeMode or android.control.mode is set to
2841           OFF; otherwise the auto-exposure algorithm will override this value.
2842           </details>
2843         </entry>
2844       </controls>
2845       <dynamic>
2846         <clone entry="android.control.postRawSensitivityBoost" kind="controls">
2847         </clone>
2848       </dynamic>
2849       <controls>
2850         <entry name="enableZsl" type="byte" visibility="public" enum="true" typedef="boolean">
2851           <enum>
2852             <value>FALSE
2853             <notes>Requests with android.control.captureIntent == STILL_CAPTURE must be captured
2854               after previous requests.</notes></value>
2855             <value>TRUE
2856             <notes>Requests with android.control.captureIntent == STILL_CAPTURE may or may not be
2857               captured before previous requests.</notes></value>
2858           </enum>
2859           <description>Allow camera device to enable zero-shutter-lag mode for requests with
2860             android.control.captureIntent == STILL_CAPTURE.
2861           </description>
2862           <details>
2863           If enableZsl is `true`, the camera device may enable zero-shutter-lag mode for requests with
2864           STILL_CAPTURE capture intent. The camera device may use images captured in the past to
2865           produce output images for a zero-shutter-lag request. The result metadata including the
2866           android.sensor.timestamp reflects the source frames used to produce output images.
2867           Therefore, the contents of the output images and the result metadata may be out of order
2868           compared to previous regular requests. enableZsl does not affect requests with other
2869           capture intents.
2870
2871           For example, when requests are submitted in the following order:
2872             Request A: enableZsl is ON, android.control.captureIntent is PREVIEW
2873             Request B: enableZsl is ON, android.control.captureIntent is STILL_CAPTURE
2874
2875           The output images for request B may have contents captured before the output images for
2876           request A, and the result metadata for request B may be older than the result metadata for
2877           request A.
2878
2879           Note that when enableZsl is `true`, it is not guaranteed to get output images captured in
2880           the past for requests with STILL_CAPTURE capture intent.
2881
2882           For applications targeting SDK versions O and newer, the value of enableZsl in
2883           TEMPLATE_STILL_CAPTURE template may be `true`. The value in other templates is always
2884           `false` if present.
2885
2886           For applications targeting SDK versions older than O, the value of enableZsl in all
2887           capture templates is always `false` if present.
2888
2889           For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.
2890           </details>
2891           <hal_details>
2892           It is valid for HAL to produce regular output images for requests with STILL_CAPTURE
2893           capture intent.
2894           </hal_details>
2895         </entry>
2896       </controls>
2897       <dynamic>
2898         <clone entry="android.control.enableZsl" kind="controls">
2899         </clone>
2900         <entry name="afSceneChange" type="byte" visibility="public" enum="true" hal_version="3.3">
2901           <enum>
2902             <value>NOT_DETECTED
2903             <notes>Scene change is not detected within the AF region(s).</notes></value>
2904             <value>DETECTED
2905             <notes>Scene change is detected within the AF region(s).</notes></value>
2906           </enum>
2907           <description>Whether a significant scene change is detected within the currently-set AF
2908           region(s).</description>
2909           <details>When the camera focus routine detects a change in the scene it is looking at,
2910           such as a large shift in camera viewpoint, significant motion in the scene, or a
2911           significant illumination change, this value will be set to DETECTED for a single capture
2912           result. Otherwise the value will be NOT_DETECTED. The threshold for detection is similar
2913           to what would trigger a new passive focus scan to begin in CONTINUOUS autofocus modes.
2914
2915           This key will be available if the camera device advertises this key via {@link
2916           android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys|ACAMERA_REQUEST_AVAILABLE_RESULT_KEYS}.
2917           </details>
2918         </entry>
2919       </dynamic>
2920     </section>
2921     <section name="demosaic">
2922       <controls>
2923         <entry name="mode" type="byte" enum="true">
2924           <enum>
2925             <value>FAST
2926             <notes>Minimal or no slowdown of frame rate compared to
2927             Bayer RAW output.</notes></value>
2928             <value>HIGH_QUALITY
2929             <notes>Improved processing quality but the frame rate might be slowed down
2930             relative to raw output.</notes></value>
2931           </enum>
2932           <description>Controls the quality of the demosaicing
2933           processing.</description>
2934           <tag id="FUTURE" />
2935         </entry>
2936       </controls>
2937     </section>
2938     <section name="edge">
2939       <controls>
2940         <entry name="mode" type="byte" visibility="public" enum="true" hwlevel="full">
2941           <enum>
2942             <value>OFF
2943             <notes>No edge enhancement is applied.</notes></value>
2944             <value>FAST
2945             <notes>Apply edge enhancement at a quality level that does not slow down frame rate
2946             relative to sensor output. It may be the same as OFF if edge enhancement will
2947             slow down frame rate relative to sensor.</notes></value>
2948             <value>HIGH_QUALITY
2949             <notes>Apply high-quality edge enhancement, at a cost of possibly reduced output frame rate.
2950             </notes></value>
2951             <value optional="true">ZERO_SHUTTER_LAG <notes>Edge enhancement is applied at different
2952             levels for different output streams, based on resolution. Streams at maximum recording
2953             resolution (see {@link
2954             android.hardware.camera2.CameraDevice#createCaptureSession|ACameraDevice_createCaptureSession})
2955             or below have edge enhancement applied, while higher-resolution streams have no edge
2956             enhancement applied. The level of edge enhancement for low-resolution streams is tuned
2957             so that frame rate is not impacted, and the quality is equal to or better than FAST
2958             (since it is only applied to lower-resolution outputs, quality may improve from FAST).
2959
2960             This mode is intended to be used by applications operating in a zero-shutter-lag mode
2961             with YUV or PRIVATE reprocessing, where the application continuously captures
2962             high-resolution intermediate buffers into a circular buffer, from which a final image is
2963             produced via reprocessing when a user takes a picture.  For such a use case, the
2964             high-resolution buffers must not have edge enhancement applied to maximize efficiency of
2965             preview and to avoid double-applying enhancement when reprocessed, while low-resolution
2966             buffers (used for recording or preview, generally) need edge enhancement applied for
2967             reasonable preview quality.
2968
2969             This mode is guaranteed to be supported by devices that support either the
2970             YUV_REPROCESSING or PRIVATE_REPROCESSING capabilities
2971             (android.request.availableCapabilities lists either of those capabilities) and it will
2972             be the default mode for CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.
2973             </notes></value>
2974           </enum>
2975           <description>Operation mode for edge
2976           enhancement.</description>
2977           <range>android.edge.availableEdgeModes</range>
2978           <details>Edge enhancement improves sharpness and details in the captured image. OFF means
2979           no enhancement will be applied by the camera device.
2980
2981           FAST/HIGH_QUALITY both mean camera device determined enhancement
2982           will be applied. HIGH_QUALITY mode indicates that the
2983           camera device will use the highest-quality enhancement algorithms,
2984           even if it slows down capture rate. FAST means the camera device will
2985           not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if
2986           edge enhancement will slow down capture rate. Every output stream will have a similar
2987           amount of enhancement applied.
2988
2989           ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
2990           buffer of high-resolution images during preview and reprocess image(s) from that buffer
2991           into a final capture when triggered by the user. In this mode, the camera device applies
2992           edge enhancement to low-resolution streams (below maximum recording resolution) to
2993           maximize preview quality, but does not apply edge enhancement to high-resolution streams,
2994           since those will be reprocessed later if necessary.
2995
2996           For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
2997           device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
2998           The camera device may adjust its internal edge enhancement parameters for best
2999           image quality based on the android.reprocess.effectiveExposureFactor, if it is set.
3000           </details>
3001           <hal_details>
3002           For YUV_REPROCESSING The HAL can use android.reprocess.effectiveExposureFactor to
3003           adjust the internal edge enhancement reduction parameters appropriately to get the best
3004           quality images.
3005           </hal_details>
3006           <tag id="V1" />
3007           <tag id="REPROC" />
3008         </entry>
3009         <entry name="strength" type="byte">
3010           <description>Control the amount of edge enhancement
3011           applied to the images</description>
3012           <units>1-10; 10 is maximum sharpening</units>
3013           <tag id="FUTURE" />
3014         </entry>
3015       </controls>
3016       <static>
3017         <entry name="availableEdgeModes" type="byte" visibility="public"
3018                type_notes="list of enums" container="array" typedef="enumList"
3019                hwlevel="full">
3020           <array>
3021             <size>n</size>
3022           </array>
3023           <description>
3024           List of edge enhancement modes for android.edge.mode that are supported by this camera
3025           device.
3026           </description>
3027           <range>Any value listed in android.edge.mode</range>
3028           <details>
3029           Full-capability camera devices must always support OFF; camera devices that support
3030           YUV_REPROCESSING or PRIVATE_REPROCESSING will list ZERO_SHUTTER_LAG; all devices will
3031           list FAST.
3032           </details>
3033           <hal_details>
3034           HAL must support both FAST and HIGH_QUALITY if edge enhancement control is available
3035           on the camera device, but the underlying implementation can be the same for both modes.
3036           That is, if the highest quality implementation on the camera device does not slow down
3037           capture rate, then FAST and HIGH_QUALITY will generate the same output.
3038           </hal_details>
3039           <tag id="V1" />
3040           <tag id="REPROC" />
3041         </entry>
3042       </static>
3043       <dynamic>
3044         <clone entry="android.edge.mode" kind="controls">
3045           <tag id="V1" />
3046           <tag id="REPROC" />
3047         </clone>
3048       </dynamic>
3049     </section>
3050     <section name="flash">
3051       <controls>
3052         <entry name="firingPower" type="byte">
3053           <description>Power for flash firing/torch</description>
3054           <units>10 is max power; 0 is no flash. Linear</units>
3055           <range>0 - 10</range>
3056           <details>Power for snapshot may use a different scale than
3057           for torch mode. Only one entry for torch mode will be
3058           used</details>
3059           <tag id="FUTURE" />
3060         </entry>
3061         <entry name="firingTime" type="int64">
3062           <description>Firing time of flash relative to start of
3063           exposure</description>
3064           <units>nanoseconds</units>
3065           <range>0-(exposure time-flash duration)</range>
3066           <details>Clamped to (0, exposure time - flash
3067           duration).</details>
3068           <tag id="FUTURE" />
3069         </entry>
3070         <entry name="mode" type="byte" visibility="public" enum="true" hwlevel="legacy">
3071           <enum>
3072             <value>OFF
3073               <notes>
3074               Do not fire the flash for this capture.
3075               </notes>
3076             </value>
3077             <value>SINGLE
3078               <notes>
3079               If the flash is available and charged, fire flash
3080               for this capture.
3081               </notes>
3082             </value>
3083             <value>TORCH
3084               <notes>
3085               Transition flash to continuously on.
3086               </notes>
3087             </value>
3088           </enum>
3089           <description>The desired mode for for the camera device's flash control.</description>
3090           <details>
3091           This control is only effective when flash unit is available
3092           (`android.flash.info.available == true`).
3093
3094           When this control is used, the android.control.aeMode must be set to ON or OFF.
3095           Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
3096           ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.
3097
3098           When set to OFF, the camera device will not fire flash for this capture.
3099
3100           When set to SINGLE, the camera device will fire flash regardless of the camera
3101           device's auto-exposure routine's result. When used in still capture case, this
3102           control should be used along with auto-exposure (AE) precapture metering sequence
3103           (android.control.aePrecaptureTrigger), otherwise, the image may be incorrectly exposed.
3104
3105           When set to TORCH, the flash will be on continuously. This mode can be used
3106           for use cases such as preview, auto-focus assist, still capture, or video recording.
3107
3108           The flash status will be reported by android.flash.state in the capture result metadata.
3109           </details>
3110           <tag id="BC" />
3111         </entry>
3112       </controls>
3113       <static>
3114         <namespace name="info">
3115           <entry name="available" type="byte" visibility="public" enum="true"
3116                  typedef="boolean" hwlevel="legacy">
3117             <enum>
3118               <value>FALSE</value>
3119               <value>TRUE</value>
3120             </enum>
3121             <description>Whether this camera device has a
3122             flash unit.</description>
3123             <details>
3124             Will be `false` if no flash is available.
3125
3126             If there is no flash unit, none of the flash controls do
3127             anything.</details>
3128             <tag id="BC" />
3129           </entry>
3130           <entry name="chargeDuration" type="int64">
3131             <description>Time taken before flash can fire
3132             again</description>
3133             <units>nanoseconds</units>
3134             <range>0-1e9</range>
3135             <details>1 second too long/too short for recharge? Should
3136             this be power-dependent?</details>
3137             <tag id="FUTURE" />
3138           </entry>
3139         </namespace>
3140         <entry name="colorTemperature" type="byte">
3141           <description>The x,y whitepoint of the
3142           flash</description>
3143           <units>pair of floats</units>
3144           <range>0-1 for both</range>
3145           <tag id="FUTURE" />
3146         </entry>
3147         <entry name="maxEnergy" type="byte">
3148           <description>Max energy output of the flash for a full
3149           power single flash</description>
3150           <units>lumen-seconds</units>
3151           <range>&amp;gt;= 0</range>
3152           <tag id="FUTURE" />
3153         </entry>
3154       </static>
3155       <dynamic>
3156         <clone entry="android.flash.firingPower" kind="controls">
3157         </clone>
3158         <clone entry="android.flash.firingTime" kind="controls">
3159         </clone>
3160         <clone entry="android.flash.mode" kind="controls"></clone>
3161         <entry name="state" type="byte" visibility="public" enum="true"
3162                hwlevel="limited">
3163           <enum>
3164             <value>UNAVAILABLE
3165             <notes>No flash on camera.</notes></value>
3166             <value>CHARGING
3167             <notes>Flash is charging and cannot be fired.</notes></value>
3168             <value>READY
3169             <notes>Flash is ready to fire.</notes></value>
3170             <value>FIRED
3171             <notes>Flash fired for this capture.</notes></value>
3172             <value>PARTIAL
3173             <notes>Flash partially illuminated this frame.
3174
3175             This is usually due to the next or previous frame having
3176             the flash fire, and the flash spilling into this capture
3177             due to hardware limitations.</notes></value>
3178           </enum>
3179           <description>Current state of the flash
3180           unit.</description>
3181           <details>
3182           When the camera device doesn't have flash unit
3183           (i.e. `android.flash.info.available == false`), this state will always be UNAVAILABLE.
3184           Other states indicate the current flash status.
3185
3186           In certain conditions, this will be available on LEGACY devices:
3187
3188            * Flash-less cameras always return UNAVAILABLE.
3189            * Using android.control.aeMode `==` ON_ALWAYS_FLASH
3190              will always return FIRED.
3191            * Using android.flash.mode `==` TORCH
3192              will always return FIRED.
3193
3194           In all other conditions the state will not be available on
3195           LEGACY devices (i.e. it will be `null`).
3196           </details>
3197         </entry>
3198       </dynamic>
3199     </section>
3200     <section name="hotPixel">
3201       <controls>
3202         <entry name="mode" type="byte" visibility="public" enum="true">
3203           <enum>
3204             <value>OFF
3205               <notes>
3206               No hot pixel correction is applied.
3207
3208               The frame rate must not be reduced relative to sensor raw output
3209               for this option.
3210
3211               The hotpixel map may be returned in android.statistics.hotPixelMap.
3212               </notes>
3213             </value>
3214             <value>FAST
3215               <notes>
3216               Hot pixel correction is applied, without reducing frame
3217               rate relative to sensor raw output.
3218
3219               The hotpixel map may be returned in android.statistics.hotPixelMap.
3220               </notes>
3221             </value>
3222             <value>HIGH_QUALITY
3223               <notes>
3224               High-quality hot pixel correction is applied, at a cost
3225               of possibly reduced frame rate relative to sensor raw output.
3226
3227               The hotpixel map may be returned in android.statistics.hotPixelMap.
3228               </notes>
3229             </value>
3230           </enum>
3231           <description>
3232           Operational mode for hot pixel correction.
3233           </description>
3234           <range>android.hotPixel.availableHotPixelModes</range>
3235           <details>
3236           Hotpixel correction interpolates out, or otherwise removes, pixels
3237           that do not accurately measure the incoming light (i.e. pixels that
3238           are stuck at an arbitrary value or are oversensitive).
3239           </details>
3240           <tag id="V1" />
3241           <tag id="RAW" />
3242         </entry>
3243       </controls>
3244       <static>
3245         <entry name="availableHotPixelModes" type="byte" visibility="public"
3246           type_notes="list of enums" container="array" typedef="enumList">
3247           <array>
3248             <size>n</size>
3249           </array>
3250           <description>
3251           List of hot pixel correction modes for android.hotPixel.mode that are supported by this
3252           camera device.
3253           </description>
3254           <range>Any value listed in android.hotPixel.mode</range>
3255           <details>
3256           FULL mode camera devices will always support FAST.
3257           </details>
3258           <hal_details>
3259           To avoid performance issues, there will be significantly fewer hot
3260           pixels than actual pixels on the camera sensor.
3261           HAL must support both FAST and HIGH_QUALITY if hot pixel correction control is available
3262           on the camera device, but the underlying implementation can be the same for both modes.
3263           That is, if the highest quality implementation on the camera device does not slow down
3264           capture rate, then FAST and HIGH_QUALITY will generate the same output.
3265           </hal_details>
3266           <tag id="V1" />
3267           <tag id="RAW" />
3268         </entry>
3269       </static>
3270       <dynamic>
3271         <clone entry="android.hotPixel.mode" kind="controls">
3272           <tag id="V1" />
3273           <tag id="RAW" />
3274         </clone>
3275       </dynamic>
3276     </section>
3277     <section name="jpeg">
3278       <controls>
3279         <entry name="gpsLocation" type="byte" visibility="java_public" synthetic="true"
3280         typedef="location" hwlevel="legacy">
3281           <description>
3282           A location object to use when generating image GPS metadata.
3283           </description>
3284           <details>
3285           Setting a location object in a request will include the GPS coordinates of the location
3286           into any JPEG images captured based on the request. These coordinates can then be
3287           viewed by anyone who receives the JPEG image.
3288           </details>
3289         </entry>
3290         <entry name="gpsCoordinates" type="double" visibility="ndk_public"
3291         type_notes="latitude, longitude, altitude. First two in degrees, the third in meters"
3292         container="array" hwlevel="legacy">
3293           <array>
3294             <size>3</size>
3295           </array>
3296           <description>GPS coordinates to include in output JPEG
3297           EXIF.</description>
3298           <range>(-180 - 180], [-90,90], [-inf, inf]</range>
3299           <tag id="BC" />
3300         </entry>
3301         <entry name="gpsProcessingMethod" type="byte" visibility="ndk_public"
3302                typedef="string" hwlevel="legacy">
3303           <description>32 characters describing GPS algorithm to
3304           include in EXIF.</description>
3305           <units>UTF-8 null-terminated string</units>
3306           <tag id="BC" />
3307         </entry>
3308         <entry name="gpsTimestamp" type="int64" visibility="ndk_public" hwlevel="legacy">
3309           <description>Time GPS fix was made to include in
3310           EXIF.</description>
3311           <units>UTC in seconds since January 1, 1970</units>
3312           <tag id="BC" />
3313         </entry>
3314         <entry name="orientation" type="int32" visibility="public" hwlevel="legacy">
3315           <description>The orientation for a JPEG image.</description>
3316           <units>Degrees in multiples of 90</units>
3317           <range>0, 90, 180, 270</range>
3318           <details>
3319           The clockwise rotation angle in degrees, relative to the orientation
3320           to the camera, that the JPEG picture needs to be rotated by, to be viewed
3321           upright.
3322
3323           Camera devices may either encode this value into the JPEG EXIF header, or
3324           rotate the image data to match this orientation. When the image data is rotated,
3325           the thumbnail data will also be rotated.
3326
3327           Note that this orientation is relative to the orientation of the camera sensor, given
3328           by android.sensor.orientation.
3329
3330           To translate from the device orientation given by the Android sensor APIs, the following
3331           sample code may be used:
3332
3333               private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
3334                   if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
3335                   int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
3336
3337                   // Round device orientation to a multiple of 90
3338                   deviceOrientation = (deviceOrientation + 45) / 90 * 90;
3339
3340                   // Reverse device orientation for front-facing cameras
3341                   boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
3342                   if (facingFront) deviceOrientation = -deviceOrientation;
3343
3344                   // Calculate desired JPEG orientation relative to camera orientation to make
3345                   // the image upright relative to the device orientation
3346                   int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
3347
3348                   return jpegOrientation;
3349               }
3350           </details>
3351           <tag id="BC" />
3352         </entry>
3353         <entry name="quality" type="byte" visibility="public" hwlevel="legacy">
3354           <description>Compression quality of the final JPEG
3355           image.</description>
3356           <range>1-100; larger is higher quality</range>
3357           <details>85-95 is typical usage range.</details>
3358           <tag id="BC" />
3359         </entry>
3360         <entry name="thumbnailQuality" type="byte" visibility="public" hwlevel="legacy">
3361           <description>Compression quality of JPEG
3362           thumbnail.</description>
3363           <range>1-100; larger is higher quality</range>
3364           <tag id="BC" />
3365         </entry>
3366         <entry name="thumbnailSize" type="int32" visibility="public"
3367         container="array" typedef="size" hwlevel="legacy">
3368           <array>
3369             <size>2</size>
3370           </array>
3371           <description>Resolution of embedded JPEG thumbnail.</description>
3372           <range>android.jpeg.availableThumbnailSizes</range>
3373           <details>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
3374           but the captured JPEG will still be a valid image.
3375
3376           For best results, when issuing a request for a JPEG image, the thumbnail size selected
3377           should have the same aspect ratio as the main JPEG output.
3378
3379           If the thumbnail image aspect ratio differs from the JPEG primary image aspect
3380           ratio, the camera device creates the thumbnail by cropping it from the primary image.
3381           For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
3382           16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
3383           generate the thumbnail image. The thumbnail image will always have a smaller Field
3384           Of View (FOV) than the primary image when aspect ratios differ.
3385
3386           When an android.jpeg.orientation of non-zero degree is requested,
3387           the camera device will handle thumbnail rotation in one of the following ways:
3388
3389           * Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}
3390             and keep jpeg and thumbnail image data unrotated.
3391           * Rotate the jpeg and thumbnail image data and not set
3392             {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this
3393             case, LIMITED or FULL hardware level devices will report rotated thumnail size in
3394             capture result, so the width and height will be interchanged if 90 or 270 degree
3395             orientation is requested. LEGACY device will always report unrotated thumbnail
3396             size.
3397           </details>
3398           <hal_details>
3399           The HAL must not squeeze or stretch the downscaled primary image to generate thumbnail.
3400           The cropping must be done on the primary jpeg image rather than the sensor active array.
3401           The stream cropping rule specified by "S5. Cropping" in camera3.h doesn't apply to the
3402           thumbnail image cropping.
3403           </hal_details>
3404           <tag id="BC" />
3405         </entry>
3406       </controls>
3407       <static>
3408         <entry name="availableThumbnailSizes" type="int32" visibility="public"
3409         container="array" typedef="size" hwlevel="legacy">
3410           <array>
3411             <size>2</size>
3412             <size>n</size>
3413           </array>
3414           <description>List of JPEG thumbnail sizes for android.jpeg.thumbnailSize supported by this
3415           camera device.</description>
3416           <details>
3417           This list will include at least one non-zero resolution, plus `(0,0)` for indicating no
3418           thumbnail should be generated.
3419
3420           Below condiditions will be satisfied for this size list:
3421
3422           * The sizes will be sorted by increasing pixel area (width x height).
3423           If several resolutions have the same area, they will be sorted by increasing width.
3424           * The aspect ratio of the largest thumbnail size will be same as the
3425           aspect ratio of largest JPEG output size in android.scaler.availableStreamConfigurations.
3426           The largest size is defined as the size that has the largest pixel area
3427           in a given size list.
3428           * Each output JPEG size in android.scaler.availableStreamConfigurations will have at least
3429           one corresponding size that has the same aspect ratio in availableThumbnailSizes,
3430           and vice versa.
3431           * All non-`(0, 0)` sizes will have non-zero widths and heights.</details>
3432           <tag id="BC" />
3433         </entry>
3434         <entry name="maxSize" type="int32" visibility="system">
3435           <description>Maximum size in bytes for the compressed
3436           JPEG buffer</description>
3437           <range>Must be large enough to fit any JPEG produced by
3438           the camera</range>
3439           <details>This is used for sizing the gralloc buffers for
3440           JPEG</details>
3441         </entry>
3442       </static>
3443       <dynamic>
3444         <clone entry="android.jpeg.gpsLocation" kind="controls">
3445         </clone>
3446         <clone entry="android.jpeg.gpsCoordinates" kind="controls">
3447         </clone>
3448         <clone entry="android.jpeg.gpsProcessingMethod"
3449         kind="controls"></clone>
3450         <clone entry="android.jpeg.gpsTimestamp" kind="controls">
3451         </clone>
3452         <clone entry="android.jpeg.orientation" kind="controls">
3453         </clone>
3454         <clone entry="android.jpeg.quality" kind="controls">
3455         </clone>
3456         <entry name="size" type="int32">
3457           <description>The size of the compressed JPEG image, in
3458           bytes</description>
3459           <range>&amp;gt;= 0</range>
3460           <details>If no JPEG output is produced for the request,
3461           this must be 0.
3462
3463           Otherwise, this describes the real size of the compressed
3464           JPEG image placed in the output stream.  More specifically,
3465           if android.jpeg.maxSize = 1000000, and a specific capture
3466           has android.jpeg.size = 500000, then the output buffer from
3467           the JPEG stream will be 1000000 bytes, of which the first
3468           500000 make up the real data.</details>
3469           <tag id="FUTURE" />
3470         </entry>
3471         <clone entry="android.jpeg.thumbnailQuality"
3472         kind="controls"></clone>
3473         <clone entry="android.jpeg.thumbnailSize" kind="controls">
3474         </clone>
3475       </dynamic>
3476     </section>
3477     <section name="lens">
3478       <controls>
3479         <entry name="aperture" type="float" visibility="public" hwlevel="full">
3480           <description>The desired lens aperture size, as a ratio of lens focal length to the
3481           effective aperture diameter.</description>
3482           <units>The f-number (f/N)</units>
3483           <range>android.lens.info.availableApertures</range>
3484           <details>Setting this value is only supported on the camera devices that have a variable
3485           aperture lens.
3486
3487           When this is supported and android.control.aeMode is OFF,
3488           this can be set along with android.sensor.exposureTime,
3489           android.sensor.sensitivity, and android.sensor.frameDuration
3490           to achieve manual exposure control.
3491
3492           The requested aperture value may take several frames to reach the
3493           requested value; the camera device will report the current (intermediate)
3494           aperture size in capture result metadata while the aperture is changing.
3495           While the aperture is still changing, android.lens.state will be set to MOVING.
3496
3497           When this is supported and android.control.aeMode is one of
3498           the ON modes, this will be overridden by the camera device
3499           auto-exposure algorithm, the overridden values are then provided
3500           back to the user in the corresponding result.</details>
3501           <tag id="V1" />
3502         </entry>
3503         <entry name="filterDensity" type="float" visibility="public" hwlevel="full">
3504           <description>
3505           The desired setting for the lens neutral density filter(s).
3506           </description>
3507           <units>Exposure Value (EV)</units>
3508           <range>android.lens.info.availableFilterDensities</range>
3509           <details>
3510           This control will not be supported on most camera devices.
3511
3512           Lens filters are typically used to lower the amount of light the
3513           sensor is exposed to (measured in steps of EV). As used here, an EV
3514           step is the standard logarithmic representation, which are
3515           non-negative, and inversely proportional to the amount of light
3516           hitting the sensor.  For example, setting this to 0 would result
3517           in no reduction of the incoming light, and setting this to 2 would
3518           mean that the filter is set to reduce incoming light by two stops
3519           (allowing 1/4 of the prior amount of light to the sensor).
3520
3521           It may take several frames before the lens filter density changes
3522           to the requested value. While the filter density is still changing,
3523           android.lens.state will be set to MOVING.
3524           </details>
3525           <tag id="V1" />
3526         </entry>
3527         <entry name="focalLength" type="float" visibility="public" hwlevel="legacy">
3528           <description>
3529           The desired lens focal length; used for optical zoom.
3530           </description>
3531           <units>Millimeters</units>
3532           <range>android.lens.info.availableFocalLengths</range>
3533           <details>
3534           This setting controls the physical focal length of the camera
3535           device's lens. Changing the focal length changes the field of
3536           view of the camera device, and is usually used for optical zoom.
3537
3538           Like android.lens.focusDistance and android.lens.aperture, this
3539           setting won't be applied instantaneously, and it may take several
3540           frames before the lens can change to the requested focal length.
3541           While the focal length is still changing, android.lens.state will
3542           be set to MOVING.
3543
3544           Optical zoom will not be supported on most devices.
3545           </details>
3546           <tag id="V1" />
3547         </entry>
3548         <entry name="focusDistance" type="float" visibility="public" hwlevel="full">
3549           <description>Desired distance to plane of sharpest focus,
3550           measured from frontmost surface of the lens.</description>
3551           <units>See android.lens.info.focusDistanceCalibration for details</units>
3552           <range>&amp;gt;= 0</range>
3553           <details>
3554           This control can be used for setting manual focus, on devices that support
3555           the MANUAL_SENSOR capability and have a variable-focus lens (see
3556           android.lens.info.minimumFocusDistance).
3557
3558           A value of `0.0f` means infinity focus. The value set will be clamped to
3559           `[0.0f, android.lens.info.minimumFocusDistance]`.
3560
3561           Like android.lens.focalLength, this setting won't be applied
3562           instantaneously, and it may take several frames before the lens
3563           can move to the requested focus distance. While the lens is still moving,
3564           android.lens.state will be set to MOVING.
3565
3566           LEGACY devices support at most setting this to `0.0f`
3567           for infinity focus.
3568           </details>
3569           <tag id="BC" />
3570           <tag id="V1" />
3571         </entry>
3572         <entry name="opticalStabilizationMode" type="byte" visibility="public"
3573         enum="true" hwlevel="limited">
3574           <enum>
3575             <value>OFF
3576               <notes>Optical stabilization is unavailable.</notes>
3577             </value>
3578             <value optional="true">ON
3579               <notes>Optical stabilization is enabled.</notes>
3580             </value>
3581           </enum>
3582           <description>
3583           Sets whether the camera device uses optical image stabilization (OIS)
3584           when capturing images.
3585           </description>
3586           <range>android.lens.info.availableOpticalStabilization</range>
3587           <details>
3588           OIS is used to compensate for motion blur due to small
3589           movements of the camera during capture. Unlike digital image
3590           stabilization (android.control.videoStabilizationMode), OIS
3591           makes use of mechanical elements to stabilize the camera
3592           sensor, and thus allows for longer exposure times before
3593           camera shake becomes apparent.
3594
3595           Switching between different optical stabilization modes may take several
3596           frames to initialize, the camera device will report the current mode in
3597           capture result metadata. For example, When "ON" mode is requested, the
3598           optical stabilization modes in the first several capture results may still
3599           be "OFF", and it will become "ON" when the initialization is done.
3600
3601           If a camera device supports both OIS and digital image stabilization
3602           (android.control.videoStabilizationMode), turning both modes on may produce undesirable
3603           interaction, so it is recommended not to enable both at the same time.
3604
3605           Not all devices will support OIS; see
3606           android.lens.info.availableOpticalStabilization for
3607           available controls.
3608           </details>
3609           <tag id="V1" />
3610         </entry>
3611       </controls>
3612       <static>
3613         <namespace name="info">
3614           <entry name="availableApertures" type="float" visibility="public"
3615           container="array" hwlevel="full">
3616             <array>
3617               <size>n</size>
3618             </array>
3619             <description>List of aperture size values for android.lens.aperture that are
3620             supported by this camera device.</description>
3621             <units>The aperture f-number</units>
3622             <details>If the camera device doesn't support a variable lens aperture,
3623             this list will contain only one value, which is the fixed aperture size.
3624
3625             If the camera device supports a variable aperture, the aperture values
3626             in this list will be sorted in ascending order.</details>
3627             <tag id="V1" />
3628           </entry>
3629           <entry name="availableFilterDensities" type="float" visibility="public"
3630           container="array" hwlevel="full">
3631             <array>
3632               <size>n</size>
3633             </array>
3634             <description>
3635             List of neutral density filter values for
3636             android.lens.filterDensity that are supported by this camera device.
3637             </description>
3638             <units>Exposure value (EV)</units>
3639             <range>
3640             Values are &amp;gt;= 0
3641             </range>
3642             <details>
3643             If a neutral density filter is not supported by this camera device,
3644             this list will contain only 0. Otherwise, this list will include every
3645             filter density supported by the camera device, in ascending order.
3646             </details>
3647             <tag id="V1" />
3648           </entry>
3649           <entry name="availableFocalLengths" type="float" visibility="public"
3650           type_notes="The list of available focal lengths"
3651           container="array" hwlevel="legacy">
3652             <array>
3653               <size>n</size>
3654             </array>
3655             <description>
3656             List of focal lengths for android.lens.focalLength that are supported by this camera
3657             device.
3658             </description>
3659             <units>Millimeters</units>
3660             <range>
3661             Values are &amp;gt; 0
3662             </range>
3663             <details>
3664             If optical zoom is not supported, this list will only contain
3665             a single value corresponding to the fixed focal length of the
3666             device. Otherwise, this list will include every focal length supported
3667             by the camera device, in ascending order.
3668             </details>
3669             <tag id="BC" />
3670             <tag id="V1" />
3671           </entry>
3672           <entry name="availableOpticalStabilization" type="byte"
3673           visibility="public" type_notes="list of enums" container="array"
3674           typedef="enumList" hwlevel="limited">
3675             <array>
3676               <size>n</size>
3677             </array>
3678             <description>
3679             List of optical image stabilization (OIS) modes for
3680             android.lens.opticalStabilizationMode that are supported by this camera device.
3681             </description>
3682             <range>Any value listed in android.lens.opticalStabilizationMode</range>
3683             <details>
3684             If OIS is not supported by a given camera device, this list will
3685             contain only OFF.
3686             </details>
3687             <tag id="V1" />
3688           </entry>
3689           <entry name="hyperfocalDistance" type="float" visibility="public" optional="true"
3690                  hwlevel="limited">
3691             <description>Hyperfocal distance for this lens.</description>
3692             <units>See android.lens.info.focusDistanceCalibration for details</units>
3693             <range>If lens is fixed focus, &amp;gt;= 0. If lens has focuser unit, the value is
3694             within `(0.0f, android.lens.info.minimumFocusDistance]`</range>
3695             <details>
3696             If the lens is not fixed focus, the camera device will report this
3697             field when android.lens.info.focusDistanceCalibration is APPROXIMATE or CALIBRATED.
3698             </details>
3699           </entry>
3700           <entry name="minimumFocusDistance" type="float" visibility="public" optional="true"
3701                  hwlevel="limited">
3702             <description>Shortest distance from frontmost surface
3703             of the lens that can be brought into sharp focus.</description>
3704             <units>See android.lens.info.focusDistanceCalibration for details</units>
3705             <range>&amp;gt;= 0</range>
3706             <details>If the lens is fixed-focus, this will be
3707             0.</details>
3708             <hal_details>Mandatory for FULL devices; LIMITED devices
3709             must always set this value to 0 for fixed-focus; and may omit
3710             the minimum focus distance otherwise.
3711
3712             This field is also mandatory for all devices advertising
3713             the MANUAL_SENSOR capability.</hal_details>
3714             <tag id="V1" />
3715           </entry>
3716           <entry name="shadingMapSize" type="int32" visibility="ndk_public"
3717                  type_notes="width and height (N, M) of lens shading map provided by the camera device."
3718                  container="array" typedef="size" hwlevel="full">
3719             <array>
3720               <size>2</size>
3721             </array>
3722             <description>Dimensions of lens shading map.</description>
3723             <range>Both values &amp;gt;= 1</range>
3724             <details>
3725             The map should be on the order of 30-40 rows and columns, and
3726             must be smaller than 64x64.
3727             </details>
3728             <tag id="V1" />
3729           </entry>
3730           <entry name="focusDistanceCalibration" type="byte" visibility="public"
3731                  enum="true" hwlevel="limited">
3732             <enum>
3733               <value>UNCALIBRATED
3734                 <notes>
3735                 The lens focus distance is not accurate, and the units used for
3736                 android.lens.focusDistance do not correspond to any physical units.
3737
3738                 Setting the lens to the same focus distance on separate occasions may
3739                 result in a different real focus distance, depending on factors such
3740                 as the orientation of the device, the age of the focusing mechanism,
3741                 and the device temperature. The focus distance value will still be
3742                 in the range of `[0, android.lens.info.minimumFocusDistance]`, where 0
3743                 represents the farthest focus.
3744                 </notes>
3745               </value>
3746               <value>APPROXIMATE
3747                 <notes>
3748                 The lens focus distance is measured in diopters.
3749
3750                 However, setting the lens to the same focus distance
3751                 on separate occasions may result in a different real
3752                 focus distance, depending on factors such as the
3753                 orientation of the device, the age of the focusing
3754                 mechanism, and the device temperature.
3755                 </notes>
3756               </value>
3757               <value>CALIBRATED
3758                 <notes>
3759                 The lens focus distance is measured in diopters, and
3760                 is calibrated.
3761
3762                 The lens mechanism is calibrated so that setting the
3763                 same focus distance is repeatable on multiple
3764                 occasions with good accuracy, and the focus distance
3765                 corresponds to the real physical distance to the plane
3766                 of best focus.
3767                 </notes>
3768               </value>
3769             </enum>
3770             <description>The lens focus distance calibration quality.</description>
3771             <details>
3772             The lens focus distance calibration quality determines the reliability of
3773             focus related metadata entries, i.e. android.lens.focusDistance,
3774             android.lens.focusRange, android.lens.info.hyperfocalDistance, and
3775             android.lens.info.minimumFocusDistance.
3776
3777             APPROXIMATE and CALIBRATED devices report the focus metadata in
3778             units of diopters (1/meter), so `0.0f` represents focusing at infinity,
3779             and increasing positive numbers represent focusing closer and closer
3780             to the camera device. The focus distance control also uses diopters
3781             on these devices.
3782
3783             UNCALIBRATED devices do not use units that are directly comparable
3784             to any real physical measurement, but `0.0f` still represents farthest
3785             focus, and android.lens.info.minimumFocusDistance represents the
3786             nearest focus the device can achieve.
3787             </details>
3788             <hal_details>
3789             For devices advertise APPROXIMATE quality or higher, diopters 0 (infinity
3790             focus) must work. When autofocus is disabled (android.control.afMode == OFF)
3791             and the lens focus distance is set to 0 diopters
3792             (android.lens.focusDistance == 0), the lens will move to focus at infinity
3793             and is stably focused at infinity even if the device tilts. It may take the
3794             lens some time to move; during the move the lens state should be MOVING and
3795             the output diopter value should be changing toward 0.
3796             </hal_details>
3797           <tag id="V1" />
3798         </entry>
3799         </namespace>
3800         <entry name="facing" type="byte" visibility="public" enum="true" hwlevel="legacy">
3801           <enum>
3802             <value>FRONT
3803             <notes>
3804               The camera device faces the same direction as the device's screen.
3805             </notes></value>
3806             <value>BACK
3807             <notes>
3808               The camera device faces the opposite direction as the device's screen.
3809             </notes></value>
3810             <value>EXTERNAL
3811             <notes>
3812               The camera device is an external camera, and has no fixed facing relative to the
3813               device's screen.
3814             </notes></value>
3815           </enum>
3816           <description>Direction the camera faces relative to
3817           device screen.</description>
3818         </entry>
3819         <entry name="poseRotation" type="float" visibility="public"
3820                container="array">
3821           <array>
3822             <size>4</size>
3823           </array>
3824           <description>
3825             The orientation of the camera relative to the sensor
3826             coordinate system.
3827           </description>
3828           <units>
3829             Quaternion coefficients
3830           </units>
3831           <details>
3832             The four coefficients that describe the quaternion
3833             rotation from the Android sensor coordinate system to a
3834             camera-aligned coordinate system where the X-axis is
3835             aligned with the long side of the image sensor, the Y-axis
3836             is aligned with the short side of the image sensor, and
3837             the Z-axis is aligned with the optical axis of the sensor.
3838
3839             To convert from the quaternion coefficients `(x,y,z,w)`
3840             to the axis of rotation `(a_x, a_y, a_z)` and rotation
3841             amount `theta`, the following formulas can be used:
3842
3843                  theta = 2 * acos(w)
3844                 a_x = x / sin(theta/2)
3845                 a_y = y / sin(theta/2)
3846                 a_z = z / sin(theta/2)
3847
3848             To create a 3x3 rotation matrix that applies the rotation
3849             defined by this quaternion, the following matrix can be
3850             used:
3851
3852                 R = [ 1 - 2y^2 - 2z^2,       2xy - 2zw,       2xz + 2yw,
3853                            2xy + 2zw, 1 - 2x^2 - 2z^2,       2yz - 2xw,
3854                            2xz - 2yw,       2yz + 2xw, 1 - 2x^2 - 2y^2 ]
3855
3856              This matrix can then be used to apply the rotation to a
3857              column vector point with
3858
3859                `p' = Rp`
3860
3861              where `p` is in the device sensor coordinate system, and
3862              `p'` is in the camera-oriented coordinate system.
3863           </details>
3864           <tag id="DEPTH" />
3865         </entry>
3866         <entry name="poseTranslation" type="float" visibility="public"
3867                container="array">
3868           <array>
3869             <size>3</size>
3870           </array>
3871           <description>Position of the camera optical center.</description>
3872           <units>Meters</units>
3873           <details>
3874             The position of the camera device's lens optical center,
3875             as a three-dimensional vector `(x,y,z)`.
3876
3877             Prior to Android P, or when android.lens.poseReference is PRIMARY_CAMERA, this position
3878             is relative to the optical center of the largest camera device facing in the same
3879             direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
3880             coordinate axes}. Note that only the axis definitions are shared with the sensor
3881             coordinate system, but not the origin.
3882
3883             If this device is the largest or only camera device with a given facing, then this
3884             position will be `(0, 0, 0)`; a camera device with a lens optical center located 3 cm
3885             from the main sensor along the +X axis (to the right from the user's perspective) will
3886             report `(0.03, 0, 0)`.
3887
3888             To transform a pixel coordinates between two cameras facing the same direction, first
3889             the source camera android.lens.radialDistortion must be corrected for.  Then the source
3890             camera android.lens.intrinsicCalibration needs to be applied, followed by the
3891             android.lens.poseRotation of the source camera, the translation of the source camera
3892             relative to the destination camera, the android.lens.poseRotation of the destination
3893             camera, and finally the inverse of android.lens.intrinsicCalibration of the destination
3894             camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
3895             coordinates.
3896
3897             To compare this against a real image from the destination camera, the destination camera
3898             image then needs to be corrected for radial distortion before comparison or sampling.
3899
3900             When android.lens.poseReference is GYROSCOPE, then this position is relative to
3901             the center of the primary gyroscope on the device.
3902           </details>
3903           <tag id="DEPTH" />
3904         </entry>
3905       </static>
3906       <dynamic>
3907         <clone entry="android.lens.aperture" kind="controls">
3908           <tag id="V1" />
3909         </clone>
3910         <clone entry="android.lens.filterDensity" kind="controls">
3911           <tag id="V1" />
3912         </clone>
3913         <clone entry="android.lens.focalLength" kind="controls">
3914           <tag id="BC" />
3915         </clone>
3916         <clone entry="android.lens.focusDistance" kind="controls">
3917           <details>Should be zero for fixed-focus cameras</details>
3918           <tag id="BC" />
3919         </clone>
3920         <entry name="focusRange" type="float" visibility="public"
3921         type_notes="Range of scene distances that are in focus"
3922         container="array" typedef="pairFloatFloat" hwlevel="limited">
3923           <array>
3924             <size>2</size>
3925           </array>
3926           <description>The range of scene distances that are in
3927           sharp focus (depth of field).</description>
3928           <units>A pair of focus distances in diopters: (near,
3929           far); see android.lens.info.focusDistanceCalibration for details.</units>
3930           <range>&amp;gt;=0</range>
3931           <details>If variable focus not supported, can still report
3932           fixed depth of field range</details>
3933           <tag id="BC" />
3934         </entry>
3935         <clone entry="android.lens.opticalStabilizationMode"
3936         kind="controls">
3937           <tag id="V1" />
3938         </clone>
3939         <entry name="state" type="byte" visibility="public" enum="true" hwlevel="limited">
3940           <enum>
3941             <value>STATIONARY
3942               <notes>
3943               The lens parameters (android.lens.focalLength, android.lens.focusDistance,
3944               android.lens.filterDensity and android.lens.aperture) are not changing.
3945               </notes>
3946             </value>
3947             <value>MOVING
3948               <notes>
3949               One or several of the lens parameters
3950               (android.lens.focalLength, android.lens.focusDistance,
3951               android.lens.filterDensity or android.lens.aperture) is
3952               currently changing.
3953               </notes>
3954             </value>
3955           </enum>
3956           <description>Current lens status.</description>
3957           <details>
3958           For lens parameters android.lens.focalLength, android.lens.focusDistance,
3959           android.lens.filterDensity and android.lens.aperture, when changes are requested,
3960           they may take several frames to reach the requested values. This state indicates
3961           the current status of the lens parameters.
3962
3963           When the state is STATIONARY, the lens parameters are not changing. This could be
3964           either because the parameters are all fixed, or because the lens has had enough
3965           time to reach the most recently-requested values.
3966           If all these lens parameters are not changable for a camera device, as listed below:
3967
3968           * Fixed focus (`android.lens.info.minimumFocusDistance == 0`), which means
3969           android.lens.focusDistance parameter will always be 0.
3970           * Fixed focal length (android.lens.info.availableFocalLengths contains single value),
3971           which means the optical zoom is not supported.
3972           * No ND filter (android.lens.info.availableFilterDensities contains only 0).
3973           * Fixed aperture (android.lens.info.availableApertures contains single value).
3974
3975           Then this state will always be STATIONARY.
3976
3977           When the state is MOVING, it indicates that at least one of the lens parameters
3978           is changing.
3979           </details>
3980           <tag id="V1" />
3981         </entry>
3982         <clone entry="android.lens.poseRotation" kind="static">
3983         </clone>
3984         <clone entry="android.lens.poseTranslation" kind="static">
3985         </clone>
3986       </dynamic>
3987       <static>
3988         <entry name="intrinsicCalibration" type="float" visibility="public"
3989                container="array">
3990           <array>
3991             <size>5</size>
3992           </array>
3993           <description>
3994             The parameters for this camera device's intrinsic
3995             calibration.
3996           </description>
3997           <units>
3998             Pixels in the
3999             android.sensor.info.preCorrectionActiveArraySize
4000             coordinate system.
4001           </units>
4002           <details>
4003             The five calibration parameters that describe the
4004             transform from camera-centric 3D coordinates to sensor
4005             pixel coordinates:
4006
4007                 [f_x, f_y, c_x, c_y, s]
4008
4009             Where `f_x` and `f_y` are the horizontal and vertical
4010             focal lengths, `[c_x, c_y]` is the position of the optical
4011             axis, and `s` is a skew parameter for the sensor plane not
4012             being aligned with the lens plane.
4013
4014             These are typically used within a transformation matrix K:
4015
4016                 K = [ f_x,   s, c_x,
4017                        0, f_y, c_y,
4018                        0    0,   1 ]
4019
4020             which can then be combined with the camera pose rotation
4021             `R` and translation `t` (android.lens.poseRotation and
4022             android.lens.poseTranslation, respective) to calculate the
4023             complete transform from world coordinates to pixel
4024             coordinates:
4025
4026                 P = [ K 0   * [ R t
4027                      0 1 ]     0 1 ]
4028
4029             and with `p_w` being a point in the world coordinate system
4030             and `p_s` being a point in the camera active pixel array
4031             coordinate system, and with the mapping including the
4032             homogeneous division by z:
4033
4034                  p_h = (x_h, y_h, z_h) = P p_w
4035                 p_s = p_h / z_h
4036
4037             so `[x_s, y_s]` is the pixel coordinates of the world
4038             point, `z_s = 1`, and `w_s` is a measurement of disparity
4039             (depth) in pixel coordinates.
4040
4041             Note that the coordinate system for this transform is the
4042             android.sensor.info.preCorrectionActiveArraySize system,
4043             where `(0,0)` is the top-left of the
4044             preCorrectionActiveArraySize rectangle. Once the pose and
4045             intrinsic calibration transforms have been applied to a
4046             world point, then the android.lens.radialDistortion
4047             transform needs to be applied, and the result adjusted to
4048             be in the android.sensor.info.activeArraySize coordinate
4049             system (where `(0, 0)` is the top-left of the
4050             activeArraySize rectangle), to determine the final pixel
4051             coordinate of the world point for processed (non-RAW)
4052             output buffers.
4053           </details>
4054           <tag id="DEPTH" />
4055         </entry>
4056         <entry name="radialDistortion" type="float" visibility="public"
4057                container="array">
4058           <array>
4059             <size>6</size>
4060           </array>
4061           <description>
4062             The correction coefficients to correct for this camera device's
4063             radial and tangential lens distortion.
4064           </description>
4065           <units>
4066             Unitless coefficients.
4067           </units>
4068           <details>
4069             Four radial distortion coefficients `[kappa_0, kappa_1, kappa_2,
4070             kappa_3]` and two tangential distortion coefficients
4071             `[kappa_4, kappa_5]` that can be used to correct the
4072             lens's geometric distortion with the mapping equations:
4073
4074                  x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
4075                        kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
4076                  y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
4077                        kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
4078
4079             Here, `[x_c, y_c]` are the coordinates to sample in the
4080             input image that correspond to the pixel values in the
4081             corrected image at the coordinate `[x_i, y_i]`:
4082
4083                  correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
4084
4085             The pixel coordinates are defined in a normalized
4086             coordinate system related to the
4087             android.lens.intrinsicCalibration calibration fields.
4088             Both `[x_i, y_i]` and `[x_c, y_c]` have `(0,0)` at the
4089             lens optical center `[c_x, c_y]`. The maximum magnitudes
4090             of both x and y coordinates are normalized to be 1 at the
4091             edge further from the optical center, so the range
4092             for both dimensions is `-1 &lt;= x &lt;= 1`.
4093
4094             Finally, `r` represents the radial distance from the
4095             optical center, `r^2 = x_i^2 + y_i^2`, and its magnitude
4096             is therefore no larger than `|r| &lt;= sqrt(2)`.
4097
4098             The distortion model used is the Brown-Conrady model.
4099           </details>
4100           <tag id="DEPTH" />
4101         </entry>
4102       </static>
4103       <dynamic>
4104         <clone entry="android.lens.intrinsicCalibration" kind="static">
4105         </clone>
4106         <clone entry="android.lens.radialDistortion" kind="static">
4107         </clone>
4108       </dynamic>
4109       <static>
4110         <entry name="poseReference" type="byte" visibility="public" enum="true" hal_version="3.3">
4111           <enum>
4112             <value>PRIMARY_CAMERA
4113             <notes>The value of android.lens.poseTranslation is relative to the optical center of
4114             the largest camera device facing the same direction as this camera.
4115
4116             This is the default value for API levels before Android P.
4117             </notes>
4118             </value>
4119             <value>GYROSCOPE
4120             <notes>The value of android.lens.poseTranslation is relative to the position of the
4121             primary gyroscope of this Android device.
4122             </notes>
4123             </value>
4124           </enum>
4125           <description>
4126             The origin for android.lens.poseTranslation.
4127           </description>
4128           <details>
4129             Different calibration methods and use cases can produce better or worse results
4130             depending on the selected coordinate origin.
4131           </details>
4132         </entry>
4133       </static>
4134     </section>
4135     <section name="noiseReduction">
4136       <controls>
4137         <entry name="mode" type="byte" visibility="public" enum="true" hwlevel="full">
4138           <enum>
4139             <value>OFF
4140             <notes>No noise reduction is applied.</notes></value>
4141             <value>FAST
4142             <notes>Noise reduction is applied without reducing frame rate relative to sensor
4143             output. It may be the same as OFF if noise reduction will reduce frame rate
4144             relative to sensor.</notes></value>
4145             <value>HIGH_QUALITY
4146             <notes>High-quality noise reduction is applied, at the cost of possibly reduced frame
4147             rate relative to sensor output.</notes></value>
4148             <value optional="true">MINIMAL
4149             <notes>MINIMAL noise reduction is applied without reducing frame rate relative to
4150             sensor output. </notes></value>
4151             <value optional="true">ZERO_SHUTTER_LAG
4152
4153             <notes>Noise reduction is applied at different levels for different output streams,
4154             based on resolution. Streams at maximum recording resolution (see {@link
4155             android.hardware.camera2.CameraDevice#createCaptureSession|ACameraDevice_createCaptureSession})
4156             or below have noise reduction applied, while higher-resolution streams have MINIMAL (if
4157             supported) or no noise reduction applied (if MINIMAL is not supported.) The degree of
4158             noise reduction for low-resolution streams is tuned so that frame rate is not impacted,
4159             and the quality is equal to or better than FAST (since it is only applied to
4160             lower-resolution outputs, quality may improve from FAST).
4161
4162             This mode is intended to be used by applications operating in a zero-shutter-lag mode
4163             with YUV or PRIVATE reprocessing, where the application continuously captures
4164             high-resolution intermediate buffers into a circular buffer, from which a final image is
4165             produced via reprocessing when a user takes a picture.  For such a use case, the
4166             high-resolution buffers must not have noise reduction applied to maximize efficiency of
4167             preview and to avoid over-applying noise filtering when reprocessing, while
4168             low-resolution buffers (used for recording or preview, generally) need noise reduction
4169             applied for reasonable preview quality.
4170
4171             This mode is guaranteed to be supported by devices that support either the
4172             YUV_REPROCESSING or PRIVATE_REPROCESSING capabilities
4173             (android.request.availableCapabilities lists either of those capabilities) and it will
4174             be the default mode for CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.
4175             </notes></value>
4176           </enum>
4177           <description>Mode of operation for the noise reduction algorithm.</description>
4178           <range>android.noiseReduction.availableNoiseReductionModes</range>
4179           <details>The noise reduction algorithm attempts to improve image quality by removing
4180           excessive noise added by the capture process, especially in dark conditions.
4181
4182           OFF means no noise reduction will be applied by the camera device, for both raw and
4183           YUV domain.
4184
4185           MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
4186           demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
4187           This mode is optional, may not be support by all devices. The application should check
4188           android.noiseReduction.availableNoiseReductionModes before using it.
4189
4190           FAST/HIGH_QUALITY both mean camera device determined noise filtering
4191           will be applied. HIGH_QUALITY mode indicates that the camera device
4192           will use the highest-quality noise filtering algorithms,
4193           even if it slows down capture rate. FAST means the camera device will not
4194           slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if
4195           MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate.
4196           Every output stream will have a similar amount of enhancement applied.
4197
4198           ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
4199           buffer of high-resolution images during preview and reprocess image(s) from that buffer
4200           into a final capture when triggered by the user. In this mode, the camera device applies
4201           noise reduction to low-resolution streams (below maximum recording resolution) to maximize
4202           preview quality, but does not apply noise reduction to high-resolution streams, since
4203           those will be reprocessed later if necessary.
4204
4205           For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
4206           will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
4207           may adjust the noise reduction parameters for best image quality based on the
4208           android.reprocess.effectiveExposureFactor if it is set.
4209           </details>
4210           <hal_details>
4211           For YUV_REPROCESSING The HAL can use android.reprocess.effectiveExposureFactor to
4212           adjust the internal noise reduction parameters appropriately to get the best quality
4213           images.
4214           </hal_details>
4215           <tag id="V1" />
4216           <tag id="REPROC" />
4217         </entry>
4218         <entry name="strength" type="byte">
4219           <description>Control the amount of noise reduction
4220           applied to the images</description>
4221           <units>1-10; 10 is max noise reduction</units>
4222           <range>1 - 10</range>
4223           <tag id="FUTURE" />
4224         </entry>
4225       </controls>
4226       <static>
4227         <entry name="availableNoiseReductionModes" type="byte" visibility="public"
4228         type_notes="list of enums" container="array" typedef="enumList" hwlevel="limited">
4229           <array>
4230             <size>n</size>
4231           </array>
4232           <description>
4233           List of noise reduction modes for android.noiseReduction.mode that are supported
4234           by this camera device.
4235           </description>
4236           <range>Any value listed in android.noiseReduction.mode</range>
4237           <details>
4238           Full-capability camera devices will always support OFF and FAST.
4239
4240           Camera devices that support YUV_REPROCESSING or PRIVATE_REPROCESSING will support
4241           ZERO_SHUTTER_LAG.
4242
4243           Legacy-capability camera devices will only support FAST mode.
4244           </details>
4245           <hal_details>
4246           HAL must support both FAST and HIGH_QUALITY if noise reduction control is available
4247           on the camera device, but the underlying implementation can be the same for both modes.
4248           That is, if the highest quality implementation on the camera device does not slow down
4249           capture rate, then FAST and HIGH_QUALITY will generate the same output.
4250           </hal_details>
4251           <tag id="V1" />
4252           <tag id="REPROC" />
4253         </entry>
4254       </static>
4255       <dynamic>
4256         <clone entry="android.noiseReduction.mode" kind="controls">
4257           <tag id="V1" />
4258           <tag id="REPROC" />
4259         </clone>
4260       </dynamic>
4261     </section>
4262     <section name="quirks">
4263       <static>
4264         <entry name="meteringCropRegion" type="byte" visibility="system" deprecated="true" optional="true">
4265           <description>If set to 1, the camera service does not
4266           scale 'normalized' coordinates with respect to the crop
4267           region. This applies to metering input (a{e,f,wb}Region
4268           and output (face rectangles).</description>
4269           <details>Normalized coordinates refer to those in the
4270           (-1000,1000) range mentioned in the
4271           android.hardware.Camera API.
4272
4273           HAL implementations should instead always use and emit
4274           sensor array-relative coordinates for all region data. Does
4275           not need to be listed in static metadata. Support will be
4276           removed in future versions of camera service.</details>
4277         </entry>
4278         <entry name="triggerAfWithAuto" type="byte" visibility="system" deprecated="true" optional="true">
4279           <description>If set to 1, then the camera service always
4280           switches to FOCUS_MODE_AUTO before issuing a AF
4281           trigger.</description>
4282           <details>HAL implementations should implement AF trigger
4283           modes for AUTO, MACRO, CONTINUOUS_FOCUS, and
4284           CONTINUOUS_PICTURE modes instead of using this flag. Does
4285           not need to be listed in static metadata. Support will be
4286           removed in future versions of camera service</details>
4287         </entry>
4288         <entry name="useZslFormat" type="byte" visibility="system" deprecated="true" optional="true">
4289           <description>If set to 1, the camera service uses
4290           CAMERA2_PIXEL_FORMAT_ZSL instead of
4291           HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED for the zero
4292           shutter lag stream</description>
4293           <details>HAL implementations should use gralloc usage flags
4294           to determine that a stream will be used for
4295           zero-shutter-lag, instead of relying on an explicit
4296           format setting. Does not need to be listed in static
4297           metadata. Support will be removed in future versions of
4298           camera service.</details>
4299         </entry>
4300         <entry name="usePartialResult" type="byte" visibility="hidden" deprecated="true" optional="true">
4301           <description>
4302           If set to 1, the HAL will always split result
4303           metadata for a single capture into multiple buffers,
4304           returned using multiple process_capture_result calls.
4305           </description>
4306           <details>
4307           Does not need to be listed in static
4308           metadata. Support for partial results will be reworked in
4309           future versions of camera service. This quirk will stop
4310           working at that point; DO NOT USE without careful
4311           consideration of future support.
4312           </details>
4313           <hal_details>
4314           Refer to `camera3_capture_result::partial_result`
4315           for information on how to implement partial results.
4316           </hal_details>
4317         </entry>
4318       </static>
4319       <dynamic>
4320         <entry name="partialResult" type="byte" visibility="hidden" deprecated="true" optional="true" enum="true" typedef="boolean">
4321           <enum>
4322             <value>FINAL
4323             <notes>The last or only metadata result buffer
4324             for this capture.</notes>
4325             </value>
4326             <value>PARTIAL
4327             <notes>A partial buffer of result metadata for this
4328             capture. More result buffers for this capture will be sent
4329             by the camera device, the last of which will be marked
4330             FINAL.</notes>
4331             </value>
4332           </enum>
4333           <description>
4334           Whether a result given to the framework is the
4335           final one for the capture, or only a partial that contains a
4336           subset of the full set of dynamic metadata
4337           values.</description>
4338           <range>Optional. Default value is FINAL.</range>
4339           <details>
4340           The entries in the result metadata buffers for a
4341           single capture may not overlap, except for this entry. The
4342           FINAL buffers must retain FIFO ordering relative to the
4343           requests that generate them, so the FINAL buffer for frame 3 must
4344           always be sent to the framework after the FINAL buffer for frame 2, and
4345           before the FINAL buffer for frame 4. PARTIAL buffers may be returned
4346           in any order relative to other frames, but all PARTIAL buffers for a given
4347           capture must arrive before the FINAL buffer for that capture. This entry may
4348           only be used by the camera device if quirks.usePartialResult is set to 1.
4349           </details>
4350           <hal_details>
4351           Refer to `camera3_capture_result::partial_result`
4352           for information on how to implement partial results.
4353           </hal_details>
4354         </entry>
4355       </dynamic>
4356     </section>
4357     <section name="request">
4358       <controls>
4359         <entry name="frameCount" type="int32" visibility="system" deprecated="true">
4360           <description>A frame counter set by the framework. Must
4361           be maintained unchanged in output frame. This value monotonically
4362           increases with every new result (that is, each new result has a unique
4363           frameCount value).
4364           </description>
4365           <units>incrementing integer</units>
4366           <range>Any int.</range>
4367         </entry>
4368         <entry name="id" type="int32" visibility="hidden">
4369           <description>An application-specified ID for the current
4370           request. Must be maintained unchanged in output
4371           frame</description>
4372           <units>arbitrary integer assigned by application</units>
4373           <range>Any int</range>
4374           <tag id="V1" />
4375         </entry>
4376         <entry name="inputStreams" type="int32" visibility="system" deprecated="true"
4377                container="array">
4378           <array>
4379             <size>n</size>
4380           </array>
4381           <description>List which camera reprocess stream is used
4382           for the source of reprocessing data.</description>
4383           <units>List of camera reprocess stream IDs</units>
4384           <range>
4385           Typically, only one entry allowed, must be a valid reprocess stream ID.
4386           </range>
4387           <details>Only meaningful when android.request.type ==
4388           REPROCESS. Ignored otherwise</details>
4389           <tag id="HAL2" />
4390         </entry>
4391         <entry name="metadataMode" type="byte" visibility="system"
4392                enum="true">
4393           <enum>
4394             <value>NONE
4395             <notes>No metadata should be produced on output, except
4396             for application-bound buffer data. If no
4397             application-bound streams exist, no frame should be
4398             placed in the output frame queue. If such streams
4399             exist, a frame should be placed on the output queue
4400             with null metadata but with the necessary output buffer
4401             information. Timestamp information should still be
4402             included with any output stream buffers</notes></value>
4403             <value>FULL
4404             <notes>All metadata should be produced. Statistics will
4405             only be produced if they are separately
4406             enabled</notes></value>
4407           </enum>
4408           <description>How much metadata to produce on
4409           output</description>
4410           <tag id="FUTURE" />
4411         </entry>
4412         <entry name="outputStreams" type="int32" visibility="system" deprecated="true"
4413                container="array">
4414           <array>
4415             <size>n</size>
4416           </array>
4417           <description>Lists which camera output streams image data
4418           from this capture must be sent to</description>
4419           <units>List of camera stream IDs</units>
4420           <range>List must only include streams that have been
4421           created</range>
4422           <details>If no output streams are listed, then the image
4423           data should simply be discarded. The image data must
4424           still be captured for metadata and statistics production,
4425           and the lens and flash must operate as requested.</details>
4426           <tag id="HAL2" />
4427         </entry>
4428         <entry name="type" type="byte" visibility="system" deprecated="true" enum="true">
4429           <enum>
4430             <value>CAPTURE
4431             <notes>Capture a new image from the imaging hardware,
4432             and process it according to the
4433             settings</notes></value>
4434             <value>REPROCESS
4435             <notes>Process previously captured data; the
4436             android.request.inputStreams parameter determines the
4437             source reprocessing stream. TODO: Mark dynamic metadata
4438             needed for reprocessing with [RP]</notes></value>
4439           </enum>
4440           <description>The type of the request; either CAPTURE or
4441           REPROCESS. For legacy HAL3, this tag is redundant.
4442           </description>
4443           <tag id="HAL2" />
4444         </entry>
4445       </controls>
4446       <static>
4447         <entry name="maxNumOutputStreams" type="int32" visibility="ndk_public"
4448                container="array" hwlevel="legacy">
4449           <array>
4450             <size>3</size>
4451           </array>
4452           <description>The maximum numbers of different types of output streams
4453           that can be configured and used simultaneously by a camera device.
4454           </description>
4455           <range>
4456           For processed (and stalling) format streams, &amp;gt;= 1.
4457
4458           For Raw format (either stalling or non-stalling) streams, &amp;gt;= 0.
4459
4460           For processed (but not stalling) format streams, &amp;gt;= 3
4461           for FULL mode devices (`android.info.supportedHardwareLevel == FULL`);
4462           &amp;gt;= 2 for LIMITED mode devices (`android.info.supportedHardwareLevel == LIMITED`).
4463           </range>
4464           <details>
4465           This is a 3 element tuple that contains the max number of output simultaneous
4466           streams for raw sensor, processed (but not stalling), and processed (and stalling)
4467           formats respectively. For example, assuming that JPEG is typically a processed and
4468           stalling stream, if max raw sensor format output stream number is 1, max YUV streams
4469           number is 3, and max JPEG stream number is 2, then this tuple should be `(1, 3, 2)`.
4470
4471           This lists the upper bound of the number of output streams supported by
4472           the camera device. Using more streams simultaneously may require more hardware and
4473           CPU resources that will consume more power. The image format for an output stream can
4474           be any supported format provided by android.scaler.availableStreamConfigurations.
4475           The formats defined in android.scaler.availableStreamConfigurations can be catergorized
4476           into the 3 stream types as below:
4477
4478           * Processed (but stalling): any non-RAW format with a stallDurations &amp;gt; 0.
4479             Typically {@link android.graphics.ImageFormat#JPEG|AIMAGE_FORMAT_JPEG JPEG format}.
4480           * Raw formats: {@link android.graphics.ImageFormat#RAW_SENSOR|AIMAGE_FORMAT_RAW16
4481             RAW_SENSOR}, {@link android.graphics.ImageFormat#RAW10|AIMAGE_FORMAT_RAW10 RAW10}, or
4482             {@link android.graphics.ImageFormat#RAW12|AIMAGE_FORMAT_RAW12 RAW12}.
4483           * Processed (but not-stalling): any non-RAW format without a stall duration.  Typically
4484             {@link android.graphics.ImageFormat#YUV_420_888|AIMAGE_FORMAT_YUV_420_888 YUV_420_888},
4485             {@link android.graphics.ImageFormat#NV21 NV21}, or {@link
4486             android.graphics.ImageFormat#YV12 YV12}.
4487           </details>
4488           <tag id="BC" />
4489         </entry>
4490         <entry name="maxNumOutputRaw" type="int32" visibility="java_public" synthetic="true"
4491                hwlevel="legacy">
4492           <description>The maximum numbers of different types of output streams
4493           that can be configured and used simultaneously by a camera device
4494           for any `RAW` formats.
4495           </description>
4496           <range>
4497           &amp;gt;= 0
4498           </range>
4499           <details>
4500           This value contains the max number of output simultaneous
4501           streams from the raw sensor.
4502
4503           This lists the upper bound of the number of output streams supported by
4504           the camera device. Using more streams simultaneously may require more hardware and
4505           CPU resources that will consume more power. The image format for this kind of an output stream can
4506           be any `RAW` and supported format provided by android.scaler.streamConfigurationMap.
4507
4508           In particular, a `RAW` format is typically one of:
4509
4510           * {@link android.graphics.ImageFormat#RAW_SENSOR|AIMAGE_FORMAT_RAW16 RAW_SENSOR}
4511           * {@link android.graphics.ImageFormat#RAW10|AIMAGE_FORMAT_RAW10 RAW10}
4512           * {@link android.graphics.ImageFormat#RAW12|AIMAGE_FORMAT_RAW12 RAW12}
4513
4514           LEGACY mode devices (android.info.supportedHardwareLevel `==` LEGACY)
4515           never support raw streams.
4516           </details>
4517         </entry>
4518         <entry name="maxNumOutputProc" type="int32" visibility="java_public" synthetic="true"
4519                hwlevel="legacy">
4520           <description>The maximum numbers of different types of output streams
4521           that can be configured and used simultaneously by a camera device
4522           for any processed (but not-stalling) formats.
4523           </description>
4524           <range>
4525           &amp;gt;= 3
4526           for FULL mode devices (`android.info.supportedHardwareLevel == FULL`);
4527           &amp;gt;= 2 for LIMITED mode devices (`android.info.supportedHardwareLevel == LIMITED`).
4528           </range>
4529           <details>
4530           This value contains the max number of output simultaneous
4531           streams for any processed (but not-stalling) formats.
4532
4533           This lists the upper bound of the number of output streams supported by
4534           the camera device. Using more streams simultaneously may require more hardware and
4535           CPU resources that will consume more power. The image format for this kind of an output stream can
4536           be any non-`RAW` and supported format provided by android.scaler.streamConfigurationMap.
4537
4538           Processed (but not-stalling) is defined as any non-RAW format without a stall duration.
4539           Typically:
4540
4541           * {@link android.graphics.ImageFormat#YUV_420_888|AIMAGE_FORMAT_YUV_420_888 YUV_420_888}
4542           * {@link android.graphics.ImageFormat#NV21 NV21}
4543           * {@link android.graphics.ImageFormat#YV12 YV12}
4544           * Implementation-defined formats, i.e. {@link
4545             android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor(Class)}
4546
4547           For full guarantees, query {@link
4548           android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration} with a
4549           processed format -- it will return 0 for a non-stalling stream.
4550
4551           LEGACY devices will support at least 2 processing/non-stalling streams.
4552           </details>
4553         </entry>
4554         <entry name="maxNumOutputProcStalling" type="int32" visibility="java_public" synthetic="true"
4555                hwlevel="legacy">
4556           <description>The maximum numbers of different types of output streams
4557           that can be configured and used simultaneously by a camera device
4558           for any processed (and stalling) formats.
4559           </description>
4560           <range>
4561           &amp;gt;= 1
4562           </range>
4563           <details>
4564           This value contains the max number of output simultaneous
4565           streams for any processed (but not-stalling) formats.
4566
4567           This lists the upper bound of the number of output streams supported by
4568           the camera device. Using more streams simultaneously may require more hardware and
4569           CPU resources that will consume more power. The image format for this kind of an output stream can
4570           be any non-`RAW` and supported format provided by android.scaler.streamConfigurationMap.
4571
4572           A processed and stalling format is defined as any non-RAW format with a stallDurations
4573           &amp;gt; 0.  Typically only the {@link
4574           android.graphics.ImageFormat#JPEG|AIMAGE_FORMAT_JPEG JPEG format} is a stalling format.
4575
4576           For full guarantees, query {@link
4577           android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration} with a
4578           processed format -- it will return a non-0 value for a stalling stream.
4579
4580           LEGACY devices will support up to 1 processing/stalling stream.
4581           </details>
4582         </entry>
4583         <entry name="maxNumReprocessStreams" type="int32" visibility="system"
4584         deprecated="true" container="array">
4585           <array>
4586             <size>1</size>
4587           </array>
4588           <description>How many reprocessing streams of any type
4589           can be allocated at the same time.</description>
4590           <range>&amp;gt;= 0</range>
4591           <details>
4592           Only used by HAL2.x.
4593
4594           When set to 0, it means no reprocess stream is supported.
4595           </details>
4596           <tag id="HAL2" />
4597         </entry>
4598         <entry name="maxNumInputStreams" type="int32" visibility="java_public" hwlevel="full">
4599           <description>
4600           The maximum numbers of any type of input streams
4601           that can be configured and used simultaneously by a camera device.
4602           </description>
4603           <range>
4604           0 or 1.
4605           </range>
4606           <details>When set to 0, it means no input stream is supported.
4607
4608           The image format for a input stream can be any supported format returned by {@link
4609           android.hardware.camera2.params.StreamConfigurationMap#getInputFormats}. When using an
4610           input stream, there must be at least one output stream configured to to receive the
4611           reprocessed images.
4612
4613           When an input stream and some output streams are used in a reprocessing request,
4614           only the input buffer will be used to produce these output stream buffers, and a
4615           new sensor image will not be captured.
4616
4617           For example, for Zero Shutter Lag (ZSL) still capture use case, the input
4618           stream image format will be PRIVATE, the associated output stream image format
4619           should be JPEG.
4620           </details>
4621           <hal_details>
4622           For the reprocessing flow and controls, see
4623           hardware/libhardware/include/hardware/camera3.h Section 10 for more details.
4624           </hal_details>
4625           <tag id="REPROC" />
4626         </entry>
4627       </static>
4628       <dynamic>
4629         <entry name="frameCount" type="int32" visibility="hidden" deprecated="true">
4630           <description>A frame counter set by the framework. This value monotonically
4631           increases with every new result (that is, each new result has a unique
4632           frameCount value).</description>
4633           <units>count of frames</units>
4634           <range>&amp;gt; 0</range>
4635           <details>Reset on release()</details>
4636         </entry>
4637         <clone entry="android.request.id" kind="controls"></clone>
4638         <clone entry="android.request.metadataMode"
4639         kind="controls"></clone>
4640         <clone entry="android.request.outputStreams"
4641         kind="controls"></clone>
4642         <entry name="pipelineDepth" type="byte" visibility="public" hwlevel="legacy">
4643           <description>Specifies the number of pipeline stages the frame went
4644           through from when it was exposed to when the final completed result
4645           was available to the framework.</description>
4646           <range>&amp;lt;= android.request.pipelineMaxDepth</range>
4647           <details>Depending on what settings are used in the request, and
4648           what streams are configured, the data may undergo less processing,
4649           and some pipeline stages skipped.
4650
4651           See android.request.pipelineMaxDepth for more details.
4652           </details>
4653           <hal_details>
4654           This value must always represent the accurate count of how many
4655           pipeline stages were actually used.
4656           </hal_details>
4657         </entry>
4658       </dynamic>
4659       <static>
4660         <entry name="pipelineMaxDepth" type="byte" visibility="public" hwlevel="legacy">
4661           <description>Specifies the number of maximum pipeline stages a frame
4662           has to go through from when it's exposed to when it's available
4663           to the framework.</description>
4664           <details>A typical minimum value for this is 2 (one stage to expose,
4665           one stage to readout) from the sensor. The ISP then usually adds
4666           its own stages to do custom HW processing. Further stages may be
4667           added by SW processing.
4668
4669           Depending on what settings are used (e.g. YUV, JPEG) and what
4670           processing is enabled (e.g. face detection), the actual pipeline
4671           depth (specified by android.request.pipelineDepth) may be less than
4672           the max pipeline depth.
4673
4674           A pipeline depth of X stages is equivalent to a pipeline latency of
4675           X frame intervals.
4676
4677           This value will normally be 8 or less, however, for high speed capture session,
4678           the max pipeline depth will be up to 8 x size of high speed capture request list.
4679           </details>
4680           <hal_details>
4681           This value should be 4 or less, expect for the high speed recording session, where the
4682           max batch sizes may be larger than 1.
4683           </hal_details>
4684         </entry>
4685         <entry name="partialResultCount" type="int32" visibility="public" optional="true">
4686           <description>Defines how many sub-components
4687           a result will be composed of.
4688           </description>
4689           <range>&amp;gt;= 1</range>
4690           <details>In order to combat the pipeline latency, partial results
4691           may be delivered to the application layer from the camera device as
4692           soon as they are available.
4693
4694           Optional; defaults to 1. A value of 1 means that partial
4695           results are not supported, and only the final TotalCaptureResult will
4696           be produced by the camera device.
4697
4698           A typical use case for this might be: after requesting an
4699           auto-focus (AF) lock the new AF state might be available 50%
4700           of the way through the pipeline.  The camera device could
4701           then immediately dispatch this state via a partial result to
4702           the application, and the rest of the metadata via later
4703           partial results.
4704           </details>
4705         </entry>
4706         <entry name="availableCapabilities" type="byte" visibility="public"
4707           enum="true" container="array" hwlevel="legacy">
4708           <array>
4709             <size>n</size>
4710           </array>
4711           <enum>
4712             <value>BACKWARD_COMPATIBLE
4713               <notes>The minimal set of capabilities that every camera
4714                 device (regardless of android.info.supportedHardwareLevel)
4715                 supports.
4716
4717                 This capability is listed by all normal devices, and
4718                 indicates that the camera device has a feature set
4719                 that's comparable to the baseline requirements for the
4720                 older android.hardware.Camera API.
4721
4722                 Devices with the DEPTH_OUTPUT capability might not list this
4723                 capability, indicating that they support only depth measurement,
4724                 not standard color output.
4725               </notes>
4726             </value>
4727             <value optional="true">MANUAL_SENSOR
4728               <notes>
4729               The camera device can be manually controlled (3A algorithms such
4730               as auto-exposure, and auto-focus can be bypassed).
4731               The camera device supports basic manual control of the sensor image
4732               acquisition related stages. This means the following controls are
4733               guaranteed to be supported:
4734
4735               * Manual frame duration control
4736                   * android.sensor.frameDuration
4737                   * android.sensor.info.maxFrameDuration
4738               * Manual exposure control
4739                   * android.sensor.exposureTime
4740                   * android.sensor.info.exposureTimeRange
4741               * Manual sensitivity control
4742                   * android.sensor.sensitivity
4743                   * android.sensor.info.sensitivityRange
4744               * Manual lens control (if the lens is adjustable)
4745                   * android.lens.*
4746               * Manual flash control (if a flash unit is present)
4747                   * android.flash.*
4748               * Manual black level locking
4749                   * android.blackLevel.lock
4750               * Auto exposure lock
4751                   * android.control.aeLock
4752
4753               If any of the above 3A algorithms are enabled, then the camera
4754               device will accurately report the values applied by 3A in the
4755               result.
4756
4757               A given camera device may also support additional manual sensor controls,
4758               but this capability only covers the above list of controls.
4759
4760               If this is supported, android.scaler.streamConfigurationMap will
4761               additionally return a min frame duration that is greater than
4762               zero for each supported size-format combination.
4763               </notes>
4764             </value>
4765             <value optional="true">MANUAL_POST_PROCESSING
4766               <notes>
4767               The camera device post-processing stages can be manually controlled.
4768               The camera device supports basic manual control of the image post-processing
4769               stages. This means the following controls are guaranteed to be supported:
4770
4771               * Manual tonemap control
4772                   * android.tonemap.curve
4773                   * android.tonemap.mode
4774                   * android.tonemap.maxCurvePoints
4775                   * android.tonemap.gamma
4776                   * android.tonemap.presetCurve
4777
4778               * Manual white balance control
4779                   * android.colorCorrection.transform
4780                   * android.colorCorrection.gains
4781               * Manual lens shading map control
4782                     * android.shading.mode
4783                     * android.statistics.lensShadingMapMode
4784                     * android.statistics.lensShadingMap
4785                     * android.lens.info.shadingMapSize
4786               * Manual aberration correction control (if aberration correction is supported)
4787                     * android.colorCorrection.aberrationMode
4788                     * android.colorCorrection.availableAberrationModes
4789               * Auto white balance lock
4790                     * android.control.awbLock
4791
4792               If auto white balance is enabled, then the camera device
4793               will accurately report the values applied by AWB in the result.
4794
4795               A given camera device may also support additional post-processing
4796               controls, but this capability only covers the above list of controls.
4797               </notes>
4798             </value>
4799             <value optional="true">RAW
4800               <notes>
4801               The camera device supports outputting RAW buffers and
4802               metadata for interpreting them.
4803
4804               Devices supporting the RAW capability allow both for
4805               saving DNG files, and for direct application processing of
4806               raw sensor images.
4807
4808               * RAW_SENSOR is supported as an output format.
4809               * The maximum available resolution for RAW_SENSOR streams
4810                 will match either the value in
4811                 android.sensor.info.pixelArraySize or
4812                 android.sensor.info.preCorrectionActiveArraySize.
4813               * All DNG-related optional metadata entries are provided
4814                 by the camera device.
4815               </notes>
4816             </value>
4817             <value optional="true" ndk_hidden="true">PRIVATE_REPROCESSING
4818               <notes>
4819               The camera device supports the Zero Shutter Lag reprocessing use case.
4820
4821               * One input stream is supported, that is, `android.request.maxNumInputStreams == 1`.
4822               * {@link android.graphics.ImageFormat#PRIVATE} is supported as an output/input format,
4823                 that is, {@link android.graphics.ImageFormat#PRIVATE} is included in the lists of
4824                 formats returned by {@link
4825                 android.hardware.camera2.params.StreamConfigurationMap#getInputFormats} and {@link
4826                 android.hardware.camera2.params.StreamConfigurationMap#getOutputFormats}.
4827               * {@link android.hardware.camera2.params.StreamConfigurationMap#getValidOutputFormatsForInput}
4828                 returns non empty int[] for each supported input format returned by {@link
4829                 android.hardware.camera2.params.StreamConfigurationMap#getInputFormats}.
4830               * Each size returned by {@link
4831                 android.hardware.camera2.params.StreamConfigurationMap#getInputSizes
4832                 getInputSizes(ImageFormat.PRIVATE)} is also included in {@link
4833                 android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes
4834                 getOutputSizes(ImageFormat.PRIVATE)}
4835               * Using {@link android.graphics.ImageFormat#PRIVATE} does not cause a frame rate drop
4836                 relative to the sensor's maximum capture rate (at that resolution).
4837               * {@link android.graphics.ImageFormat#PRIVATE} will be reprocessable into both
4838                 {@link android.graphics.ImageFormat#YUV_420_888} and
4839                 {@link android.graphics.ImageFormat#JPEG} formats.
4840               * The maximum available resolution for PRIVATE streams
4841                 (both input/output) will match the maximum available
4842                 resolution of JPEG streams.
4843               * Static metadata android.reprocess.maxCaptureStall.
4844               * Only below controls are effective for reprocessing requests and
4845                 will be present in capture results, other controls in reprocess
4846                 requests will be ignored by the camera device.
4847                     * android.jpeg.*
4848                     * android.noiseReduction.mode
4849                     * android.edge.mode
4850               * android.noiseReduction.availableNoiseReductionModes and
4851                 android.edge.availableEdgeModes will both list ZERO_SHUTTER_LAG as a supported mode.
4852               </notes>
4853             </value>
4854             <value optional="true">READ_SENSOR_SETTINGS
4855               <notes>
4856               The camera device supports accurately reporting the sensor settings for many of
4857               the sensor controls while the built-in 3A algorithm is running.  This allows
4858               reporting of sensor settings even when these settings cannot be manually changed.
4859
4860               The values reported for the following controls are guaranteed to be available
4861               in the CaptureResult, including when 3A is enabled:
4862
4863               * Exposure control
4864                   * android.sensor.exposureTime
4865               * Sensitivity control
4866                   * android.sensor.sensitivity
4867               * Lens controls (if the lens is adjustable)
4868                   * android.lens.focusDistance
4869                   * android.lens.aperture
4870
4871               This capability is a subset of the MANUAL_SENSOR control capability, and will
4872               always be included if the MANUAL_SENSOR capability is available.
4873               </notes>
4874             </value>
4875             <value optional="true">BURST_CAPTURE
4876               <notes>
4877               The camera device supports capturing high-resolution images at &gt;= 20 frames per
4878               second, in at least the uncompressed YUV format, when post-processing settings are set
4879               to FAST. Additionally, maximum-resolution images can be captured at &gt;= 10 frames
4880               per second.  Here, 'high resolution' means at least 8 megapixels, or the maximum
4881               resolution of the device, whichever is smaller.
4882               </notes>
4883               <sdk_notes>
4884               More specifically, this means that a size matching the camera device's active array
4885               size is listed as a supported size for the {@link
4886               android.graphics.ImageFormat#YUV_420_888} format in either {@link
4887               android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes} or {@link
4888               android.hardware.camera2.params.StreamConfigurationMap#getHighResolutionOutputSizes},
4889               with a minimum frame duration for that format and size of either &lt;= 1/20 s, or
4890               &lt;= 1/10 s, respectively; and the android.control.aeAvailableTargetFpsRanges entry
4891               lists at least one FPS range where the minimum FPS is &gt;= 1 / minimumFrameDuration
4892               for the maximum-size YUV_420_888 format.  If that maximum size is listed in {@link
4893               android.hardware.camera2.params.StreamConfigurationMap#getHighResolutionOutputSizes},
4894               then the list of resolutions for YUV_420_888 from {@link
4895               android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes} contains at
4896               least one resolution &gt;= 8 megapixels, with a minimum frame duration of &lt;= 1/20
4897               s.
4898
4899               If the device supports the {@link
4900               android.graphics.ImageFormat#RAW10|AIMAGE_FORMAT_RAW10}, {@link
4901               android.graphics.ImageFormat#RAW12|AIMAGE_FORMAT_RAW12}, then those can also be
4902               captured at the same rate as the maximum-size YUV_420_888 resolution is.
4903
4904               If the device supports the PRIVATE_REPROCESSING capability, then the same guarantees
4905               as for the YUV_420_888 format also apply to the {@link
4906               android.graphics.ImageFormat#PRIVATE} format.
4907
4908               In addition, the android.sync.maxLatency field is guaranted to have a value between 0
4909               and 4, inclusive. android.control.aeLockAvailable and android.control.awbLockAvailable
4910               are also guaranteed to be `true` so burst capture with these two locks ON yields
4911               consistent image output.
4912               </sdk_notes>
4913               <ndk_notes>
4914               More specifically, this means that at least one output {@link
4915               android.graphics.ImageFormat#YUV_420_888|AIMAGE_FORMAT_YUV_420_888} size listed in
4916               {@link
4917               android.hardware.camera2.params.StreamConfigurationMap|ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS}
4918               is larger or equal to the 'high resolution' defined above, and can be captured at at
4919               least 20 fps.  For the largest {@link
4920               android.graphics.ImageFormat#YUV_420_888|AIMAGE_FORMAT_YUV_420_888} size listed in
4921               {@link
4922               android.hardware.camera2.params.StreamConfigurationMap|ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS},
4923               camera device can capture this size for at least 10 frames per second.  Also the
4924               android.control.aeAvailableTargetFpsRanges entry lists at least one FPS range where
4925               the minimum FPS is &gt;= 1 / minimumFrameDuration for the largest YUV_420_888 size.
4926
4927               If the device supports the {@link
4928               android.graphics.ImageFormat#RAW10|AIMAGE_FORMAT_RAW10}, {@link
4929               android.graphics.ImageFormat#RAW12|AIMAGE_FORMAT_RAW12}, then those can also be
4930               captured at the same rate as the maximum-size YUV_420_888 resolution is.
4931
4932               In addition, the android.sync.maxLatency field is guaranted to have a value between 0
4933               and 4, inclusive. android.control.aeLockAvailable and android.control.awbLockAvailable
4934               are also guaranteed to be `true` so burst capture with these two locks ON yields
4935               consistent image output.
4936               </ndk_notes>
4937             </value>
4938             <value optional="true" ndk_hidden="true">YUV_REPROCESSING
4939               <notes>
4940               The camera device supports the YUV_420_888 reprocessing use case, similar as
4941               PRIVATE_REPROCESSING, This capability requires the camera device to support the
4942               following:
4943
4944               * One input stream is supported, that is, `android.request.maxNumInputStreams == 1`.
4945               * {@link android.graphics.ImageFormat#YUV_420_888} is supported as an output/input
4946                 format, that is, YUV_420_888 is included in the lists of formats returned by {@link
4947                 android.hardware.camera2.params.StreamConfigurationMap#getInputFormats} and {@link
4948                 android.hardware.camera2.params.StreamConfigurationMap#getOutputFormats}.
4949               * {@link
4950                 android.hardware.camera2.params.StreamConfigurationMap#getValidOutputFormatsForInput}
4951                 returns non-empty int[] for each supported input format returned by {@link
4952                 android.hardware.camera2.params.StreamConfigurationMap#getInputFormats}.
4953               * Each size returned by {@link
4954                 android.hardware.camera2.params.StreamConfigurationMap#getInputSizes
4955                 getInputSizes(YUV_420_888)} is also included in {@link
4956                 android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes
4957                 getOutputSizes(YUV_420_888)}
4958               * Using {@link android.graphics.ImageFormat#YUV_420_888} does not cause a frame rate
4959                 drop relative to the sensor's maximum capture rate (at that resolution).
4960               * {@link android.graphics.ImageFormat#YUV_420_888} will be reprocessable into both
4961                 {@link android.graphics.ImageFormat#YUV_420_888} and {@link
4962                 android.graphics.ImageFormat#JPEG} formats.
4963               * The maximum available resolution for {@link
4964                 android.graphics.ImageFormat#YUV_420_888} streams (both input/output) will match the
4965                 maximum available resolution of {@link android.graphics.ImageFormat#JPEG} streams.
4966               * Static metadata android.reprocess.maxCaptureStall.
4967               * Only the below controls are effective for reprocessing requests and will be present
4968                 in capture results. The reprocess requests are from the original capture results
4969                 that are associated with the intermediate {@link
4970                 android.graphics.ImageFormat#YUV_420_888} output buffers.  All other controls in the
4971                 reprocess requests will be ignored by the camera device.
4972                     * android.jpeg.*
4973                     * android.noiseReduction.mode
4974                     * android.edge.mode
4975                     * android.reprocess.effectiveExposureFactor
4976               * android.noiseReduction.availableNoiseReductionModes and
4977                 android.edge.availableEdgeModes will both list ZERO_SHUTTER_LAG as a supported mode.
4978               </notes>
4979             </value>
4980             <value optional="true">DEPTH_OUTPUT
4981               <notes>
4982               The camera device can produce depth measurements from its field of view.
4983
4984               This capability requires the camera device to support the following:
4985
4986               * {@link android.graphics.ImageFormat#DEPTH16|AIMAGE_FORMAT_DEPTH16} is supported as
4987                 an output format.
4988               * {@link
4989                 android.graphics.ImageFormat#DEPTH_POINT_CLOUD|AIMAGE_FORMAT_DEPTH_POINT_CLOUD} is
4990                 optionally supported as an output format.
4991               * This camera device, and all camera devices with the same android.lens.facing, will
4992                 list the following calibration metadata entries in both {@link
4993                 android.hardware.camera2.CameraCharacteristics|ACameraManager_getCameraCharacteristics}
4994                 and {@link
4995                 android.hardware.camera2.CaptureResult|ACameraCaptureSession_captureCallback_result}:
4996                   - android.lens.poseTranslation
4997                   - android.lens.poseRotation
4998                   - android.lens.intrinsicCalibration
4999                   - android.lens.radialDistortion
5000               * The android.depth.depthIsExclusive entry is listed by this device.
5001               * As of Android P, the android.lens.poseReference entry is listed by this device.
5002               * A LIMITED camera with only the DEPTH_OUTPUT capability does not have to support
5003                 normal YUV_420_888, JPEG, and PRIV-format outputs. It only has to support the DEPTH16
5004                 format.
5005
5006               Generally, depth output operates at a slower frame rate than standard color capture,
5007               so the DEPTH16 and DEPTH_POINT_CLOUD formats will commonly have a stall duration that
5008               should be accounted for (see {@link
5009               android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration|ACAMERA_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS}).
5010               On a device that supports both depth and color-based output, to enable smooth preview,
5011               using a repeating burst is recommended, where a depth-output target is only included
5012               once every N frames, where N is the ratio between preview output rate and depth output
5013               rate, including depth stall time.
5014               </notes>
5015             </value>
5016             <value optional="true" ndk_hidden="true">CONSTRAINED_HIGH_SPEED_VIDEO
5017               <notes>
5018               The device supports constrained high speed video recording (frame rate >=120fps) use
5019               case. The camera device will support high speed capture session created by {@link
5020               android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession}, which
5021               only accepts high speed request lists created by {@link
5022               android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList}.
5023
5024               A camera device can still support high speed video streaming by advertising the high
5025               speed FPS ranges in android.control.aeAvailableTargetFpsRanges. For this case, all
5026               normal capture request per frame control and synchronization requirements will apply
5027               to the high speed fps ranges, the same as all other fps ranges. This capability
5028               describes the capability of a specialized operating mode with many limitations (see
5029               below), which is only targeted at high speed video recording.
5030
5031               The supported high speed video sizes and fps ranges are specified in {@link
5032               android.hardware.camera2.params.StreamConfigurationMap#getHighSpeedVideoFpsRanges}.
5033               To get desired output frame rates, the application is only allowed to select video
5034               size and FPS range combinations provided by {@link
5035               android.hardware.camera2.params.StreamConfigurationMap#getHighSpeedVideoSizes}.  The
5036               fps range can be controlled via android.control.aeTargetFpsRange.
5037
5038               In this capability, the camera device will override aeMode, awbMode, and afMode to
5039               ON, AUTO, and CONTINUOUS_VIDEO, respectively. All post-processing block mode
5040               controls will be overridden to be FAST. Therefore, no manual control of capture
5041               and post-processing parameters is possible. All other controls operate the
5042               same as when android.control.mode == AUTO. This means that all other
5043               android.control.* fields continue to work, such as
5044
5045               * android.control.aeTargetFpsRange
5046               * android.control.aeExposureCompensation
5047               * android.control.aeLock
5048               * android.control.awbLock
5049               * android.control.effectMode
5050               * android.control.aeRegions
5051               * android.control.afRegions
5052               * android.control.awbRegions
5053               * android.control.afTrigger
5054               * android.control.aePrecaptureTrigger
5055
5056               Outside of android.control.*, the following controls will work:
5057
5058               * android.flash.mode (TORCH mode only, automatic flash for still capture will not
5059               work since aeMode is ON)
5060               * android.lens.opticalStabilizationMode (if it is supported)
5061               * android.scaler.cropRegion
5062               * android.statistics.faceDetectMode (if it is supported)
5063
5064               For high speed recording use case, the actual maximum supported frame rate may
5065               be lower than what camera can output, depending on the destination Surfaces for
5066               the image data. For example, if the destination surface is from video encoder,
5067               the application need check if the video encoder is capable of supporting the
5068               high frame rate for a given video size, or it will end up with lower recording
5069               frame rate. If the destination surface is from preview window, the actual preview frame
5070               rate will be bounded by the screen refresh rate.
5071
5072               The camera device will only support up to 2 high speed simultaneous output surfaces
5073               (preview and recording surfaces) in this mode. Above controls will be effective only
5074               if all of below conditions are true:
5075
5076               * The application creates a camera capture session with no more than 2 surfaces via
5077               {@link
5078               android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession}. The
5079               targeted surfaces must be preview surface (either from {@link
5080               android.view.SurfaceView} or {@link android.graphics.SurfaceTexture}) or recording
5081               surface(either from {@link android.media.MediaRecorder#getSurface} or {@link
5082               android.media.MediaCodec#createInputSurface}).
5083               * The stream sizes are selected from the sizes reported by
5084               {@link android.hardware.camera2.params.StreamConfigurationMap#getHighSpeedVideoSizes}.
5085               * The FPS ranges are selected from {@link
5086               android.hardware.camera2.params.StreamConfigurationMap#getHighSpeedVideoFpsRanges}.
5087
5088               When above conditions are NOT satistied,
5089               {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession}
5090               will fail.
5091
5092               Switching to a FPS range that has different maximum FPS may trigger some camera device
5093               reconfigurations, which may introduce extra latency. It is recommended that
5094               the application avoids unnecessary maximum target FPS changes as much as possible
5095               during high speed streaming.
5096               </notes>
5097             </value>
5098             <value optional="true" hal_version="3.3" >MOTION_TRACKING
5099               <notes>
5100               The camera device supports the MOTION_TRACKING value for
5101               android.control.captureIntent, which limits maximum exposure time to 20 ms.
5102
5103               This limits the motion blur of capture images, resulting in better image tracking
5104               results for use cases such as image stabilization or augmented reality.
5105               </notes>
5106             </value>
5107             <value optional="true" hal_version="3.3">LOGICAL_MULTI_CAMERA
5108               <notes>
5109               The camera device is a logical camera backed by two or more physical cameras that are
5110               also exposed to the application.
5111
5112               This capability requires the camera device to support the following:
5113
5114               * This camera device must list the following static metadata entries in {@link
5115                 android.hardware.camera2.CameraCharacteristics}:
5116                   - android.logicalMultiCamera.physicalIds
5117                   - android.logicalMultiCamera.sensorSyncType
5118               * The underlying physical cameras' static metadata must list the following entries,
5119                 so that the application can correlate pixels from the physical streams:
5120                   - android.lens.poseReference
5121                   - android.lens.poseRotation
5122                   - android.lens.poseTranslation
5123                   - android.lens.intrinsicCalibration
5124                   - android.lens.radialDistortion
5125               * The SENSOR_INFO_TIMESTAMP_SOURCE of the logical device and physical devices must be
5126                 the same.
5127               * The logical camera device must be LIMITED or higher device.
5128
5129               Both the logical camera device and its underlying physical devices support the
5130               mandatory stream combinations required for their device levels.
5131
5132               Additionally, for each guaranteed stream combination, the logical camera supports:
5133
5134               * For each guaranteed stream combination, the logical camera supports replacing one
5135                 logical {@link android.graphics.ImageFormat#YUV_420_888|AIMAGE_FORMAT_YUV_420_888 YUV_420_888}
5136                 or raw stream with two physical streams of the same size and format, each from a
5137                 separate physical camera, given that the size and format are supported by both
5138                 physical cameras.
5139               * If the logical camera doesn't advertise RAW capability, but the underlying physical
5140                 cameras do, the logical camera will support guaranteed stream combinations for RAW
5141                 capability, except that the RAW streams will be physical streams, each from a separate
5142                 physical camera. This is usually the case when the physical cameras have different
5143                 sensor sizes.
5144
5145               Using physical streams in place of a logical stream of the same size and format will
5146               not slow down the frame rate of the capture, as long as the minimum frame duration
5147               of the physical and logical streams are the same.
5148               </notes>
5149             </value>
5150
5151           </enum>
5152           <description>List of capabilities that this camera device
5153           advertises as fully supporting.</description>
5154           <details>
5155           A capability is a contract that the camera device makes in order
5156           to be able to satisfy one or more use cases.
5157
5158           Listing a capability guarantees that the whole set of features
5159           required to support a common use will all be available.
5160
5161           Using a subset of the functionality provided by an unsupported
5162           capability may be possible on a specific camera device implementation;
5163           to do this query each of android.request.availableRequestKeys,
5164           android.request.availableResultKeys,
5165           android.request.availableCharacteristicsKeys.
5166
5167           The following capabilities are guaranteed to be available on
5168           android.info.supportedHardwareLevel `==` FULL devices:
5169
5170           * MANUAL_SENSOR
5171           * MANUAL_POST_PROCESSING
5172
5173           Other capabilities may be available on either FULL or LIMITED
5174           devices, but the application should query this key to be sure.
5175           </details>
5176           <hal_details>
5177           Additional constraint details per-capability will be available
5178           in the Compatibility Test Suite.
5179
5180           Minimum baseline requirements required for the
5181           BACKWARD_COMPATIBLE capability are not explicitly listed.
5182           Instead refer to "BC" tags and the camera CTS tests in the
5183           android.hardware.camera2.cts package.
5184
5185           Listed controls that can be either request or result (e.g.
5186           android.sensor.exposureTime) must be available both in the
5187           request and the result in order to be considered to be
5188           capability-compliant.
5189
5190           For example, if the HAL claims to support MANUAL control,
5191           then exposure time must be configurable via the request _and_
5192           the actual exposure applied must be available via
5193           the result.
5194
5195           If MANUAL_SENSOR is omitted, the HAL may choose to omit the
5196           android.scaler.availableMinFrameDurations static property entirely.
5197
5198           For PRIVATE_REPROCESSING and YUV_REPROCESSING capabilities, see
5199           hardware/libhardware/include/hardware/camera3.h Section 10 for more information.
5200
5201           Devices that support the MANUAL_SENSOR capability must support the
5202           CAMERA3_TEMPLATE_MANUAL template defined in camera3.h.
5203
5204           Devices that support the PRIVATE_REPROCESSING capability or the
5205           YUV_REPROCESSING capability must support the
5206           CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template defined in camera3.h.
5207
5208           For DEPTH_OUTPUT, the depth-format keys
5209           android.depth.availableDepthStreamConfigurations,
5210           android.depth.availableDepthMinFrameDurations,
5211           android.depth.availableDepthStallDurations must be available, in
5212           addition to the other keys explicitly mentioned in the DEPTH_OUTPUT
5213           enum notes. The entry android.depth.maxDepthSamples must be available
5214           if the DEPTH_POINT_CLOUD format is supported (HAL pixel format BLOB, dataspace
5215           DEPTH).
5216
5217           For a camera device with LOGICAL_MULTI_CAMERA capability, it should operate in the
5218           same way as a physical camera device based on its hardware level and capabilities.
5219           It's recommended that its feature set is superset of that of individual physical cameras.
5220           </hal_details>
5221         </entry>
5222         <entry name="availableRequestKeys" type="int32" visibility="ndk_public"
5223                container="array" hwlevel="legacy">
5224           <array>
5225             <size>n</size>
5226           </array>
5227           <description>A list of all keys that the camera device has available
5228           to use with {@link android.hardware.camera2.CaptureRequest|ACaptureRequest}.</description>
5229
5230           <details>Attempting to set a key into a CaptureRequest that is not
5231           listed here will result in an invalid request and will be rejected
5232           by the camera device.
5233
5234           This field can be used to query the feature set of a camera device
5235           at a more granular level than capabilities. This is especially
5236           important for optional keys that are not listed under any capability
5237           in android.request.availableCapabilities.
5238           </details>
5239           <hal_details>
5240           Vendor tags can be listed here. Vendor tag metadata should also
5241           use the extensions C api (refer to camera3.h for more details).
5242
5243           Setting/getting vendor tags will be checked against the metadata
5244           vendor extensions API and not against this field.
5245
5246           The HAL must not consume any request tags that are not listed either
5247           here or in the vendor tag list.
5248
5249           The public camera2 API will always make the vendor tags visible
5250           via
5251           {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureRequestKeys}.
5252           </hal_details>
5253         </entry>
5254         <entry name="availableResultKeys" type="int32" visibility="ndk_public"
5255                container="array" hwlevel="legacy">
5256           <array>
5257             <size>n</size>
5258           </array>
5259           <description>A list of all keys that the camera device has available to use with {@link
5260           android.hardware.camera2.CaptureResult|ACameraCaptureSession_captureCallback_result}.
5261           </description>
5262
5263           <details>Attempting to get a key from a CaptureResult that is not
5264           listed here will always return a `null` value. Getting a key from
5265           a CaptureResult that is listed here will generally never return a `null`
5266           value.
5267
5268           The following keys may return `null` unless they are enabled:
5269
5270           * android.statistics.lensShadingMap (non-null iff android.statistics.lensShadingMapMode == ON)
5271
5272           (Those sometimes-null keys will nevertheless be listed here
5273           if they are available.)
5274
5275           This field can be used to query the feature set of a camera device
5276           at a more granular level than capabilities. This is especially
5277           important for optional keys that are not listed under any capability
5278           in android.request.availableCapabilities.
5279           </details>
5280           <hal_details>
5281           Tags listed here must always have an entry in the result metadata,
5282           even if that size is 0 elements. Only array-type tags (e.g. lists,
5283           matrices, strings) are allowed to have 0 elements.
5284
5285           Vendor tags can be listed here. Vendor tag metadata should also
5286           use the extensions C api (refer to camera3.h for more details).
5287
5288           Setting/getting vendor tags will be checked against the metadata
5289           vendor extensions API and not against this field.
5290
5291           The HAL must not produce any result tags that are not listed either
5292           here or in the vendor tag list.
5293
5294           The public camera2 API will always make the vendor tags visible via {@link
5295           android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys}.
5296           </hal_details>
5297         </entry>
5298         <entry name="availableCharacteristicsKeys" type="int32" visibility="ndk_public"
5299                container="array" hwlevel="legacy">
5300           <array>
5301             <size>n</size>
5302           </array>
5303           <description>A list of all keys that the camera device has available to use with {@link
5304           android.hardware.camera2.CameraCharacteristics|ACameraManager_getCameraCharacteristics}.
5305           </description>
5306           <details>This entry follows the same rules as
5307           android.request.availableResultKeys (except that it applies for
5308           CameraCharacteristics instead of CaptureResult). See above for more
5309           details.
5310           </details>
5311           <hal_details>
5312           Keys listed here must always have an entry in the static info metadata,
5313           even if that size is 0 elements. Only array-type tags (e.g. lists,
5314           matrices, strings) are allowed to have 0 elements.
5315
5316           Vendor tags can listed here. Vendor tag metadata should also use
5317           the extensions C api (refer to camera3.h for more details).
5318
5319           Setting/getting vendor tags will be checked against the metadata
5320           vendor extensions API and not against this field.
5321
5322           The HAL must not have any tags in its static info that are not listed
5323           either here or in the vendor tag list.
5324
5325           The public camera2 API will always make the vendor tags visible
5326           via {@link android.hardware.camera2.CameraCharacteristics#getKeys}.
5327           </hal_details>
5328         </entry>
5329         <entry name="availableSessionKeys" type="int32" visibility="ndk_public"
5330                container="array" hwlevel="legacy" hal_version="3.3">
5331           <array>
5332             <size>n</size>
5333           </array>
5334           <description>A subset of the available request keys that the camera device
5335           can pass as part of the capture session initialization.</description>
5336
5337           <details> This is a subset of android.request.availableRequestKeys which
5338           contains a list of keys that are difficult to apply per-frame and
5339           can result in unexpected delays when modified during the capture session
5340           lifetime. Typical examples include parameters that require a
5341           time-consuming hardware re-configuration or internal camera pipeline
5342           change. For performance reasons we advise clients to pass their initial
5343           values as part of
5344           {@link SessionConfiguration#setSessionParameters|ACameraDevice_createCaptureSessionWithSessionParameters}.
5345           Once the camera capture session is enabled it is also recommended to avoid
5346           changing them from their initial values set in
5347           {@link SessionConfiguration#setSessionParameters|ACameraDevice_createCaptureSessionWithSessionParameters}.
5348           Control over session parameters can still be exerted in capture requests
5349           but clients should be aware and expect delays during their application.
5350           An example usage scenario could look like this:
5351
5352           * The camera client starts by quering the session parameter key list via
5353             {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys|ACameraManager_getCameraCharacteristics}.
5354           * Before triggering the capture session create sequence, a capture request
5355             must be built via
5356             {@link CameraDevice#createCaptureRequest|ACameraDevice_createCaptureRequest}
5357             using an appropriate template matching the particular use case.
5358           * The client should go over the list of session parameters and check
5359             whether some of the keys listed matches with the parameters that
5360             they intend to modify as part of the first capture request.
5361           * If there is no such match, the capture request can be  passed
5362             unmodified to
5363             {@link SessionConfiguration#setSessionParameters|ACameraDevice_createCaptureSessionWithSessionParameters}.
5364           * If matches do exist, the client should update the respective values
5365             and pass the request to
5366             {@link SessionConfiguration#setSessionParameters|ACameraDevice_createCaptureSessionWithSessionParameters}.
5367           * After the capture session initialization completes the session parameter
5368             key list can continue to serve as reference when posting or updating
5369             further requests. As mentioned above further changes to session
5370             parameters should ideally be avoided, if updates are necessary
5371             however clients could expect a delay/glitch during the
5372             parameter switch.
5373
5374           </details>
5375           <hal_details>
5376           Vendor tags can be listed here. Vendor tag metadata should also
5377           use the extensions C api (refer to
5378           android.hardware.camera.device.V3_4.StreamConfiguration.sessionParams for more details).
5379
5380           Setting/getting vendor tags will be checked against the metadata
5381           vendor extensions API and not against this field.
5382
5383           The HAL must not consume any request tags in the session parameters that
5384           are not listed either here or in the vendor tag list.
5385
5386           The public camera2 API will always make the vendor tags visible
5387           via
5388           {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys}.
5389           </hal_details>
5390         </entry>
5391         <entry name="availablePhysicalCameraRequestKeys" type="int32" visibility="hidden"
5392                container="array" hwlevel="limited" hal_version="3.3">
5393           <array>
5394             <size>n</size>
5395           </array>
5396           <description>A subset of the available request keys that can be overriden for
5397           physical devices backing a logical multi-camera.</description>
5398           <details>
5399           This is a subset of android.request.availableRequestKeys which contains a list
5400           of keys that can be overriden using {@link CaptureRequest.Builder#setPhysicalCameraKey}.
5401           The respective value of such request key can be obtained by calling
5402           {@link CaptureRequest.Builder#getPhysicalCameraKey}. Capture requests that contain
5403           individual physical device requests must be built via
5404           {@link android.hardware.camera2.CameraDevice#createCaptureRequest(int, Set)}.
5405           </details>
5406           <hal_details>
5407           Vendor tags can be listed here. Vendor tag metadata should also
5408           use the extensions C api (refer to
5409           android.hardware.camera.device.V3_4.CaptureRequest.physicalCameraSettings for more
5410           details).
5411
5412           Setting/getting vendor tags will be checked against the metadata
5413           vendor extensions API and not against this field.
5414
5415           The HAL must not consume any request tags in the session parameters that
5416           are not listed either here or in the vendor tag list.
5417
5418           There should be no overlap between this set of keys and the available session keys
5419           {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys} along
5420           with any other controls that can have impact on the dual-camera sync.
5421
5422           The public camera2 API will always make the vendor tags visible
5423           via
5424           {@link android.hardware.camera2.CameraCharacteristics#getAvailablePhysicalCameraRequestKeys}.
5425           </hal_details>
5426         </entry>
5427       </static>
5428     </section>
5429     <section name="scaler">
5430       <controls>
5431         <entry name="cropRegion" type="int32" visibility="public"
5432                container="array" typedef="rectangle" hwlevel="legacy">
5433           <array>
5434             <size>4</size>
5435           </array>
5436           <description>The desired region of the sensor to read out for this capture.</description>
5437           <units>Pixel coordinates relative to
5438           android.sensor.info.activeArraySize</units>
5439           <details>
5440             This control can be used to implement digital zoom.
5441
5442             The crop region coordinate system is based off
5443             android.sensor.info.activeArraySize, with `(0, 0)` being the
5444             top-left corner of the sensor active array.
5445
5446             Output streams use this rectangle to produce their output,
5447             cropping to a smaller region if necessary to maintain the
5448             stream's aspect ratio, then scaling the sensor input to
5449             match the output's configured resolution.
5450
5451             The crop region is applied after the RAW to other color
5452             space (e.g. YUV) conversion. Since raw streams
5453             (e.g. RAW16) don't have the conversion stage, they are not
5454             croppable. The crop region will be ignored by raw streams.
5455
5456             For non-raw streams, any additional per-stream cropping will
5457             be done to maximize the final pixel area of the stream.
5458
5459             For example, if the crop region is set to a 4:3 aspect
5460             ratio, then 4:3 streams will use the exact crop
5461             region. 16:9 streams will further crop vertically
5462             (letterbox).
5463
5464             Conversely, if the crop region is set to a 16:9, then 4:3
5465             outputs will crop horizontally (pillarbox), and 16:9
5466             streams will match exactly. These additional crops will
5467             be centered within the crop region.
5468
5469             The width and height of the crop region cannot
5470             be set to be smaller than
5471             `floor( activeArraySize.width / android.scaler.availableMaxDigitalZoom )` and
5472             `floor( activeArraySize.height / android.scaler.availableMaxDigitalZoom )`, respectively.
5473
5474             The camera device may adjust the crop region to account
5475             for rounding and other hardware requirements; the final
5476             crop region used will be included in the output capture
5477             result.
5478           </details>
5479           <ndk_details>
5480             The data representation is int[4], which maps to (left, top, width, height).
5481           </ndk_details>
5482           <hal_details>
5483             The output streams must maintain square pixels at all
5484             times, no matter what the relative aspect ratios of the
5485             crop region and the stream are.  Negative values for
5486             corner are allowed for raw output if full pixel array is
5487             larger than active pixel array. Width and height may be
5488             rounded to nearest larger supportable width, especially
5489             for raw output, where only a few fixed scales may be
5490             possible.
5491
5492             For a set of output streams configured, if the sensor output is cropped to a smaller
5493             size than active array size, the HAL need follow below cropping rules:
5494
5495             * The HAL need handle the cropRegion as if the sensor crop size is the effective active
5496             array size.More specifically, the HAL must transform the request cropRegion from
5497             android.sensor.info.activeArraySize to the sensor cropped pixel area size in this way:
5498                 1. Translate the requested cropRegion w.r.t., the left top corner of the sensor
5499                 cropped pixel area by (tx, ty),
5500                 where `tx = sensorCrop.top * (sensorCrop.height / activeArraySize.height)`
5501                 and `tx = sensorCrop.left * (sensorCrop.width / activeArraySize.width)`. The
5502                 (sensorCrop.top, sensorCrop.left) is the coordinate based off the
5503                 android.sensor.info.activeArraySize.
5504                 2. Scale the width and height of requested cropRegion with scaling factor of
5505                 sensorCrop.width/activeArraySize.width and sensorCrop.height/activeArraySize.height
5506                 respectively.
5507             Once this new cropRegion is calculated, the HAL must use this region to crop the image
5508             with regard to the sensor crop size (effective active array size). The HAL still need
5509             follow the general cropping rule for this new cropRegion and effective active
5510             array size.
5511
5512             * The HAL must report the cropRegion with regard to android.sensor.info.activeArraySize.
5513             The HAL need convert the new cropRegion generated above w.r.t., full active array size.
5514             The reported cropRegion may be slightly different with the requested cropRegion since
5515             the HAL may adjust the crop region to account for rounding, conversion error, or other
5516             hardware limitations.
5517
5518             HAL2.x uses only (x, y, width)
5519           </hal_details>
5520           <tag id="BC" />
5521         </entry>
5522       </controls>
5523       <static>
5524         <entry name="availableFormats" type="int32"
5525         visibility="hidden" deprecated="true" enum="true"
5526         container="array" typedef="imageFormat">
5527           <array>
5528             <size>n</size>
5529           </array>
5530           <enum>
5531             <value optional="true" id="0x20">RAW16
5532               <notes>
5533               RAW16 is a standard, cross-platform format for raw image
5534               buffers with 16-bit pixels.
5535
5536               Buffers of this format are typically expected to have a
5537               Bayer Color Filter Array (CFA) layout, which is given in
5538               android.sensor.info.colorFilterArrangement. Sensors with
5539               CFAs that are not representable by a format in
5540               android.sensor.info.colorFilterArrangement should not
5541               use this format.
5542
5543               Buffers of this format will also follow the constraints given for
5544               RAW_OPAQUE buffers, but with relaxed performance constraints.
5545
5546               This format is intended to give users access to the full contents
5547               of the buffers coming directly from the image sensor prior to any
5548               cropping or scaling operations, and all coordinate systems for
5549               metadata used for this format are relative to the size of the
5550               active region of the image sensor before any geometric distortion
5551               correction has been applied (i.e.
5552               android.sensor.info.preCorrectionActiveArraySize). Supported
5553               dimensions for this format are limited to the full dimensions of
5554               the sensor (e.g. either android.sensor.info.pixelArraySize or
5555               android.sensor.info.preCorrectionActiveArraySize will be the
5556               only supported output size).
5557
5558               See android.scaler.availableInputOutputFormatsMap for
5559               the full set of performance guarantees.
5560               </notes>
5561             </value>
5562             <value optional="true" id="0x24">RAW_OPAQUE
5563               <notes>
5564               RAW_OPAQUE (or
5565               {@link android.graphics.ImageFormat#RAW_PRIVATE RAW_PRIVATE}
5566               as referred in public API) is a format for raw image buffers
5567               coming from an image sensor.
5568
5569               The actual structure of buffers of this format is
5570               platform-specific, but must follow several constraints:
5571
5572               1. No image post-processing operations may have been applied to
5573               buffers of this type. These buffers contain raw image data coming
5574               directly from the image sensor.
5575               1. If a buffer of this format is passed to the camera device for
5576               reprocessing, the resulting images will be identical to the images
5577               produced if the buffer had come directly from the sensor and was
5578               processed with the same settings.
5579
5580               The intended use for this format is to allow access to the native
5581               raw format buffers coming directly from the camera sensor without
5582               any additional conversions or decrease in framerate.
5583
5584               See android.scaler.availableInputOutputFormatsMap for the full set of
5585               performance guarantees.
5586               </notes>
5587             </value>
5588             <value optional="true" id="0x32315659">YV12
5589               <notes>YCrCb 4:2:0 Planar</notes>
5590             </value>
5591             <value optional="true" id="0x11">YCrCb_420_SP
5592               <notes>NV21</notes>
5593             </value>
5594             <value id="0x22">IMPLEMENTATION_DEFINED
5595               <notes>System internal format, not application-accessible</notes>
5596             </value>
5597             <value id="0x23">YCbCr_420_888
5598               <notes>Flexible YUV420 Format</notes>
5599             </value>
5600             <value id="0x21">BLOB
5601               <notes>JPEG format</notes>
5602             </value>
5603           </enum>
5604           <description>The list of image formats that are supported by this
5605           camera device for output streams.</description>
5606           <details>
5607           All camera devices will support JPEG and YUV_420_888 formats.
5608
5609           When set to YUV_420_888, application can access the YUV420 data directly.
5610           </details>
5611           <hal_details>
5612           These format values are from HAL_PIXEL_FORMAT_* in
5613           system/core/include/system/graphics.h.
5614
5615           When IMPLEMENTATION_DEFINED is used, the platform
5616           gralloc module will select a format based on the usage flags provided
5617           by the camera HAL device and the other endpoint of the stream. It is
5618           usually used by preview and recording streams, where the application doesn't
5619           need access the image data.
5620
5621           YCbCr_420_888 format must be supported by the HAL. When an image stream
5622           needs CPU/application direct access, this format will be used.
5623
5624           The BLOB format must be supported by the HAL. This is used for the JPEG stream.
5625
5626           A RAW_OPAQUE buffer should contain only pixel data. It is strongly
5627           recommended that any information used by the camera device when
5628           processing images is fully expressed by the result metadata
5629           for that image buffer.
5630           </hal_details>
5631           <tag id="BC" />
5632         </entry>
5633         <entry name="availableJpegMinDurations" type="int64" visibility="hidden" deprecated="true"
5634         container="array">
5635           <array>
5636             <size>n</size>
5637           </array>
5638           <description>The minimum frame duration that is supported
5639           for each resolution in android.scaler.availableJpegSizes.
5640           </description>
5641           <units>Nanoseconds</units>
5642           <range>TODO: Remove property.</range>
5643           <details>
5644           This corresponds to the minimum steady-state frame duration when only
5645           that JPEG stream is active and captured in a burst, with all
5646           processing (typically in android.*.mode) set to FAST.
5647
5648           When multiple streams are configured, the minimum
5649           frame duration will be &amp;gt;= max(individual stream min
5650           durations)</details>
5651           <tag id="BC" />
5652         </entry>
5653         <entry name="availableJpegSizes" type="int32" visibility="hidden"
5654         deprecated="true" container="array" typedef="size">
5655           <array>
5656             <size>n</size>
5657             <size>2</size>
5658           </array>
5659           <description>The JPEG resolutions that are supported by this camera device.</description>
5660           <range>TODO: Remove property.</range>
5661           <details>
5662           The resolutions are listed as `(width, height)` pairs. All camera devices will support
5663           sensor maximum resolution (defined by android.sensor.info.activeArraySize).
5664           </details>
5665           <hal_details>
5666           The HAL must include sensor maximum resolution
5667           (defined by android.sensor.info.activeArraySize),
5668           and should include half/quarter of sensor maximum resolution.
5669           </hal_details>
5670           <tag id="BC" />
5671         </entry>
5672         <entry name="availableMaxDigitalZoom" type="float" visibility="public"
5673               hwlevel="legacy">
5674           <description>The maximum ratio between both active area width
5675           and crop region width, and active area height and
5676           crop region height, for android.scaler.cropRegion.
5677           </description>
5678           <units>Zoom scale factor</units>
5679           <range>&amp;gt;=1</range>
5680           <details>
5681           This represents the maximum amount of zooming possible by
5682           the camera device, or equivalently, the minimum cropping
5683           window size.
5684
5685           Crop regions that have a width or height that is smaller
5686           than this ratio allows will be rounded up to the minimum
5687           allowed size by the camera device.
5688           </details>
5689           <tag id="BC" />
5690         </entry>
5691         <entry name="availableProcessedMinDurations" type="int64" visibility="hidden" deprecated="true"
5692         container="array">
5693           <array>
5694             <size>n</size>
5695           </array>
5696           <description>For each available processed output size (defined in
5697           android.scaler.availableProcessedSizes), this property lists the
5698           minimum supportable frame duration for that size.
5699           </description>
5700           <units>Nanoseconds</units>
5701           <details>
5702           This should correspond to the frame duration when only that processed
5703           stream is active, with all processing (typically in android.*.mode)
5704           set to FAST.
5705
5706           When multiple streams are configured, the minimum frame duration will
5707           be &amp;gt;= max(individual stream min durations).
5708           </details>
5709           <tag id="BC" />
5710         </entry>
5711         <entry name="availableProcessedSizes" type="int32" visibility="hidden"
5712         deprecated="true" container="array" typedef="size">
5713           <array>
5714             <size>n</size>
5715             <size>2</size>
5716           </array>
5717           <description>The resolutions available for use with
5718           processed output streams, such as YV12, NV12, and
5719           platform opaque YUV/RGB streams to the GPU or video
5720           encoders.</description>
5721           <details>
5722           The resolutions are listed as `(width, height)` pairs.
5723
5724           For a given use case, the actual maximum supported resolution
5725           may be lower than what is listed here, depending on the destination
5726           Surface for the image data. For example, for recording video,
5727           the video encoder chosen may have a maximum size limit (e.g. 1080p)
5728           smaller than what the camera (e.g. maximum resolution is 3264x2448)
5729           can provide.
5730
5731           Please reference the documentation for the image data destination to
5732           check if it limits the maximum size for image data.
5733           </details>
5734           <hal_details>
5735           For FULL capability devices (`android.info.supportedHardwareLevel == FULL`),
5736           the HAL must include all JPEG sizes listed in android.scaler.availableJpegSizes
5737           and each below resolution if it is smaller than or equal to the sensor
5738           maximum resolution (if they are not listed in JPEG sizes already):
5739
5740           * 240p (320 x 240)
5741           * 480p (640 x 480)
5742           * 720p (1280 x 720)
5743           * 1080p (1920 x 1080)
5744
5745           For LIMITED capability devices (`android.info.supportedHardwareLevel == LIMITED`),
5746           the HAL only has to list up to the maximum video size supported by the devices.
5747           </hal_details>
5748           <tag id="BC" />
5749         </entry>
5750         <entry name="availableRawMinDurations" type="int64" deprecated="true"
5751         container="array">
5752           <array>
5753             <size>n</size>
5754           </array>
5755           <description>
5756           For each available raw output size (defined in
5757           android.scaler.availableRawSizes), this property lists the minimum
5758           supportable frame duration for that size.
5759           </description>
5760           <units>Nanoseconds</units>
5761           <details>
5762           Should correspond to the frame duration when only the raw stream is
5763           active.
5764
5765           When multiple streams are configured, the minimum
5766           frame duration will be &amp;gt;= max(individual stream min
5767           durations)</details>
5768           <tag id="BC" />
5769         </entry>
5770         <entry name="availableRawSizes" type="int32" deprecated="true"
5771         container="array" typedef="size">
5772           <array>
5773             <size>n</size>
5774             <size>2</size>
5775           </array>
5776           <description>The resolutions available for use with raw
5777           sensor output streams, listed as width,
5778           height</description>
5779         </entry>
5780       </static>
5781       <dynamic>
5782         <clone entry="android.scaler.cropRegion" kind="controls">
5783         </clone>
5784       </dynamic>
5785       <static>
5786         <entry name="availableInputOutputFormatsMap" type="int32" visibility="hidden"
5787           typedef="reprocessFormatsMap">
5788           <description>The mapping of image formats that are supported by this
5789           camera device for input streams, to their corresponding output formats.
5790           </description>
5791           <details>
5792           All camera devices with at least 1
5793           android.request.maxNumInputStreams will have at least one
5794           available input format.
5795
5796           The camera device will support the following map of formats,
5797           if its dependent capability (android.request.availableCapabilities) is supported:
5798
5799             Input Format                                    | Output Format                                     | Capability
5800           :-------------------------------------------------|:--------------------------------------------------|:----------
5801           {@link android.graphics.ImageFormat#PRIVATE}      | {@link android.graphics.ImageFormat#JPEG}         | PRIVATE_REPROCESSING
5802           {@link android.graphics.ImageFormat#PRIVATE}      | {@link android.graphics.ImageFormat#YUV_420_888}  | PRIVATE_REPROCESSING
5803           {@link android.graphics.ImageFormat#YUV_420_888}  | {@link android.graphics.ImageFormat#JPEG}         | YUV_REPROCESSING
5804           {@link android.graphics.ImageFormat#YUV_420_888}  | {@link android.graphics.ImageFormat#YUV_420_888}  | YUV_REPROCESSING
5805
5806           PRIVATE refers to a device-internal format that is not directly application-visible.  A
5807           PRIVATE input surface can be acquired by {@link android.media.ImageReader#newInstance}
5808           with {@link android.graphics.ImageFormat#PRIVATE} as the format.
5809
5810           For a PRIVATE_REPROCESSING-capable camera device, using the PRIVATE format as either input
5811           or output will never hurt maximum frame rate (i.e.  {@link
5812           android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration
5813           getOutputStallDuration(ImageFormat.PRIVATE, size)} is always 0),
5814
5815           Attempting to configure an input stream with output streams not
5816           listed as available in this map is not valid.
5817           </details>
5818           <hal_details>
5819           For the formats, see `system/core/include/system/graphics.h` for a definition
5820           of the image format enumerations. The PRIVATE format refers to the
5821           HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED format. The HAL could determine
5822           the actual format by using the gralloc usage flags.
5823           For ZSL use case in particular, the HAL could choose appropriate format (partially
5824           processed YUV or RAW based format) by checking the format and GRALLOC_USAGE_HW_CAMERA_ZSL.
5825           See camera3.h for more details.
5826
5827           This value is encoded as a variable-size array-of-arrays.
5828           The inner array always contains `[format, length, ...]` where
5829           `...` has `length` elements. An inner array is followed by another
5830           inner array if the total metadata entry size hasn't yet been exceeded.
5831
5832           A code sample to read/write this encoding (with a device that
5833           supports reprocessing IMPLEMENTATION_DEFINED to YUV_420_888, and JPEG,
5834           and reprocessing YUV_420_888 to YUV_420_888 and JPEG):
5835
5836               // reading
5837               int32_t* contents = &amp;entry.i32[0];
5838               for (size_t i = 0; i &lt; entry.count; ) {
5839                   int32_t format = contents[i++];
5840                   int32_t length = contents[i++];
5841                   int32_t output_formats[length];
5842                   memcpy(&amp;output_formats[0], &amp;contents[i],
5843                          length * sizeof(int32_t));
5844                   i += length;
5845               }
5846
5847               // writing (static example, PRIVATE_REPROCESSING + YUV_REPROCESSING)
5848               int32_t[] contents = {
5849                 IMPLEMENTATION_DEFINED, 2, YUV_420_888, BLOB,
5850                 YUV_420_888, 2, YUV_420_888, BLOB,
5851               };
5852               update_camera_metadata_entry(metadata, index, &amp;contents[0],
5853                     sizeof(contents)/sizeof(contents[0]), &amp;updated_entry);
5854
5855           If the HAL claims to support any of the capabilities listed in the
5856           above details, then it must also support all the input-output
5857           combinations listed for that capability. It can optionally support
5858           additional formats if it so chooses.
5859           </hal_details>
5860           <tag id="REPROC" />
5861         </entry>
5862         <entry name="availableStreamConfigurations" type="int32" visibility="ndk_public"
5863                enum="true" container="array" typedef="streamConfiguration" hwlevel="legacy">
5864           <array>
5865             <size>n</size>
5866             <size>4</size>
5867           </array>
5868           <enum>
5869             <value>OUTPUT</value>
5870             <value>INPUT</value>
5871           </enum>
5872           <description>The available stream configurations that this
5873           camera device supports
5874           (i.e. format, width, height, output/input stream).
5875           </description>
5876           <details>
5877           The configurations are listed as `(format, width, height, input?)`
5878           tuples.
5879
5880           For a given use case, the actual maximum supported resolution
5881           may be lower than what is listed here, depending on the destination
5882           Surface for the image data. For example, for recording video,
5883           the video encoder chosen may have a maximum size limit (e.g. 1080p)
5884           smaller than what the camera (e.g. maximum resolution is 3264x2448)
5885           can provide.
5886
5887           Please reference the documentation for the image data destination to
5888           check if it limits the maximum size for image data.
5889
5890           Not all output formats may be supported in a configuration with
5891           an input stream of a particular format. For more details, see
5892           android.scaler.availableInputOutputFormatsMap.
5893
5894           The following table describes the minimum required output stream
5895           configurations based on the hardware level
5896           (android.info.supportedHardwareLevel):
5897
5898           Format         | Size                                         | Hardware Level | Notes
5899           :-------------:|:--------------------------------------------:|:--------------:|:--------------:
5900           JPEG           | android.sensor.info.activeArraySize          | Any            |
5901           JPEG           | 1920x1080 (1080p)                            | Any            | if 1080p &lt;= activeArraySize
5902           JPEG           | 1280x720 (720)                               | Any            | if 720p &lt;= activeArraySize
5903           JPEG           | 640x480 (480p)                               | Any            | if 480p &lt;= activeArraySize
5904           JPEG           | 320x240 (240p)                               | Any            | if 240p &lt;= activeArraySize
5905           YUV_420_888    | all output sizes available for JPEG          | FULL           |
5906           YUV_420_888    | all output sizes available for JPEG, up to the maximum video size | LIMITED        |
5907           IMPLEMENTATION_DEFINED | same as YUV_420_888                  | Any            |
5908
5909           Refer to android.request.availableCapabilities for additional
5910           mandatory stream configurations on a per-capability basis.
5911           </details>
5912           <hal_details>
5913           It is recommended (but not mandatory) to also include half/quarter
5914           of sensor maximum resolution for JPEG formats (regardless of hardware
5915           level).
5916
5917           (The following is a rewording of the above required table):
5918
5919           For JPEG format, the sizes may be restricted by below conditions:
5920
5921           * The HAL may choose the aspect ratio of each Jpeg size to be one of well known ones
5922           (e.g. 4:3, 16:9, 3:2 etc.). If the sensor maximum resolution
5923           (defined by android.sensor.info.activeArraySize) has an aspect ratio other than these,
5924           it does not have to be included in the supported JPEG sizes.
5925           * Some hardware JPEG encoders may have pixel boundary alignment requirements, such as
5926           the dimensions being a multiple of 16.
5927
5928           Therefore, the maximum JPEG size may be smaller than sensor maximum resolution.
5929           However, the largest JPEG size must be as close as possible to the sensor maximum
5930           resolution given above constraints. It is required that after aspect ratio adjustments,
5931           additional size reduction due to other issues must be less than 3% in area. For example,
5932           if the sensor maximum resolution is 3280x2464, if the maximum JPEG size has aspect
5933           ratio 4:3, the JPEG encoder alignment requirement is 16, the maximum JPEG size will be
5934           3264x2448.
5935
5936           For FULL capability devices (`android.info.supportedHardwareLevel == FULL`),
5937           the HAL must include all YUV_420_888 sizes that have JPEG sizes listed
5938           here as output streams.
5939
5940           It must also include each below resolution if it is smaller than or
5941           equal to the sensor maximum resolution (for both YUV_420_888 and JPEG
5942           formats), as output streams:
5943
5944           * 240p (320 x 240)
5945           * 480p (640 x 480)
5946           * 720p (1280 x 720)
5947           * 1080p (1920 x 1080)
5948
5949           For LIMITED capability devices
5950           (`android.info.supportedHardwareLevel == LIMITED`),
5951           the HAL only has to list up to the maximum video size
5952           supported by the device.
5953
5954           Regardless of hardware level, every output resolution available for
5955           YUV_420_888 must also be available for IMPLEMENTATION_DEFINED.
5956
5957           This supercedes the following fields, which are now deprecated:
5958
5959           * availableFormats
5960           * available[Processed,Raw,Jpeg]Sizes
5961           </hal_details>
5962         </entry>
5963         <entry name="availableMinFrameDurations" type="int64" visibility="ndk_public"
5964                container="array" typedef="streamConfigurationDuration" hwlevel="legacy">
5965           <array>
5966             <size>4</size>
5967             <size>n</size>
5968           </array>
5969           <description>This lists the minimum frame duration for each
5970           format/size combination.
5971           </description>
5972           <units>(format, width, height, ns) x n</units>
5973           <details>
5974           This should correspond to the frame duration when only that
5975           stream is active, with all processing (typically in android.*.mode)
5976           set to either OFF or FAST.
5977
5978           When multiple streams are used in a request, the minimum frame
5979           duration will be max(individual stream min durations).
5980
5981           The minimum frame duration of a stream (of a particular format, size)
5982           is the same regardless of whether the stream is input or output.
5983
5984           See android.sensor.frameDuration and
5985           android.scaler.availableStallDurations for more details about
5986           calculating the max frame rate.
5987           </details>
5988           <tag id="V1" />
5989         </entry>
5990         <entry name="availableStallDurations" type="int64" visibility="ndk_public"
5991                container="array" typedef="streamConfigurationDuration" hwlevel="legacy">
5992           <array>
5993             <size>4</size>
5994             <size>n</size>
5995           </array>
5996           <description>This lists the maximum stall duration for each
5997           output format/size combination.
5998           </description>
5999           <units>(format, width, height, ns) x n</units>
6000           <details>
6001           A stall duration is how much extra time would get added
6002           to the normal minimum frame duration for a repeating request
6003           that has streams with non-zero stall.
6004
6005           For example, consider JPEG captures which have the following
6006           characteristics:
6007
6008           * JPEG streams act like processed YUV streams in requests for which
6009           they are not included; in requests in which they are directly
6010           referenced, they act as JPEG streams. This is because supporting a
6011           JPEG stream requires the underlying YUV data to always be ready for
6012           use by a JPEG encoder, but the encoder will only be used (and impact
6013           frame duration) on requests that actually reference a JPEG stream.
6014           * The JPEG processor can run concurrently to the rest of the camera
6015           pipeline, but cannot process more than 1 capture at a time.
6016
6017           In other words, using a repeating YUV request would result
6018           in a steady frame rate (let's say it's 30 FPS). If a single
6019           JPEG request is submitted periodically, the frame rate will stay
6020           at 30 FPS (as long as we wait for the previous JPEG to return each
6021           time). If we try to submit a repeating YUV + JPEG request, then
6022           the frame rate will drop from 30 FPS.
6023
6024           In general, submitting a new request with a non-0 stall time
6025           stream will _not_ cause a frame rate drop unless there are still
6026           outstanding buffers for that stream from previous requests.
6027
6028           Submitting a repeating request with streams (call this `S`)
6029           is the same as setting the minimum frame duration from
6030           the normal minimum frame duration corresponding to `S`, added with
6031           the maximum stall duration for `S`.
6032
6033           If interleaving requests with and without a stall duration,
6034           a request will stall by the maximum of the remaining times
6035           for each can-stall stream with outstanding buffers.
6036
6037           This means that a stalling request will not have an exposure start
6038           until the stall has completed.
6039
6040           This should correspond to the stall duration when only that stream is
6041           active, with all processing (typically in android.*.mode) set to FAST
6042           or OFF. Setting any of the processing modes to HIGH_QUALITY
6043           effectively results in an indeterminate stall duration for all
6044           streams in a request (the regular stall calculation rules are
6045           ignored).
6046
6047           The following formats may always have a stall duration:
6048
6049           * {@link android.graphics.ImageFormat#JPEG|AIMAGE_FORMAT_JPEG}
6050           * {@link android.graphics.ImageFormat#RAW_SENSOR|AIMAGE_FORMAT_RAW16}
6051
6052           The following formats will never have a stall duration:
6053
6054           * {@link android.graphics.ImageFormat#YUV_420_888|AIMAGE_FORMAT_YUV_420_888}
6055           * {@link android.graphics.ImageFormat#RAW10|AIMAGE_FORMAT_RAW10}
6056           * {@link android.graphics.ImageFormat#RAW12|AIMAGE_FORMAT_RAW12}
6057
6058           All other formats may or may not have an allowed stall duration on
6059           a per-capability basis; refer to android.request.availableCapabilities
6060           for more details.
6061
6062           See android.sensor.frameDuration for more information about
6063           calculating the max frame rate (absent stalls).
6064           </details>
6065           <hal_details>
6066           If possible, it is recommended that all non-JPEG formats
6067           (such as RAW16) should not have a stall duration. RAW10, RAW12, RAW_OPAQUE
6068           and IMPLEMENTATION_DEFINED must not have stall durations.
6069           </hal_details>
6070           <tag id="V1" />
6071         </entry>
6072         <entry name="streamConfigurationMap" type="int32" visibility="java_public"
6073                synthetic="true" typedef="streamConfigurationMap"
6074                hwlevel="legacy">
6075           <description>The available stream configurations that this
6076           camera device supports; also includes the minimum frame durations
6077           and the stall durations for each format/size combination.
6078           </description>
6079           <details>
6080           All camera devices will support sensor maximum resolution (defined by
6081           android.sensor.info.activeArraySize) for the JPEG format.
6082
6083           For a given use case, the actual maximum supported resolution
6084           may be lower than what is listed here, depending on the destination
6085           Surface for the image data. For example, for recording video,
6086           the video encoder chosen may have a maximum size limit (e.g. 1080p)
6087           smaller than what the camera (e.g. maximum resolution is 3264x2448)
6088           can provide.
6089
6090           Please reference the documentation for the image data destination to
6091           check if it limits the maximum size for image data.
6092
6093           The following table describes the minimum required output stream
6094           configurations based on the hardware level
6095           (android.info.supportedHardwareLevel):
6096
6097           Format                                             | Size                                         | Hardware Level | Notes
6098           :-------------------------------------------------:|:--------------------------------------------:|:--------------:|:--------------:
6099           {@link android.graphics.ImageFormat#JPEG}          | android.sensor.info.activeArraySize (*1)     | Any            |
6100           {@link android.graphics.ImageFormat#JPEG}          | 1920x1080 (1080p)                            | Any            | if 1080p &lt;= activeArraySize
6101           {@link android.graphics.ImageFormat#JPEG}          | 1280x720 (720p)                               | Any            | if 720p &lt;= activeArraySize
6102           {@link android.graphics.ImageFormat#JPEG}          | 640x480 (480p)                               | Any            | if 480p &lt;= activeArraySize
6103           {@link android.graphics.ImageFormat#JPEG}          | 320x240 (240p)                               | Any            | if 240p &lt;= activeArraySize
6104           {@link android.graphics.ImageFormat#YUV_420_888}   | all output sizes available for JPEG          | FULL           |
6105           {@link android.graphics.ImageFormat#YUV_420_888}   | all output sizes available for JPEG, up to the maximum video size | LIMITED        |
6106           {@link android.graphics.ImageFormat#PRIVATE}       | same as YUV_420_888                          | Any            |
6107
6108           Refer to android.request.availableCapabilities and {@link
6109           android.hardware.camera2.CameraDevice#createCaptureSession} for additional mandatory
6110           stream configurations on a per-capability basis.
6111
6112           *1: For JPEG format, the sizes may be restricted by below conditions:
6113
6114           * The HAL may choose the aspect ratio of each Jpeg size to be one of well known ones
6115           (e.g. 4:3, 16:9, 3:2 etc.). If the sensor maximum resolution
6116           (defined by android.sensor.info.activeArraySize) has an aspect ratio other than these,
6117           it does not have to be included in the supported JPEG sizes.
6118           * Some hardware JPEG encoders may have pixel boundary alignment requirements, such as
6119           the dimensions being a multiple of 16.
6120           Therefore, the maximum JPEG size may be smaller than sensor maximum resolution.
6121           However, the largest JPEG size will be as close as possible to the sensor maximum
6122           resolution given above constraints. It is required that after aspect ratio adjustments,
6123           additional size reduction due to other issues must be less than 3% in area. For example,
6124           if the sensor maximum resolution is 3280x2464, if the maximum JPEG size has aspect
6125           ratio 4:3, and the JPEG encoder alignment requirement is 16, the maximum JPEG size will be
6126           3264x2448.
6127           </details>
6128           <hal_details>
6129           Do not set this property directly
6130           (it is synthetic and will not be available at the HAL layer);
6131           set the android.scaler.availableStreamConfigurations instead.
6132
6133           Not all output formats may be supported in a configuration with
6134           an input stream of a particular format. For more details, see
6135           android.scaler.availableInputOutputFormatsMap.
6136
6137           It is recommended (but not mandatory) to also include half/quarter
6138           of sensor maximum resolution for JPEG formats (regardless of hardware
6139           level).
6140
6141           (The following is a rewording of the above required table):
6142
6143           The HAL must include sensor maximum resolution (defined by
6144           android.sensor.info.activeArraySize).
6145
6146           For FULL capability devices (`android.info.supportedHardwareLevel == FULL`),
6147           the HAL must include all YUV_420_888 sizes that have JPEG sizes listed
6148           here as output streams.
6149
6150           It must also include each below resolution if it is smaller than or
6151           equal to the sensor maximum resolution (for both YUV_420_888 and JPEG
6152           formats), as output streams:
6153
6154           * 240p (320 x 240)
6155           * 480p (640 x 480)
6156           * 720p (1280 x 720)
6157           * 1080p (1920 x 1080)
6158
6159           For LIMITED capability devices
6160           (`android.info.supportedHardwareLevel == LIMITED`),
6161           the HAL only has to list up to the maximum video size
6162           supported by the device.
6163
6164           Regardless of hardware level, every output resolution available for
6165           YUV_420_888 must also be available for IMPLEMENTATION_DEFINED.
6166
6167           This supercedes the following fields, which are now deprecated:
6168
6169           * availableFormats
6170           * available[Processed,Raw,Jpeg]Sizes
6171           </hal_details>
6172         </entry>
6173         <entry name="croppingType" type="byte" visibility="public" enum="true"
6174                hwlevel="legacy">
6175           <enum>
6176             <value>CENTER_ONLY
6177               <notes>
6178                 The camera device only supports centered crop regions.
6179               </notes>
6180             </value>
6181             <value>FREEFORM
6182               <notes>
6183                 The camera device supports arbitrarily chosen crop regions.
6184               </notes>
6185             </value>
6186           </enum>
6187           <description>The crop type that this camera device supports.</description>
6188           <details>
6189           When passing a non-centered crop region (android.scaler.cropRegion) to a camera
6190           device that only supports CENTER_ONLY cropping, the camera device will move the
6191           crop region to the center of the sensor active array (android.sensor.info.activeArraySize)
6192           and keep the crop region width and height unchanged. The camera device will return the
6193           final used crop region in metadata result android.scaler.cropRegion.
6194
6195           Camera devices that support FREEFORM cropping will support any crop region that
6196           is inside of the active array. The camera device will apply the same crop region and
6197           return the final used crop region in capture result metadata android.scaler.cropRegion.
6198
6199           LEGACY capability devices will only support CENTER_ONLY cropping.
6200           </details>
6201         </entry>
6202       </static>
6203     </section>
6204     <section name="sensor">
6205       <controls>
6206         <entry name="exposureTime" type="int64" visibility="public" hwlevel="full">
6207           <description>Duration each pixel is exposed to
6208           light.</description>
6209           <units>Nanoseconds</units>
6210           <range>android.sensor.info.exposureTimeRange</range>
6211           <details>If the sensor can't expose this exact duration, it will shorten the
6212           duration exposed to the nearest possible value (rather than expose longer).
6213           The final exposure time used will be available in the output capture result.
6214
6215           This control is only effective if android.control.aeMode or android.control.mode is set to
6216           OFF; otherwise the auto-exposure algorithm will override this value.
6217           </details>
6218           <tag id="V1" />
6219         </entry>
6220         <entry name="frameDuration" type="int64" visibility="public" hwlevel="full">
6221           <description>Duration from start of frame exposure to
6222           start of next frame exposure.</description>
6223           <units>Nanoseconds</units>
6224           <range>See android.sensor.info.maxFrameDuration, {@link
6225           android.hardware.camera2.params.StreamConfigurationMap|ACAMERA_SCALER_AVAILABLE_MIN_FRAME_DURATIONS}.
6226           The duration is capped to `max(duration, exposureTime + overhead)`.</range>
6227           <details>
6228           The maximum frame rate that can be supported by a camera subsystem is
6229           a function of many factors:
6230
6231           * Requested resolutions of output image streams
6232           * Availability of binning / skipping modes on the imager
6233           * The bandwidth of the imager interface
6234           * The bandwidth of the various ISP processing blocks
6235
6236           Since these factors can vary greatly between different ISPs and
6237           sensors, the camera abstraction tries to represent the bandwidth
6238           restrictions with as simple a model as possible.
6239
6240           The model presented has the following characteristics:
6241
6242           * The image sensor is always configured to output the smallest
6243           resolution possible given the application's requested output stream
6244           sizes.  The smallest resolution is defined as being at least as large
6245           as the largest requested output stream size; the camera pipeline must
6246           never digitally upsample sensor data when the crop region covers the
6247           whole sensor. In general, this means that if only small output stream
6248           resolutions are configured, the sensor can provide a higher frame
6249           rate.
6250           * Since any request may use any or all the currently configured
6251           output streams, the sensor and ISP must be configured to support
6252           scaling a single capture to all the streams at the same time.  This
6253           means the camera pipeline must be ready to produce the largest
6254           requested output size without any delay.  Therefore, the overall
6255           frame rate of a given configured stream set is governed only by the
6256           largest requested stream resolution.
6257           * Using more than one output stream in a request does not affect the
6258           frame duration.
6259           * Certain format-streams may need to do additional background processing
6260           before data is consumed/produced by that stream. These processors
6261           can run concurrently to the rest of the camera pipeline, but
6262           cannot process more than 1 capture at a time.
6263
6264           The necessary information for the application, given the model above, is provided via
6265           {@link
6266           android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration|ACAMERA_SCALER_AVAILABLE_MIN_FRAME_DURATIONS}.
6267           These are used to determine the maximum frame rate / minimum frame duration that is
6268           possible for a given stream configuration.
6269
6270           Specifically, the application can use the following rules to
6271           determine the minimum frame duration it can request from the camera
6272           device:
6273
6274           1. Let the set of currently configured input/output streams be called `S`.
6275           1. Find the minimum frame durations for each stream in `S`, by looking it up in {@link
6276           android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration|ACAMERA_SCALER_AVAILABLE_MIN_FRAME_DURATIONS}
6277           (with its respective size/format). Let this set of frame durations be called `F`.
6278           1. For any given request `R`, the minimum frame duration allowed for `R` is the maximum
6279           out of all values in `F`. Let the streams used in `R` be called `S_r`.
6280
6281           If none of the streams in `S_r` have a stall time (listed in {@link
6282           android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration|ACAMERA_SCALER_AVAILABLE_STALL_DURATIONS}
6283           using its respective size/format), then the frame duration in `F` determines the steady
6284           state frame rate that the application will get if it uses `R` as a repeating request. Let
6285           this special kind of request be called `Rsimple`.
6286
6287           A repeating request `Rsimple` can be _occasionally_ interleaved by a single capture of a
6288           new request `Rstall` (which has at least one in-use stream with a non-0 stall time) and if
6289           `Rstall` has the same minimum frame duration this will not cause a frame rate loss if all
6290           buffers from the previous `Rstall` have already been delivered.
6291
6292           For more details about stalling, see {@link
6293           android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration|ACAMERA_SCALER_AVAILABLE_STALL_DURATIONS}.
6294
6295           This control is only effective if android.control.aeMode or android.control.mode is set to
6296           OFF; otherwise the auto-exposure algorithm will override this value.
6297           </details>
6298           <hal_details>
6299           For more details about stalling, see
6300           android.scaler.availableStallDurations.
6301           </hal_details>
6302           <tag id="V1" />
6303         </entry>
6304         <entry name="sensitivity" type="int32" visibility="public" hwlevel="full">
6305           <description>The amount of gain applied to sensor data
6306           before processing.</description>
6307           <units>ISO arithmetic units</units>
6308           <range>android.sensor.info.sensitivityRange</range>
6309           <details>
6310           The sensitivity is the standard ISO sensitivity value,
6311           as defined in ISO 12232:2006.
6312
6313           The sensitivity must be within android.sensor.info.sensitivityRange, and
6314           if if it less than android.sensor.maxAnalogSensitivity, the camera device
6315           is guaranteed to use only analog amplification for applying the gain.
6316
6317           If the camera device cannot apply the exact sensitivity
6318           requested, it will reduce the gain to the nearest supported
6319           value. The final sensitivity used will be available in the
6320           output capture result.
6321
6322           This control is only effective if android.control.aeMode or android.control.mode is set to
6323           OFF; otherwise the auto-exposure algorithm will override this value.
6324           </details>
6325           <hal_details>ISO 12232:2006 REI method is acceptable.</hal_details>
6326           <tag id="V1" />
6327         </entry>
6328       </controls>
6329       <static>
6330         <namespace name="info">
6331           <entry name="activeArraySize" type="int32" visibility="public"
6332           type_notes="Four ints defining the active pixel rectangle"
6333           container="array" typedef="rectangle" hwlevel="legacy">
6334             <array>
6335               <size>4</size>
6336             </array>
6337             <description>
6338             The area of the image sensor which corresponds to active pixels after any geometric
6339             distortion correction has been applied.
6340             </description>
6341             <units>Pixel coordinates on the image sensor</units>
6342             <details>
6343             This is the rectangle representing the size of the active region of the sensor (i.e.
6344             the region that actually receives light from the scene) after any geometric correction
6345             has been applied, and should be treated as the maximum size in pixels of any of the
6346             image output formats aside from the raw formats.
6347
6348             This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
6349             the full pixel array, and the size of the full pixel array is given by
6350             android.sensor.info.pixelArraySize.
6351
6352             The coordinate system for most other keys that list pixel coordinates, including
6353             android.scaler.cropRegion, is defined relative to the active array rectangle given in
6354             this field, with `(0, 0)` being the top-left of this rectangle.
6355
6356             The active array may be smaller than the full pixel array, since the full array may
6357             include black calibration pixels or other inactive regions, and geometric correction
6358             resulting in scaling or cropping may have been applied.
6359             </details>
6360             <ndk_details>
6361             The data representation is `int[4]`, which maps to `(left, top, width, height)`.
6362             </ndk_details>
6363             <hal_details>
6364             This array contains `(xmin, ymin, width, height)`. The `(xmin, ymin)` must be
6365             &amp;gt;= `(0,0)`.
6366             The `(width, height)` must be &amp;lt;= `android.sensor.info.pixelArraySize`.
6367             </hal_details>
6368             <tag id="RAW" />
6369           </entry>
6370           <entry name="sensitivityRange" type="int32" visibility="public"
6371           type_notes="Range of supported sensitivities"
6372           container="array" typedef="rangeInt"
6373           hwlevel="full">
6374             <array>
6375               <size>2</size>
6376             </array>
6377             <description>Range of sensitivities for android.sensor.sensitivity supported by this
6378             camera device.</description>
6379             <range>Min &lt;= 100, Max &amp;gt;= 800</range>
6380             <details>
6381               The values are the standard ISO sensitivity values,
6382               as defined in ISO 12232:2006.
6383             </details>
6384
6385             <tag id="BC" />
6386             <tag id="V1" />
6387           </entry>
6388           <entry name="colorFilterArrangement" type="byte" visibility="public" enum="true"
6389             hwlevel="full">
6390             <enum>
6391               <value>RGGB</value>
6392               <value>GRBG</value>
6393               <value>GBRG</value>
6394               <value>BGGR</value>
6395               <value>RGB
6396               <notes>Sensor is not Bayer; output has 3 16-bit
6397               values for each pixel, instead of just 1 16-bit value
6398               per pixel.</notes></value>
6399             </enum>
6400             <description>The arrangement of color filters on sensor;
6401             represents the colors in the top-left 2x2 section of
6402             the sensor, in reading order.</description>
6403             <tag id="RAW" />
6404           </entry>
6405           <entry name="exposureTimeRange" type="int64" visibility="public"
6406                  type_notes="nanoseconds" container="array" typedef="rangeLong"
6407                  hwlevel="full">
6408             <array>
6409               <size>2</size>
6410             </array>
6411             <description>The range of image exposure times for android.sensor.exposureTime supported
6412             by this camera device.
6413             </description>
6414             <units>Nanoseconds</units>
6415             <range>The minimum exposure time will be less than 100 us. For FULL
6416             capability devices (android.info.supportedHardwareLevel == FULL),
6417             the maximum exposure time will be greater than 100ms.</range>
6418             <hal_details>For FULL capability devices (android.info.supportedHardwareLevel == FULL),
6419             The maximum of the range SHOULD be at least 1 second (1e9), MUST be at least
6420             100ms.
6421             </hal_details>
6422             <tag id="V1" />
6423           </entry>
6424           <entry name="maxFrameDuration" type="int64" visibility="public"
6425                  hwlevel="full">
6426             <description>The maximum possible frame duration (minimum frame rate) for
6427             android.sensor.frameDuration that is supported this camera device.</description>
6428             <units>Nanoseconds</units>
6429             <range>For FULL capability devices
6430             (android.info.supportedHardwareLevel == FULL), at least 100ms.
6431             </range>
6432             <details>Attempting to use frame durations beyond the maximum will result in the frame
6433             duration being clipped to the maximum. See that control for a full definition of frame
6434             durations.
6435
6436             Refer to {@link
6437             android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration|ACAMERA_SCALER_AVAILABLE_MIN_FRAME_DURATIONS}
6438             for the minimum frame duration values.
6439             </details>
6440             <hal_details>
6441             For FULL capability devices (android.info.supportedHardwareLevel == FULL),
6442             The maximum of the range SHOULD be at least
6443             1 second (1e9), MUST be at least 100ms (100e6).
6444
6445             android.sensor.info.maxFrameDuration must be greater or
6446             equal to the android.sensor.info.exposureTimeRange max
6447             value (since exposure time overrides frame duration).
6448
6449             Available minimum frame durations for JPEG must be no greater
6450             than that of the YUV_420_888/IMPLEMENTATION_DEFINED
6451             minimum frame durations (for that respective size).
6452
6453             Since JPEG processing is considered offline and can take longer than
6454             a single uncompressed capture, refer to
6455             android.scaler.availableStallDurations
6456             for details about encoding this scenario.
6457             </hal_details>
6458             <tag id="V1" />
6459           </entry>
6460           <entry name="physicalSize" type="float" visibility="public"
6461           type_notes="width x height"
6462           container="array" typedef="sizeF" hwlevel="legacy">
6463             <array>
6464               <size>2</size>
6465             </array>
6466             <description>The physical dimensions of the full pixel
6467             array.</description>
6468             <units>Millimeters</units>
6469             <details>This is the physical size of the sensor pixel
6470             array defined by android.sensor.info.pixelArraySize.
6471             </details>
6472             <hal_details>Needed for FOV calculation for old API</hal_details>
6473             <tag id="V1" />
6474             <tag id="BC" />
6475           </entry>
6476           <entry name="pixelArraySize" type="int32" visibility="public"
6477           container="array" typedef="size" hwlevel="legacy">
6478             <array>
6479               <size>2</size>
6480             </array>
6481             <description>Dimensions of the full pixel array, possibly
6482             including black calibration pixels.</description>
6483             <units>Pixels</units>
6484             <details>The pixel count of the full pixel array of the image sensor, which covers
6485             android.sensor.info.physicalSize area.  This represents the full pixel dimensions of
6486             the raw buffers produced by this sensor.
6487
6488             If a camera device supports raw sensor formats, either this or
6489             android.sensor.info.preCorrectionActiveArraySize is the maximum dimensions for the raw
6490             output formats listed in {@link
6491             android.hardware.camera2.params.StreamConfigurationMap|ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS}
6492             (this depends on whether or not the image sensor returns buffers containing pixels that
6493             are not part of the active array region for blacklevel calibration or other purposes).
6494
6495             Some parts of the full pixel array may not receive light from the scene,
6496             or be otherwise inactive.  The android.sensor.info.preCorrectionActiveArraySize key
6497             defines the rectangle of active pixels that will be included in processed image
6498             formats.
6499             </details>
6500             <tag id="RAW" />
6501             <tag id="BC" />
6502           </entry>
6503           <entry name="whiteLevel" type="int32" visibility="public">
6504             <description>
6505             Maximum raw value output by sensor.
6506             </description>
6507             <range>&amp;gt; 255 (8-bit output)</range>
6508             <details>
6509             This specifies the fully-saturated encoding level for the raw
6510             sample values from the sensor.  This is typically caused by the
6511             sensor becoming highly non-linear or clipping. The minimum for
6512             each channel is specified by the offset in the
6513             android.sensor.blackLevelPattern key.
6514
6515             The white level is typically determined either by sensor bit depth
6516             (8-14 bits is expected), or by the point where the sensor response
6517             becomes too non-linear to be useful.  The default value for this is
6518             maximum representable value for a 16-bit raw sample (2^16 - 1).
6519
6520             The white level values of captured images may vary for different
6521             capture settings (e.g., android.sensor.sensitivity). This key
6522             represents a coarse approximation for such case. It is recommended
6523             to use android.sensor.dynamicWhiteLevel for captures when supported
6524             by the camera device, which provides more accurate white level values.
6525             </details>
6526             <hal_details>
6527             The full bit depth of the sensor must be available in the raw data,
6528             so the value for linear sensors should not be significantly lower
6529             than maximum raw value supported, i.e. 2^(sensor bits per pixel).
6530             </hal_details>
6531             <tag id="RAW" />
6532           </entry>
6533           <entry name="timestampSource" type="byte" visibility="public"
6534                  enum="true" hwlevel="legacy">
6535             <enum>
6536               <value>UNKNOWN
6537                 <notes>
6538                 Timestamps from android.sensor.timestamp are in nanoseconds and monotonic,
6539                 but can not be compared to timestamps from other subsystems
6540                 (e.g. accelerometer, gyro etc.), or other instances of the same or different
6541                 camera devices in the same system. Timestamps between streams and results for
6542                 a single camera instance are comparable, and the timestamps for all buffers
6543                 and the result metadata generated by a single capture are identical.
6544                 </notes>
6545               </value>
6546               <value>REALTIME
6547                 <notes>
6548                 Timestamps from android.sensor.timestamp are in the same timebase as
6549                 {@link android.os.SystemClock#elapsedRealtimeNanos},
6550                 and they can be compared to other timestamps using that base.
6551                 </notes>
6552               </value>
6553             </enum>
6554             <description>The time base source for sensor capture start timestamps.</description>
6555             <details>
6556             The timestamps provided for captures are always in nanoseconds and monotonic, but
6557             may not based on a time source that can be compared to other system time sources.
6558
6559             This characteristic defines the source for the timestamps, and therefore whether they
6560             can be compared against other system time sources/timestamps.
6561             </details>
6562             <hal_details>
6563             For camera devices implement UNKNOWN, the camera framework expects that the timestamp
6564             source to be SYSTEM_TIME_MONOTONIC. For camera devices implement REALTIME, the camera
6565             framework expects that the timestamp source to be SYSTEM_TIME_BOOTTIME. See
6566             system/core/include/utils/Timers.h for the definition of SYSTEM_TIME_MONOTONIC and
6567             SYSTEM_TIME_BOOTTIME. Note that HAL must follow above expectation; otherwise video
6568             recording might suffer unexpected behavior.
6569
6570             Also, camera devices which implement REALTIME must pass the ITS sensor fusion test which
6571             tests the alignment between camera timestamps and gyro sensor timestamps.
6572             </hal_details>
6573           <tag id="V1" />
6574         </entry>
6575         <entry name="lensShadingApplied" type="byte" visibility="public" enum="true"
6576                typedef="boolean">
6577           <enum>
6578             <value>FALSE</value>
6579             <value>TRUE</value>
6580           </enum>
6581           <description>Whether the RAW images output from this camera device are subject to
6582           lens shading correction.</description>
6583           <details>
6584           If TRUE, all images produced by the camera device in the RAW image formats will
6585           have lens shading correction already applied to it. If FALSE, the images will
6586           not be adjusted for lens shading correction.
6587           See android.request.maxNumOutputRaw for a list of RAW image formats.
6588
6589           This key will be `null` for all devices do not report this information.
6590           Devices with RAW capability will always report this information in this key.
6591           </details>
6592         </entry>
6593         <entry name="preCorrectionActiveArraySize" type="int32" visibility="public"
6594           type_notes="Four ints defining the active pixel rectangle" container="array"
6595           typedef="rectangle" hwlevel="legacy">
6596             <array>
6597               <size>4</size>
6598             </array>
6599             <description>
6600             The area of the image sensor which corresponds to active pixels prior to the
6601             application of any geometric distortion correction.
6602             </description>
6603             <units>Pixel coordinates on the image sensor</units>
6604             <details>
6605             This is the rectangle representing the size of the active region of the sensor (i.e.
6606             the region that actually receives light from the scene) before any geometric correction
6607             has been applied, and should be treated as the active region rectangle for any of the
6608             raw formats.  All metadata associated with raw processing (e.g. the lens shading
6609             correction map, and radial distortion fields) treats the top, left of this rectangle as
6610             the origin, (0,0).
6611
6612             The size of this region determines the maximum field of view and the maximum number of
6613             pixels that an image from this sensor can contain, prior to the application of
6614             geometric distortion correction. The effective maximum pixel dimensions of a
6615             post-distortion-corrected image is given by the android.sensor.info.activeArraySize
6616             field, and the effective maximum field of view for a post-distortion-corrected image
6617             can be calculated by applying the geometric distortion correction fields to this
6618             rectangle, and cropping to the rectangle given in android.sensor.info.activeArraySize.
6619
6620             E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the
6621             dimensions in android.sensor.info.activeArraySize given the position of a pixel,
6622             (x', y'), in the raw pixel array with dimensions give in
6623             android.sensor.info.pixelArraySize:
6624
6625             1. Choose a pixel (x', y') within the active array region of the raw buffer given in
6626             android.sensor.info.preCorrectionActiveArraySize, otherwise this pixel is considered
6627             to be outside of the FOV, and will not be shown in the processed output image.
6628             1. Apply geometric distortion correction to get the post-distortion pixel coordinate,
6629             (x_i, y_i). When applying geometric correction metadata, note that metadata for raw
6630             buffers is defined relative to the top, left of the
6631             android.sensor.info.preCorrectionActiveArraySize rectangle.
6632             1. If the resulting corrected pixel coordinate is within the region given in
6633             android.sensor.info.activeArraySize, then the position of this pixel in the
6634             processed output image buffer is `(x_i - activeArray.left, y_i - activeArray.top)`,
6635             when the top, left coordinate of that buffer is treated as (0, 0).
6636
6637             Thus, for pixel x',y' = (25, 25) on a sensor where android.sensor.info.pixelArraySize
6638             is (100,100), android.sensor.info.preCorrectionActiveArraySize is (10, 10, 100, 100),
6639             android.sensor.info.activeArraySize is (20, 20, 80, 80), and the geometric distortion
6640             correction doesn't change the pixel coordinate, the resulting pixel selected in
6641             pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer
6642             with dimensions given in android.sensor.info.pixelArraySize, and would be (5, 5)
6643             relative to the top,left of post-processed YUV output buffer with dimensions given in
6644             android.sensor.info.activeArraySize.
6645
6646             The currently supported fields that correct for geometric distortion are:
6647
6648             1. android.lens.radialDistortion.
6649
6650             If all of the geometric distortion fields are no-ops, this rectangle will be the same
6651             as the post-distortion-corrected rectangle given in
6652             android.sensor.info.activeArraySize.
6653
6654             This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
6655             the full pixel array, and the size of the full pixel array is given by
6656             android.sensor.info.pixelArraySize.
6657
6658             The pre-correction active array may be smaller than the full pixel array, since the
6659             full array may include black calibration pixels or other inactive regions.
6660             </details>
6661             <ndk_details>
6662             The data representation is `int[4]`, which maps to `(left, top, width, height)`.
6663             </ndk_details>
6664             <hal_details>
6665             This array contains `(xmin, ymin, width, height)`. The `(xmin, ymin)` must be
6666             &amp;gt;= `(0,0)`.
6667             The `(width, height)` must be &amp;lt;= `android.sensor.info.pixelArraySize`.
6668
6669             If omitted by the HAL implementation, the camera framework will assume that this is
6670             the same as the post-correction active array region given in
6671             android.sensor.info.activeArraySize.
6672             </hal_details>
6673             <tag id="RAW" />
6674           </entry>
6675         </namespace>
6676         <entry name="referenceIlluminant1" type="byte" visibility="public"
6677                enum="true">
6678           <enum>
6679             <value id="1">DAYLIGHT</value>
6680             <value id="2">FLUORESCENT</value>
6681             <value id="3">TUNGSTEN
6682               <notes>Incandescent light</notes>
6683             </value>
6684             <value id="4">FLASH</value>
6685             <value id="9">FINE_WEATHER</value>
6686             <value id="10">CLOUDY_WEATHER</value>
6687             <value id="11">SHADE</value>
6688             <value id="12">DAYLIGHT_FLUORESCENT
6689               <notes>D 5700 - 7100K</notes>
6690             </value>
6691             <value id="13">DAY_WHITE_FLUORESCENT
6692               <notes>N 4600 - 5400K</notes>
6693             </value>
6694             <value id="14">COOL_WHITE_FLUORESCENT
6695               <notes>W 3900 - 4500K</notes>
6696             </value>
6697             <value id="15">WHITE_FLUORESCENT
6698               <notes>WW 3200 - 3700K</notes>
6699             </value>
6700             <value id="17">STANDARD_A</value>
6701             <value id="18">STANDARD_B</value>
6702             <value id="19">STANDARD_C</value>
6703             <value id="20">D55</value>
6704             <value id="21">D65</value>
6705             <value id="22">D75</value>
6706             <value id="23">D50</value>
6707             <value id="24">ISO_STUDIO_TUNGSTEN</value>
6708           </enum>
6709           <description>
6710           The standard reference illuminant used as the scene light source when
6711           calculating the android.sensor.colorTransform1,
6712           android.sensor.calibrationTransform1, and
6713           android.sensor.forwardMatrix1 matrices.
6714           </description>
6715           <details>
6716           The values in this key correspond to the values defined for the
6717           EXIF LightSource tag. These illuminants are standard light sources
6718           that are often used calibrating camera devices.
6719
6720           If this key is present, then android.sensor.colorTransform1,
6721           android.sensor.calibrationTransform1, and
6722           android.sensor.forwardMatrix1 will also be present.
6723
6724           Some devices may choose to provide a second set of calibration
6725           information for improved quality, including
6726           android.sensor.referenceIlluminant2 and its corresponding matrices.
6727           </details>
6728           <hal_details>
6729           The first reference illuminant (android.sensor.referenceIlluminant1)
6730           and corresponding matrices must be present to support the RAW capability
6731           and DNG output.
6732
6733           When producing raw images with a color profile that has only been
6734           calibrated against a single light source, it is valid to omit
6735           android.sensor.referenceIlluminant2 along with the
6736           android.sensor.colorTransform2, android.sensor.calibrationTransform2,
6737           and android.sensor.forwardMatrix2 matrices.
6738
6739           If only android.sensor.referenceIlluminant1 is included, it should be
6740           chosen so that it is representative of typical scene lighting.  In
6741           general, D50 or DAYLIGHT will be chosen for this case.
6742
6743           If both android.sensor.referenceIlluminant1 and
6744           android.sensor.referenceIlluminant2 are included, they should be
6745           chosen to represent the typical range of scene lighting conditions.
6746           In general, low color temperature illuminant such as Standard-A will
6747           be chosen for the first reference illuminant and a higher color
6748           temperature illuminant such as D65 will be chosen for the second
6749           reference illuminant.
6750           </hal_details>
6751           <tag id="RAW" />
6752         </entry>
6753         <entry name="referenceIlluminant2" type="byte" visibility="public">
6754           <description>
6755           The standard reference illuminant used as the scene light source when
6756           calculating the android.sensor.colorTransform2,
6757           android.sensor.calibrationTransform2, and
6758           android.sensor.forwardMatrix2 matrices.
6759           </description>
6760           <range>Any value listed in android.sensor.referenceIlluminant1</range>
6761           <details>
6762           See android.sensor.referenceIlluminant1 for more details.
6763
6764           If this key is present, then android.sensor.colorTransform2,
6765           android.sensor.calibrationTransform2, and
6766           android.sensor.forwardMatrix2 will also be present.
6767           </details>
6768           <tag id="RAW" />
6769         </entry>
6770         <entry name="calibrationTransform1" type="rational"
6771         visibility="public" optional="true"
6772         type_notes="3x3 matrix in row-major-order" container="array"
6773         typedef="colorSpaceTransform">
6774           <array>
6775             <size>3</size>
6776             <size>3</size>
6777           </array>
6778           <description>
6779           A per-device calibration transform matrix that maps from the
6780           reference sensor colorspace to the actual device sensor colorspace.
6781           </description>
6782           <details>
6783           This matrix is used to correct for per-device variations in the
6784           sensor colorspace, and is used for processing raw buffer data.
6785
6786           The matrix is expressed as a 3x3 matrix in row-major-order, and
6787           contains a per-device calibration transform that maps colors
6788           from reference sensor color space (i.e. the "golden module"
6789           colorspace) into this camera device's native sensor color
6790           space under the first reference illuminant
6791           (android.sensor.referenceIlluminant1).
6792           </details>
6793           <tag id="RAW" />
6794         </entry>
6795         <entry name="calibrationTransform2" type="rational"
6796         visibility="public" optional="true"
6797         type_notes="3x3 matrix in row-major-order" container="array"
6798         typedef="colorSpaceTransform">
6799           <array>
6800             <size>3</size>
6801             <size>3</size>
6802           </array>
6803           <description>
6804           A per-device calibration transform matrix that maps from the
6805           reference sensor colorspace to the actual device sensor colorspace
6806           (this is the colorspace of the raw buffer data).
6807           </description>
6808           <details>
6809           This matrix is used to correct for per-device variations in the
6810           sensor colorspace, and is used for processing raw buffer data.
6811
6812           The matrix is expressed as a 3x3 matrix in row-major-order, and
6813           contains a per-device calibration transform that maps colors
6814           from reference sensor color space (i.e. the "golden module"
6815           colorspace) into this camera device's native sensor color
6816           space under the second reference illuminant
6817           (android.sensor.referenceIlluminant2).
6818
6819           This matrix will only be present if the second reference
6820           illuminant is present.
6821           </details>
6822           <tag id="RAW" />
6823         </entry>
6824         <entry name="colorTransform1" type="rational"
6825         visibility="public" optional="true"
6826         type_notes="3x3 matrix in row-major-order" container="array"
6827         typedef="colorSpaceTransform">
6828           <array>
6829             <size>3</size>
6830             <size>3</size>
6831           </array>
6832           <description>
6833           A matrix that transforms color values from CIE XYZ color space to
6834           reference sensor color space.
6835           </description>
6836           <details>
6837           This matrix is used to convert from the standard CIE XYZ color
6838           space to the reference sensor colorspace, and is used when processing
6839           raw buffer data.
6840
6841           The matrix is expressed as a 3x3 matrix in row-major-order, and
6842           contains a color transform matrix that maps colors from the CIE
6843           XYZ color space to the reference sensor color space (i.e. the
6844           "golden module" colorspace) under the first reference illuminant
6845           (android.sensor.referenceIlluminant1).
6846
6847           The white points chosen in both the reference sensor color space
6848           and the CIE XYZ colorspace when calculating this transform will
6849           match the standard white point for the first reference illuminant
6850           (i.e. no chromatic adaptation will be applied by this transform).
6851           </details>
6852           <tag id="RAW" />
6853         </entry>
6854         <entry name="colorTransform2" type="rational"
6855         visibility="public" optional="true"
6856         type_notes="3x3 matrix in row-major-order" container="array"
6857         typedef="colorSpaceTransform">
6858           <array>
6859             <size>3</size>
6860             <size>3</size>
6861           </array>
6862           <description>
6863           A matrix that transforms color values from CIE XYZ color space to
6864           reference sensor color space.
6865           </description>
6866           <details>
6867           This matrix is used to convert from the standard CIE XYZ color
6868           space to the reference sensor colorspace, and is used when processing
6869           raw buffer data.
6870
6871           The matrix is expressed as a 3x3 matrix in row-major-order, and
6872           contains a color transform matrix that maps colors from the CIE
6873           XYZ color space to the reference sensor color space (i.e. the
6874           "golden module" colorspace) under the second reference illuminant
6875           (android.sensor.referenceIlluminant2).
6876
6877           The white points chosen in both the reference sensor color space
6878           and the CIE XYZ colorspace when calculating this transform will
6879           match the standard white point for the second reference illuminant
6880           (i.e. no chromatic adaptation will be applied by this transform).
6881
6882           This matrix will only be present if the second reference
6883           illuminant is present.
6884           </details>
6885           <tag id="RAW" />
6886         </entry>
6887         <entry name="forwardMatrix1" type="rational"
6888         visibility="public" optional="true"
6889         type_notes="3x3 matrix in row-major-order" container="array"
6890         typedef="colorSpaceTransform">
6891           <array>
6892             <size>3</size>
6893             <size>3</size>
6894           </array>
6895           <description>
6896           A matrix that transforms white balanced camera colors from the reference
6897           sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.
6898           </description>
6899           <details>
6900           This matrix is used to convert to the standard CIE XYZ colorspace, and
6901           is used when processing raw buffer data.
6902
6903           This matrix is expressed as a 3x3 matrix in row-major-order, and contains
6904           a color transform matrix that maps white balanced colors from the
6905           reference sensor color space to the CIE XYZ color space with a D50 white
6906           point.
6907
6908           Under the first reference illuminant (android.sensor.referenceIlluminant1)
6909           this matrix is chosen so that the standard white point for this reference
6910           illuminant in the reference sensor colorspace is mapped to D50 in the
6911           CIE XYZ colorspace.
6912           </details>
6913           <tag id="RAW" />
6914         </entry>
6915         <entry name="forwardMatrix2" type="rational"
6916         visibility="public" optional="true"
6917         type_notes="3x3 matrix in row-major-order" container="array"
6918         typedef="colorSpaceTransform">
6919           <array>
6920             <size>3</size>
6921             <size>3</size>
6922           </array>
6923           <description>
6924           A matrix that transforms white balanced camera colors from the reference
6925           sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.
6926           </description>
6927           <details>
6928           This matrix is used to convert to the standard CIE XYZ colorspace, and
6929           is used when processing raw buffer data.
6930
6931           This matrix is expressed as a 3x3 matrix in row-major-order, and contains
6932           a color transform matrix that maps white balanced colors from the
6933           reference sensor color space to the CIE XYZ color space with a D50 white
6934           point.
6935
6936           Under the second reference illuminant (android.sensor.referenceIlluminant2)
6937           this matrix is chosen so that the standard white point for this reference
6938           illuminant in the reference sensor colorspace is mapped to D50 in the
6939           CIE XYZ colorspace.
6940
6941           This matrix will only be present if the second reference
6942           illuminant is present.
6943           </details>
6944           <tag id="RAW" />
6945         </entry>
6946         <entry name="baseGainFactor" type="rational"
6947         optional="true">
6948           <description>Gain factor from electrons to raw units when
6949           ISO=100</description>
6950           <tag id="FUTURE" />
6951         </entry>
6952         <entry name="blackLevelPattern" type="int32" visibility="public"
6953         optional="true" type_notes="2x2 raw count block" container="array"
6954         typedef="blackLevelPattern">
6955           <array>
6956             <size>4</size>
6957           </array>
6958           <description>
6959           A fixed black level offset for each of the color filter arrangement
6960           (CFA) mosaic channels.
6961           </description>
6962           <range>&amp;gt;= 0 for each.</range>
6963           <details>
6964           This key specifies the zero light value for each of the CFA mosaic
6965           channels in the camera sensor.  The maximal value output by the
6966           sensor is represented by the value in android.sensor.info.whiteLevel.
6967
6968           The values are given in the same order as channels listed for the CFA
6969           layout key (see android.sensor.info.colorFilterArrangement), i.e. the
6970           nth value given corresponds to the black level offset for the nth
6971           color channel listed in the CFA.
6972
6973           The black level values of captured images may vary for different
6974           capture settings (e.g., android.sensor.sensitivity). This key
6975           represents a coarse approximation for such case. It is recommended to
6976           use android.sensor.dynamicBlackLevel or use pixels from
6977           android.sensor.opticalBlackRegions directly for captures when
6978           supported by the camera device, which provides more accurate black
6979           level values. For raw capture in particular, it is recommended to use
6980           pixels from android.sensor.opticalBlackRegions to calculate black
6981           level values for each frame.
6982           </details>
6983           <hal_details>
6984           The values are given in row-column scan order, with the first value
6985           corresponding to the element of the CFA in row=0, column=0.
6986           </hal_details>
6987           <tag id="RAW" />
6988         </entry>
6989         <entry name="maxAnalogSensitivity" type="int32" visibility="public"
6990                optional="true" hwlevel="full">
6991           <description>Maximum sensitivity that is implemented
6992           purely through analog gain.</description>
6993           <details>For android.sensor.sensitivity values less than or
6994           equal to this, all applied gain must be analog. For
6995           values above this, the gain applied can be a mix of analog and
6996           digital.</details>
6997           <tag id="V1" />
6998           <tag id="FULL" />
6999         </entry>
7000         <entry name="orientation" type="int32" visibility="public"
7001                hwlevel="legacy">
7002           <description>Clockwise angle through which the output image needs to be rotated to be
7003           upright on the device screen in its native orientation.
7004           </description>
7005           <units>Degrees of clockwise rotation; always a multiple of
7006           90</units>
7007           <range>0, 90, 180, 270</range>
7008           <details>
7009           Also defines the direction of rolling shutter readout, which is from top to bottom in
7010           the sensor's coordinate system.
7011           </details>
7012           <tag id="BC" />
7013         </entry>
7014         <entry name="profileHueSatMapDimensions" type="int32"
7015         visibility="system" optional="true"
7016         type_notes="Number of samples for hue, saturation, and value"
7017         container="array">
7018           <array>
7019             <size>3</size>
7020           </array>
7021           <description>
7022           The number of input samples for each dimension of
7023           android.sensor.profileHueSatMap.
7024           </description>
7025           <range>
7026           Hue &amp;gt;= 1,
7027           Saturation &amp;gt;= 2,
7028           Value &amp;gt;= 1
7029           </range>
7030           <details>
7031           The number of input samples for the hue, saturation, and value
7032           dimension of android.sensor.profileHueSatMap. The order of the
7033           dimensions given is hue, saturation, value; where hue is the 0th
7034           element.
7035           </details>
7036           <tag id="RAW" />
7037         </entry>
7038       </static>
7039       <dynamic>
7040         <clone entry="android.sensor.exposureTime" kind="controls">
7041         </clone>
7042         <clone entry="android.sensor.frameDuration"
7043         kind="controls"></clone>
7044         <clone entry="android.sensor.sensitivity" kind="controls">
7045         </clone>
7046         <entry name="timestamp" type="int64" visibility="public"
7047                hwlevel="legacy">
7048           <description>Time at start of exposure of first
7049           row of the image sensor active array, in nanoseconds.</description>
7050           <units>Nanoseconds</units>
7051           <range>&amp;gt; 0</range>
7052           <details>The timestamps are also included in all image
7053           buffers produced for the same capture, and will be identical
7054           on all the outputs.
7055
7056           When android.sensor.info.timestampSource `==` UNKNOWN,
7057           the timestamps measure time since an unspecified starting point,
7058           and are monotonically increasing. They can be compared with the
7059           timestamps for other captures from the same camera device, but are
7060           not guaranteed to be comparable to any other time source.
7061
7062           When android.sensor.info.timestampSource `==` REALTIME, the
7063           timestamps measure time in the same timebase as {@link
7064           android.os.SystemClock#elapsedRealtimeNanos}, and they can
7065           be compared to other timestamps from other subsystems that
7066           are using that base.
7067
7068           For reprocessing, the timestamp will match the start of exposure of
7069           the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the
7070           timestamp} in the TotalCaptureResult that was used to create the
7071           reprocess capture request.
7072           </details>
7073           <hal_details>
7074           All timestamps must be in reference to the kernel's
7075           CLOCK_BOOTTIME monotonic clock, which properly accounts for
7076           time spent asleep. This allows for synchronization with
7077           sensors that continue to operate while the system is
7078           otherwise asleep.
7079
7080           If android.sensor.info.timestampSource `==` REALTIME,
7081           The timestamp must be synchronized with the timestamps from other
7082           sensor subsystems that are using the same timebase.
7083
7084           For reprocessing, the input image's start of exposure can be looked up
7085           with android.sensor.timestamp from the metadata included in the
7086           capture request.
7087           </hal_details>
7088           <tag id="BC" />
7089         </entry>
7090         <entry name="temperature" type="float"
7091         optional="true">
7092           <description>The temperature of the sensor, sampled at the time
7093           exposure began for this frame.
7094
7095           The thermal diode being queried should be inside the sensor PCB, or
7096           somewhere close to it.
7097           </description>
7098
7099           <units>Celsius</units>
7100           <range>Optional. This value is missing if no temperature is available.</range>
7101           <tag id="FUTURE" />
7102         </entry>
7103         <entry name="neutralColorPoint" type="rational" visibility="public"
7104         optional="true" container="array">
7105           <array>
7106             <size>3</size>
7107           </array>
7108           <description>
7109           The estimated camera neutral color in the native sensor colorspace at
7110           the time of capture.
7111           </description>
7112           <details>
7113           This value gives the neutral color point encoded as an RGB value in the
7114           native sensor color space.  The neutral color point indicates the
7115           currently estimated white point of the scene illumination.  It can be
7116           used to interpolate between the provided color transforms when
7117           processing raw sensor data.
7118
7119           The order of the values is R, G, B; where R is in the lowest index.
7120           </details>
7121           <tag id="RAW" />
7122         </entry>
7123         <entry name="noiseProfile" type="double" visibility="public"
7124         optional="true" type_notes="Pairs of noise model coefficients"
7125         container="array" typedef="pairDoubleDouble">
7126           <array>
7127             <size>2</size>
7128             <size>CFA Channels</size>
7129           </array>
7130           <description>
7131           Noise model coefficients for each CFA mosaic channel.
7132           </description>
7133           <details>
7134           This key contains two noise model coefficients for each CFA channel
7135           corresponding to the sensor amplification (S) and sensor readout
7136           noise (O).  These are given as pairs of coefficients for each channel
7137           in the same order as channels listed for the CFA layout key
7138           (see android.sensor.info.colorFilterArrangement).  This is
7139           represented as an array of Pair&amp;lt;Double, Double&amp;gt;, where
7140           the first member of the Pair at index n is the S coefficient and the
7141           second member is the O coefficient for the nth color channel in the CFA.
7142
7143           These coefficients are used in a two parameter noise model to describe
7144           the amount of noise present in the image for each CFA channel.  The
7145           noise model used here is:
7146
7147           N(x) = sqrt(Sx + O)
7148
7149           Where x represents the recorded signal of a CFA channel normalized to
7150           the range [0, 1], and S and O are the noise model coeffiecients for
7151           that channel.
7152
7153           A more detailed description of the noise model can be found in the
7154           Adobe DNG specification for the NoiseProfile tag.
7155           </details>
7156           <hal_details>
7157           For a CFA layout of RGGB, the list of coefficients would be given as
7158           an array of doubles S0,O0,S1,O1,..., where S0 and O0 are the coefficients
7159           for the red channel, S1 and O1 are the coefficients for the first green
7160           channel, etc.
7161           </hal_details>
7162           <tag id="RAW" />
7163         </entry>
7164         <entry name="profileHueSatMap" type="float"
7165         visibility="system" optional="true"
7166         type_notes="Mapping for hue, saturation, and value"
7167         container="array">
7168           <array>
7169             <size>hue_samples</size>
7170             <size>saturation_samples</size>
7171             <size>value_samples</size>
7172             <size>3</size>
7173           </array>
7174           <description>
7175           A mapping containing a hue shift, saturation scale, and value scale
7176           for each pixel.
7177           </description>
7178           <units>
7179           The hue shift is given in degrees; saturation and value scale factors are
7180           unitless and are between 0 and 1 inclusive
7181           </units>
7182           <details>
7183           hue_samples, saturation_samples, and value_samples are given in
7184           android.sensor.profileHueSatMapDimensions.
7185
7186           Each entry of this map contains three floats corresponding to the
7187           hue shift, saturation scale, and value scale, respectively; where the
7188           hue shift has the lowest index. The map entries are stored in the key
7189           in nested loop order, with the value divisions in the outer loop, the
7190           hue divisions in the middle loop, and the saturation divisions in the
7191           inner loop. All zero input saturation entries are required to have a
7192           value scale factor of 1.0.
7193           </details>
7194           <tag id="RAW" />
7195         </entry>
7196         <entry name="profileToneCurve" type="float"
7197         visibility="system" optional="true"
7198         type_notes="Samples defining a spline for a tone-mapping curve"
7199         container="array">
7200           <array>
7201             <size>samples</size>
7202             <size>2</size>
7203           </array>
7204           <description>
7205           A list of x,y samples defining a tone-mapping curve for gamma adjustment.
7206           </description>
7207           <range>
7208           Each sample has an input range of `[0, 1]` and an output range of
7209           `[0, 1]`.  The first sample is required to be `(0, 0)`, and the last
7210           sample is required to be `(1, 1)`.
7211           </range>
7212           <details>
7213           This key contains a default tone curve that can be applied while
7214           processing the image as a starting point for user adjustments.
7215           The curve is specified as a list of value pairs in linear gamma.
7216           The curve is interpolated using a cubic spline.
7217           </details>
7218           <tag id="RAW" />
7219         </entry>
7220         <entry name="greenSplit" type="float" visibility="public" optional="true">
7221           <description>
7222           The worst-case divergence between Bayer green channels.
7223           </description>
7224           <range>
7225           &amp;gt;= 0
7226           </range>
7227           <details>
7228           This value is an estimate of the worst case split between the
7229           Bayer green channels in the red and blue rows in the sensor color
7230           filter array.
7231
7232           The green split is calculated as follows:
7233
7234           1. A 5x5 pixel (or larger) window W within the active sensor array is
7235           chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
7236           mosaic channels (R, Gr, Gb, B).  The location and size of the window
7237           chosen is implementation defined, and should be chosen to provide a
7238           green split estimate that is both representative of the entire image
7239           for this camera sensor, and can be calculated quickly.
7240           1. The arithmetic mean of the green channels from the red
7241           rows (mean_Gr) within W is computed.
7242           1. The arithmetic mean of the green channels from the blue
7243           rows (mean_Gb) within W is computed.
7244           1. The maximum ratio R of the two means is computed as follows:
7245           `R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))`
7246
7247           The ratio R is the green split divergence reported for this property,
7248           which represents how much the green channels differ in the mosaic
7249           pattern.  This value is typically used to determine the treatment of
7250           the green mosaic channels when demosaicing.
7251
7252           The green split value can be roughly interpreted as follows:
7253
7254           * R &amp;lt; 1.03 is a negligible split (&amp;lt;3% divergence).
7255           * 1.20 &amp;lt;= R &amp;gt;= 1.03 will require some software
7256           correction to avoid demosaic errors (3-20% divergence).
7257           * R &amp;gt; 1.20 will require strong software correction to produce
7258           a usuable image (&amp;gt;20% divergence).
7259           </details>
7260           <hal_details>
7261           The green split given may be a static value based on prior
7262           characterization of the camera sensor using the green split
7263           calculation method given here over a large, representative, sample
7264           set of images.  Other methods of calculation that produce equivalent
7265           results, and can be interpreted in the same manner, may be used.
7266           </hal_details>
7267           <tag id="RAW" />
7268         </entry>
7269       </dynamic>
7270       <controls>
7271         <entry name="testPatternData" type="int32" visibility="public" optional="true" container="array">
7272           <array>
7273             <size>4</size>
7274           </array>
7275           <description>
7276             A pixel `[R, G_even, G_odd, B]` that supplies the test pattern
7277             when android.sensor.testPatternMode is SOLID_COLOR.
7278           </description>
7279           <details>
7280           Each color channel is treated as an unsigned 32-bit integer.
7281           The camera device then uses the most significant X bits
7282           that correspond to how many bits are in its Bayer raw sensor
7283           output.
7284
7285           For example, a sensor with RAW10 Bayer output would use the
7286           10 most significant bits from each color channel.
7287           </details>
7288           <hal_details>
7289           </hal_details>
7290         </entry>
7291         <entry name="testPatternMode" type="int32" visibility="public" optional="true"
7292           enum="true">
7293           <enum>
7294             <value>OFF
7295               <notes>No test pattern mode is used, and the camera
7296               device returns captures from the image sensor.
7297
7298               This is the default if the key is not set.</notes>
7299             </value>
7300             <value>SOLID_COLOR
7301               <notes>
7302               Each pixel in `[R, G_even, G_odd, B]` is replaced by its
7303               respective color channel provided in
7304               android.sensor.testPatternData.
7305
7306               For example:
7307
7308                   android.testPatternData = [0, 0xFFFFFFFF, 0xFFFFFFFF, 0]
7309
7310               All green pixels are 100% green. All red/blue pixels are black.
7311
7312                   android.testPatternData = [0xFFFFFFFF, 0, 0xFFFFFFFF, 0]
7313
7314               All red pixels are 100% red. Only the odd green pixels
7315               are 100% green. All blue pixels are 100% black.
7316               </notes>
7317             </value>
7318             <value>COLOR_BARS
7319               <notes>
7320               All pixel data is replaced with an 8-bar color pattern.
7321
7322               The vertical bars (left-to-right) are as follows:
7323
7324               * 100% white
7325               * yellow
7326               * cyan
7327               * green
7328               * magenta
7329               * red
7330               * blue
7331               * black
7332
7333               In general the image would look like the following:
7334
7335                  W Y C G M R B K
7336                  W Y C G M R B K
7337                  W Y C G M R B K
7338                  W Y C G M R B K
7339                  W Y C G M R B K
7340                  . . . . . . . .
7341                  . . . . . . . .
7342                  . . . . . . . .
7343
7344                  (B = Blue, K = Black)
7345
7346              Each bar should take up 1/8 of the sensor pixel array width.
7347              When this is not possible, the bar size should be rounded
7348              down to the nearest integer and the pattern can repeat
7349              on the right side.
7350
7351              Each bar's height must always take up the full sensor
7352              pixel array height.
7353
7354              Each pixel in this test pattern must be set to either
7355              0% intensity or 100% intensity.
7356              </notes>
7357             </value>
7358             <value>COLOR_BARS_FADE_TO_GRAY
7359               <notes>
7360               The test pattern is similar to COLOR_BARS, except that
7361               each bar should start at its specified color at the top,
7362               and fade to gray at the bottom.
7363
7364               Furthermore each bar is further subdivided into a left and
7365               right half. The left half should have a smooth gradient,
7366               and the right half should have a quantized gradient.
7367
7368               In particular, the right half's should consist of blocks of the
7369               same color for 1/16th active sensor pixel array width.
7370
7371               The least significant bits in the quantized gradient should
7372               be copied from the most significant bits of the smooth gradient.
7373
7374               The height of each bar should always be a multiple of 128.
7375               When this is not the case, the pattern should repeat at the bottom
7376               of the image.
7377               </notes>
7378             </value>
7379             <value>PN9
7380               <notes>
7381               All pixel data is replaced by a pseudo-random sequence
7382               generated from a PN9 512-bit sequence (typically implemented
7383               in hardware with a linear feedback shift register).
7384
7385               The generator should be reset at the beginning of each frame,
7386               and thus each subsequent raw frame with this test pattern should
7387               be exactly the same as the last.
7388               </notes>
7389             </value>
7390             <value id="256">CUSTOM1
7391               <notes>The first custom test pattern. All custom patterns that are
7392               available only on this camera device are at least this numeric
7393               value.
7394
7395               All of the custom test patterns will be static
7396               (that is the raw image must not vary from frame to frame).
7397               </notes>
7398             </value>
7399           </enum>
7400           <description>When enabled, the sensor sends a test pattern instead of
7401           doing a real exposure from the camera.
7402           </description>
7403           <range>android.sensor.availableTestPatternModes</range>
7404           <details>
7405           When a test pattern is enabled, all manual sensor controls specified
7406           by android.sensor.* will be ignored. All other controls should
7407           work as normal.
7408
7409           For example, if manual flash is enabled, flash firing should still
7410           occur (and that the test pattern remain unmodified, since the flash
7411           would not actually affect it).
7412
7413           Defaults to OFF.
7414           </details>
7415           <hal_details>
7416           All test patterns are specified in the Bayer domain.
7417
7418           The HAL may choose to substitute test patterns from the sensor
7419           with test patterns from on-device memory. In that case, it should be
7420           indistinguishable to the ISP whether the data came from the
7421           sensor interconnect bus (such as CSI2) or memory.
7422           </hal_details>
7423         </entry>
7424       </controls>
7425       <dynamic>
7426         <clone entry="android.sensor.testPatternData" kind="controls">
7427         </clone>
7428         <clone entry="android.sensor.testPatternMode" kind="controls">
7429         </clone>
7430       </dynamic>
7431       <static>
7432         <entry name="availableTestPatternModes" type="int32" visibility="public" optional="true"
7433           type_notes="list of enums" container="array">
7434           <array>
7435             <size>n</size>
7436           </array>
7437           <description>List of sensor test pattern modes for android.sensor.testPatternMode
7438           supported by this camera device.
7439           </description>
7440           <range>Any value listed in android.sensor.testPatternMode</range>
7441           <details>
7442             Defaults to OFF, and always includes OFF if defined.
7443           </details>
7444           <hal_details>
7445             All custom modes must be >= CUSTOM1.
7446           </hal_details>
7447         </entry>
7448       </static>
7449       <dynamic>
7450         <entry name="rollingShutterSkew" type="int64" visibility="public" hwlevel="limited">
7451           <description>Duration between the start of first row exposure
7452           and the start of last row exposure.</description>
7453           <units>Nanoseconds</units>
7454           <range> &amp;gt;= 0 and &amp;lt;
7455           {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration}.</range>
7456           <details>
7457           This is the exposure time skew between the first and last
7458           row exposure start times. The first row and the last row are
7459           the first and last rows inside of the
7460           android.sensor.info.activeArraySize.
7461
7462           For typical camera sensors that use rolling shutters, this is also equivalent
7463           to the frame readout time.
7464           </details>
7465           <hal_details>
7466           The HAL must report `0` if the sensor is using global shutter, where all pixels begin
7467           exposure at the same time.
7468           </hal_details>
7469           <tag id="V1" />
7470         </entry>
7471       </dynamic>
7472       <static>
7473         <entry name="opticalBlackRegions" type="int32" visibility="public" optional="true"
7474           container="array" typedef="rectangle">
7475           <array>
7476             <size>4</size>
7477             <size>num_regions</size>
7478           </array>
7479           <description>List of disjoint rectangles indicating the sensor
7480           optically shielded black pixel regions.
7481           </description>
7482           <details>
7483             In most camera sensors, the active array is surrounded by some
7484             optically shielded pixel areas. By blocking light, these pixels
7485             provides a reliable black reference for black level compensation
7486             in active array region.
7487
7488             This key provides a list of disjoint rectangles specifying the
7489             regions of optically shielded (with metal shield) black pixel
7490             regions if the camera device is capable of reading out these black
7491             pixels in the output raw images. In comparison to the fixed black
7492             level values reported by android.sensor.blackLevelPattern, this key
7493             may provide a more accurate way for the application to calculate
7494             black level of each captured raw images.
7495
7496             When this key is reported, the android.sensor.dynamicBlackLevel and
7497             android.sensor.dynamicWhiteLevel will also be reported.
7498           </details>
7499           <ndk_details>
7500             The data representation is `int[4]`, which maps to `(left, top, width, height)`.
7501           </ndk_details>
7502           <hal_details>
7503             This array contains (xmin, ymin, width, height). The (xmin, ymin)
7504             must be &amp;gt;= (0,0) and &amp;lt;=
7505             android.sensor.info.pixelArraySize. The (width, height) must be
7506             &amp;lt;= android.sensor.info.pixelArraySize. Each region must be
7507             outside the region reported by
7508             android.sensor.info.preCorrectionActiveArraySize.
7509
7510             The HAL must report minimal number of disjoint regions for the
7511             optically shielded back pixel regions. For example, if a region can
7512             be covered by one rectangle, the HAL must not split this region into
7513             multiple rectangles.
7514           </hal_details>
7515         </entry>
7516       </static>
7517       <dynamic>
7518         <entry name="dynamicBlackLevel" type="float" visibility="public"
7519         optional="true" type_notes="2x2 raw count block" container="array">
7520           <array>
7521             <size>4</size>
7522           </array>
7523           <description>
7524           A per-frame dynamic black level offset for each of the color filter
7525           arrangement (CFA) mosaic channels.
7526           </description>
7527           <range>&amp;gt;= 0 for each.</range>
7528           <details>
7529           Camera sensor black levels may vary dramatically for different
7530           capture settings (e.g. android.sensor.sensitivity). The fixed black
7531           level reported by android.sensor.blackLevelPattern may be too
7532           inaccurate to represent the actual value on a per-frame basis. The
7533           camera device internal pipeline relies on reliable black level values
7534           to process the raw images appropriately. To get the best image
7535           quality, the camera device may choose to estimate the per frame black
7536           level values either based on optically shielded black regions
7537           (android.sensor.opticalBlackRegions) or its internal model.
7538
7539           This key reports the camera device estimated per-frame zero light
7540           value for each of the CFA mosaic channels in the camera sensor. The
7541           android.sensor.blackLevelPattern may only represent a coarse
7542           approximation of the actual black level values. This value is the
7543           black level used in camera device internal image processing pipeline
7544           and generally more accurate than the fixed black level values.
7545           However, since they are estimated values by the camera device, they
7546           may not be as accurate as the black level values calculated from the
7547           optical black pixels reported by android.sensor.opticalBlackRegions.
7548
7549           The values are given in the same order as channels listed for the CFA
7550           layout key (see android.sensor.info.colorFilterArrangement), i.e. the
7551           nth value given corresponds to the black level offset for the nth
7552           color channel listed in the CFA.
7553
7554           This key will be available if android.sensor.opticalBlackRegions is available or the
7555           camera device advertises this key via {@link
7556           android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys|ACAMERA_REQUEST_AVAILABLE_RESULT_KEYS}.
7557           </details>
7558           <hal_details>
7559           The values are given in row-column scan order, with the first value
7560           corresponding to the element of the CFA in row=0, column=0.
7561           </hal_details>
7562           <tag id="RAW" />
7563         </entry>
7564         <entry name="dynamicWhiteLevel" type="int32" visibility="public"
7565         optional="true" >
7566           <description>
7567           Maximum raw value output by sensor for this frame.
7568           </description>
7569           <range> &amp;gt;= 0</range>
7570           <details>
7571           Since the android.sensor.blackLevelPattern may change for different
7572           capture settings (e.g., android.sensor.sensitivity), the white
7573           level will change accordingly. This key is similar to
7574           android.sensor.info.whiteLevel, but specifies the camera device
7575           estimated white level for each frame.
7576
7577           This key will be available if android.sensor.opticalBlackRegions is
7578           available or the camera device advertises this key via
7579           {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureRequestKeys|ACAMERA_REQUEST_AVAILABLE_RESULT_KEYS}.
7580           </details>
7581           <hal_details>
7582           The full bit depth of the sensor must be available in the raw data,
7583           so the value for linear sensors should not be significantly lower
7584           than maximum raw value supported, i.e. 2^(sensor bits per pixel).
7585           </hal_details>
7586           <tag id="RAW" />
7587         </entry>
7588       </dynamic>
7589       <static>
7590         <entry name="opaqueRawSize" type="int32" visibility="system" container="array">
7591           <array>
7592             <size>n</size>
7593             <size>3</size>
7594           </array>
7595           <description>Size in bytes for all the listed opaque RAW buffer sizes</description>
7596           <range>Must be large enough to fit the opaque RAW of corresponding size produced by
7597           the camera</range>
7598           <details>
7599           This configurations are listed as `(width, height, size_in_bytes)` tuples.
7600           This is used for sizing the gralloc buffers for opaque RAW buffers.
7601           All RAW_OPAQUE output stream configuration listed in
7602           android.scaler.availableStreamConfigurations will have a corresponding tuple in
7603           this key.
7604           </details>
7605           <hal_details>
7606           This key is added in legacy HAL3.4.
7607
7608           For legacy HAL3.4 or above: devices advertising RAW_OPAQUE format output must list this
7609           key.  For legacy HAL3.3 or earlier devices: if RAW_OPAQUE ouput is advertised, camera
7610           framework will derive this key by assuming each pixel takes two bytes and no padding bytes
7611           between rows.
7612           </hal_details>
7613         </entry>
7614       </static>
7615     </section>
7616     <section name="shading">
7617       <controls>
7618         <entry name="mode" type="byte" visibility="public" enum="true" hwlevel="full">
7619           <enum>
7620             <value>OFF
7621             <notes>No lens shading correction is applied.</notes></value>
7622             <value>FAST
7623             <notes>Apply lens shading corrections, without slowing
7624             frame rate relative to sensor raw output</notes></value>
7625             <value>HIGH_QUALITY
7626             <notes>Apply high-quality lens shading correction, at the
7627             cost of possibly reduced frame rate.</notes></value>
7628           </enum>
7629           <description>Quality of lens shading correction applied
7630           to the image data.</description>
7631           <range>android.shading.availableModes</range>
7632           <details>
7633           When set to OFF mode, no lens shading correction will be applied by the
7634           camera device, and an identity lens shading map data will be provided
7635           if `android.statistics.lensShadingMapMode == ON`. For example, for lens
7636           shading map with size of `[ 4, 3 ]`,
7637           the output android.statistics.lensShadingCorrectionMap for this case will be an identity
7638           map shown below:
7639
7640               [ 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
7641                1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
7642                1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
7643                1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
7644                1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
7645                1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0 ]
7646
7647           When set to other modes, lens shading correction will be applied by the camera
7648           device. Applications can request lens shading map data by setting
7649           android.statistics.lensShadingMapMode to ON, and then the camera device will provide lens
7650           shading map data in android.statistics.lensShadingCorrectionMap; the returned shading map
7651           data will be the one applied by the camera device for this capture request.
7652
7653           The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
7654           the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
7655           AWB are in AUTO modes(android.control.aeMode `!=` OFF and android.control.awbMode `!=`
7656           OFF), to get best results, it is recommended that the applications wait for the AE and AWB
7657           to be converged before using the returned shading map data.
7658           </details>
7659         </entry>
7660         <entry name="strength" type="byte">
7661           <description>Control the amount of shading correction
7662           applied to the images</description>
7663           <units>unitless: 1-10; 10 is full shading
7664           compensation</units>
7665           <tag id="FUTURE" />
7666         </entry>
7667       </controls>
7668       <dynamic>
7669         <clone entry="android.shading.mode" kind="controls">
7670         </clone>
7671       </dynamic>
7672       <static>
7673         <entry name="availableModes" type="byte" visibility="public"
7674             type_notes="List of enums (android.shading.mode)." container="array"
7675             typedef="enumList" hwlevel="legacy">
7676           <array>
7677             <size>n</size>
7678           </array>
7679           <description>
7680           List of lens shading modes for android.shading.mode that are supported by this camera device.
7681           </description>
7682           <range>Any value listed in android.shading.mode</range>
7683           <details>
7684               This list contains lens shading modes that can be set for the camera device.
7685               Camera devices that support the MANUAL_POST_PROCESSING capability will always
7686               list OFF and FAST mode. This includes all FULL level devices.
7687               LEGACY devices will always only support FAST mode.
7688           </details>
7689           <hal_details>
7690             HAL must support both FAST and HIGH_QUALITY if lens shading correction control is
7691             available on the camera device, but the underlying implementation can be the same for
7692             both modes. That is, if the highest quality implementation on the camera device does not
7693             slow down capture rate, then FAST and HIGH_QUALITY will generate the same output.
7694           </hal_details>
7695         </entry>
7696       </static>
7697     </section>
7698     <section name="statistics">
7699       <controls>
7700         <entry name="faceDetectMode" type="byte" visibility="public" enum="true"
7701                hwlevel="legacy">
7702           <enum>
7703             <value>OFF
7704             <notes>Do not include face detection statistics in capture
7705             results.</notes></value>
7706             <value optional="true">SIMPLE
7707             <notes>Return face rectangle and confidence values only.
7708             </notes></value>
7709             <value optional="true">FULL
7710             <notes>Return all face
7711             metadata.
7712
7713             In this mode, face rectangles, scores, landmarks, and face IDs are all valid.
7714             </notes></value>
7715           </enum>
7716           <description>Operating mode for the face detector
7717           unit.</description>
7718           <range>android.statistics.info.availableFaceDetectModes</range>
7719           <details>Whether face detection is enabled, and whether it
7720           should output just the basic fields or the full set of
7721           fields.</details>
7722           <hal_details>
7723             SIMPLE mode must fill in android.statistics.faceRectangles and
7724             android.statistics.faceScores.
7725             FULL mode must also fill in android.statistics.faceIds, and
7726             android.statistics.faceLandmarks.
7727           </hal_details>
7728           <tag id="BC" />
7729         </entry>
7730         <entry name="histogramMode" type="byte" enum="true" typedef="boolean">
7731           <enum>
7732             <value>OFF</value>
7733             <value>ON</value>
7734           </enum>
7735           <description>Operating mode for histogram
7736           generation</description>
7737           <tag id="FUTURE" />
7738         </entry>
7739         <entry name="sharpnessMapMode" type="byte" enum="true" typedef="boolean">
7740           <enum>
7741             <value>OFF</value>
7742             <value>ON</value>
7743           </enum>
7744           <description>Operating mode for sharpness map
7745           generation</description>
7746           <tag id="FUTURE" />
7747         </entry>
7748         <entry name="hotPixelMapMode" type="byte" visibility="public" enum="true"
7749         typedef="boolean">
7750           <enum>
7751             <value>OFF
7752             <notes>Hot pixel map production is disabled.
7753             </notes></value>
7754             <value>ON
7755             <notes>Hot pixel map production is enabled.
7756             </notes></value>
7757           </enum>
7758           <description>
7759           Operating mode for hot pixel map generation.
7760           </description>
7761           <range>android.statistics.info.availableHotPixelMapModes</range>
7762           <details>
7763           If set to `true`, a hot pixel map is returned in android.statistics.hotPixelMap.
7764           If set to `false`, no hot pixel map will be returned.
7765           </details>
7766           <tag id="V1" />
7767           <tag id="RAW" />
7768         </entry>
7769       </controls>
7770       <static>
7771         <namespace name="info">
7772           <entry name="availableFaceDetectModes" type="byte"
7773                  visibility="public"
7774                  type_notes="List of enums from android.statistics.faceDetectMode"
7775                  container="array"
7776                  typedef="enumList"
7777                  hwlevel="legacy">
7778             <array>
7779               <size>n</size>
7780             </array>
7781             <description>List of face detection modes for android.statistics.faceDetectMode that are
7782             supported by this camera device.
7783             </description>
7784             <range>Any value listed in android.statistics.faceDetectMode</range>
7785             <details>OFF is always supported.
7786             </details>
7787           </entry>
7788           <entry name="histogramBucketCount" type="int32">
7789             <description>Number of histogram buckets
7790             supported</description>
7791             <range>&amp;gt;= 64</range>
7792             <tag id="FUTURE" />
7793           </entry>
7794           <entry name="maxFaceCount" type="int32" visibility="public" hwlevel="legacy">
7795             <description>The maximum number of simultaneously detectable
7796             faces.</description>
7797             <range>0 for cameras without available face detection; otherwise:
7798             `&gt;=4` for LIMITED or FULL hwlevel devices or
7799             `&gt;0` for LEGACY devices.</range>
7800             <tag id="BC" />
7801           </entry>
7802           <entry name="maxHistogramCount" type="int32">
7803             <description>Maximum value possible for a histogram
7804             bucket</description>
7805             <tag id="FUTURE" />
7806           </entry>
7807           <entry name="maxSharpnessMapValue" type="int32">
7808             <description>Maximum value possible for a sharpness map
7809             region.</description>
7810             <tag id="FUTURE" />
7811           </entry>
7812           <entry name="sharpnessMapSize" type="int32"
7813           type_notes="width x height" container="array" typedef="size">
7814             <array>
7815               <size>2</size>
7816             </array>
7817             <description>Dimensions of the sharpness
7818             map</description>
7819             <range>Must be at least 32 x 32</range>
7820             <tag id="FUTURE" />
7821           </entry>
7822           <entry name="availableHotPixelMapModes" type="byte" visibility="public"
7823                  type_notes="list of enums" container="array" typedef="boolean">
7824             <array>
7825               <size>n</size>
7826             </array>
7827             <description>
7828             List of hot pixel map output modes for android.statistics.hotPixelMapMode that are
7829             supported by this camera device.
7830             </description>
7831             <range>Any value listed in android.statistics.hotPixelMapMode</range>
7832             <details>
7833             If no hotpixel map output is available for this camera device, this will contain only
7834             `false`.
7835
7836             ON is always supported on devices with the RAW capability.
7837             </details>
7838             <tag id="V1" />
7839             <tag id="RAW" />
7840           </entry>
7841           <entry name="availableLensShadingMapModes" type="byte" visibility="public"
7842                  type_notes="list of enums" container="array" typedef="enumList">
7843             <array>
7844               <size>n</size>
7845             </array>
7846             <description>
7847             List of lens shading map output modes for android.statistics.lensShadingMapMode that
7848             are supported by this camera device.
7849             </description>
7850             <range>Any value listed in android.statistics.lensShadingMapMode</range>
7851             <details>
7852             If no lens shading map output is available for this camera device, this key will
7853             contain only OFF.
7854
7855             ON is always supported on devices with the RAW capability.
7856             LEGACY mode devices will always only support OFF.
7857             </details>
7858           </entry>
7859           <entry name="availableOisDataModes" type="byte" visibility="public"
7860                  type_notes="list of enums" container="array" typedef="enumList" hal_version="3.3">
7861             <array>
7862               <size>n</size>
7863             </array>
7864             <description>
7865             List of OIS data output modes for android.statistics.oisDataMode that
7866             are supported by this camera device.
7867             </description>
7868             <range>Any value listed in android.statistics.oisDataMode</range>
7869             <details>
7870             If no OIS data output is available for this camera device, this key will
7871             contain only OFF.
7872             </details>
7873           </entry>
7874         </namespace>
7875       </static>
7876       <dynamic>
7877         <clone entry="android.statistics.faceDetectMode"
7878                kind="controls"></clone>
7879         <entry name="faceIds" type="int32" visibility="ndk_public"
7880                container="array" hwlevel="legacy">
7881           <array>
7882             <size>n</size>
7883           </array>
7884           <description>List of unique IDs for detected faces.</description>
7885           <details>
7886           Each detected face is given a unique ID that is valid for as long as the face is visible
7887           to the camera device.  A face that leaves the field of view and later returns may be
7888           assigned a new ID.
7889
7890           Only available if android.statistics.faceDetectMode == FULL</details>
7891           <tag id="BC" />
7892         </entry>
7893         <entry name="faceLandmarks" type="int32" visibility="ndk_public"
7894                type_notes="(leftEyeX, leftEyeY, rightEyeX, rightEyeY, mouthX, mouthY)"
7895                container="array" hwlevel="legacy">
7896           <array>
7897             <size>n</size>
7898             <size>6</size>
7899           </array>
7900           <description>List of landmarks for detected
7901           faces.</description>
7902           <details>
7903             The coordinate system is that of android.sensor.info.activeArraySize, with
7904             `(0, 0)` being the top-left pixel of the active array.
7905
7906             Only available if android.statistics.faceDetectMode == FULL</details>
7907           <tag id="BC" />
7908         </entry>
7909         <entry name="faceRectangles" type="int32" visibility="ndk_public"
7910                type_notes="(xmin, ymin, xmax, ymax). (0,0) is top-left of active pixel area"
7911                container="array" typedef="rectangle" hwlevel="legacy">
7912           <array>
7913             <size>n</size>
7914             <size>4</size>
7915           </array>
7916           <description>List of the bounding rectangles for detected
7917           faces.</description>
7918           <details>
7919             The coordinate system is that of android.sensor.info.activeArraySize, with
7920             `(0, 0)` being the top-left pixel of the active array.
7921
7922             Only available if android.statistics.faceDetectMode != OFF</details>
7923           <ndk_details>
7924             The data representation is `int[4]`, which maps to `(left, top, width, height)`.
7925           </ndk_details>
7926           <tag id="BC" />
7927         </entry>
7928         <entry name="faceScores" type="byte" visibility="ndk_public"
7929                container="array" hwlevel="legacy">
7930           <array>
7931             <size>n</size>
7932           </array>
7933           <description>List of the face confidence scores for
7934           detected faces</description>
7935           <range>1-100</range>
7936           <details>Only available if android.statistics.faceDetectMode != OFF.
7937           </details>
7938           <hal_details>
7939           The value should be meaningful (for example, setting 100 at
7940           all times is illegal).</hal_details>
7941           <tag id="BC" />
7942         </entry>
7943         <entry name="faces" type="int32" visibility="java_public" synthetic="true"
7944                container="array" typedef="face" hwlevel="legacy">
7945           <array>
7946             <size>n</size>
7947           </array>
7948           <description>List of the faces detected through camera face detection
7949           in this capture.</description>
7950           <details>
7951           Only available if android.statistics.faceDetectMode `!=` OFF.
7952           </details>
7953         </entry>
7954         <entry name="histogram" type="int32"
7955         type_notes="count of pixels for each color channel that fall into each histogram bucket, scaled to be between 0 and maxHistogramCount"
7956         container="array">
7957           <array>
7958             <size>n</size>
7959             <size>3</size>
7960           </array>
7961           <description>A 3-channel histogram based on the raw
7962           sensor data</description>
7963           <details>The k'th bucket (0-based) covers the input range
7964           (with w = android.sensor.info.whiteLevel) of [ k * w/N,
7965           (k + 1) * w / N ). If only a monochrome sharpness map is
7966           supported, all channels should have the same data</details>
7967           <tag id="FUTURE" />
7968         </entry>
7969         <clone entry="android.statistics.histogramMode"
7970         kind="controls"></clone>
7971         <entry name="sharpnessMap" type="int32"
7972         type_notes="estimated sharpness for each region of the input image. Normalized to be between 0 and maxSharpnessMapValue. Higher values mean sharper (better focused)"
7973         container="array">
7974           <array>
7975             <size>n</size>
7976             <size>m</size>
7977             <size>3</size>
7978           </array>
7979           <description>A 3-channel sharpness map, based on the raw
7980           sensor data</description>
7981           <details>If only a monochrome sharpness map is supported,
7982           all channels should have the same data</details>
7983           <tag id="FUTURE" />
7984         </entry>
7985         <clone entry="android.statistics.sharpnessMapMode"
7986                kind="controls"></clone>
7987         <entry name="lensShadingCorrectionMap" type="byte" visibility="java_public"
7988                typedef="lensShadingMap" hwlevel="full">
7989           <description>The shading map is a low-resolution floating-point map
7990           that lists the coefficients used to correct for vignetting, for each
7991           Bayer color channel.</description>
7992           <range>Each gain factor is &amp;gt;= 1</range>
7993           <details>
7994           The map provided here is the same map that is used by the camera device to
7995           correct both color shading and vignetting for output non-RAW images.
7996
7997           When there is no lens shading correction applied to RAW
7998           output images (android.sensor.info.lensShadingApplied `==`
7999           false), this map is the complete lens shading correction
8000           map; when there is some lens shading correction applied to
8001           the RAW output image (android.sensor.info.lensShadingApplied
8002           `==` true), this map reports the remaining lens shading
8003           correction map that needs to be applied to get shading
8004           corrected images that match the camera device's output for
8005           non-RAW formats.
8006
8007           For a complete shading correction map, the least shaded
8008           section of the image will have a gain factor of 1; all
8009           other sections will have gains above 1.
8010
8011           When android.colorCorrection.mode = TRANSFORM_MATRIX, the map
8012           will take into account the colorCorrection settings.
8013
8014           The shading map is for the entire active pixel array, and is not
8015           affected by the crop region specified in the request. Each shading map
8016           entry is the value of the shading compensation map over a specific
8017           pixel on the sensor.  Specifically, with a (N x M) resolution shading
8018           map, and an active pixel array size (W x H), shading map entry
8019           (x,y) Ïµ (0 ... N-1, 0 ... M-1) is the value of the shading map at
8020           pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
8021           The map is assumed to be bilinearly interpolated between the sample points.
8022
8023           The channel order is [R, Geven, Godd, B], where Geven is the green
8024           channel for the even rows of a Bayer pattern, and Godd is the odd rows.
8025           The shading map is stored in a fully interleaved format.
8026
8027           The shading map will generally have on the order of 30-40 rows and columns,
8028           and will be smaller than 64x64.
8029
8030           As an example, given a very small map defined as:
8031
8032               width,height = [ 4, 3 ]
8033               values =
8034               [ 1.3, 1.2, 1.15, 1.2,  1.2, 1.2, 1.15, 1.2,
8035                   1.1, 1.2, 1.2, 1.2,  1.3, 1.2, 1.3, 1.3,
8036                 1.2, 1.2, 1.25, 1.1,  1.1, 1.1, 1.1, 1.0,
8037                   1.0, 1.0, 1.0, 1.0,  1.2, 1.3, 1.25, 1.2,
8038                 1.3, 1.2, 1.2, 1.3,   1.2, 1.15, 1.1, 1.2,
8039                   1.2, 1.1, 1.0, 1.2,  1.3, 1.15, 1.2, 1.3 ]
8040
8041           The low-resolution scaling map images for each channel are
8042           (displayed using nearest-neighbor interpolation):
8043
8044           ![Red lens shading map](android.statistics.lensShadingMap/red_shading.png)
8045           ![Green (even rows) lens shading map](android.statistics.lensShadingMap/green_e_shading.png)
8046           ![Green (odd rows) lens shading map](android.statistics.lensShadingMap/green_o_shading.png)
8047           ![Blue lens shading map](android.statistics.lensShadingMap/blue_shading.png)
8048
8049           As a visualization only, inverting the full-color map to recover an
8050           image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:
8051
8052           ![Image of a uniform white wall (inverse shading map)](android.statistics.lensShadingMap/inv_shading.png)
8053           </details>
8054         </entry>
8055         <entry name="lensShadingMap" type="float" visibility="ndk_public"
8056                type_notes="2D array of float gain factors per channel to correct lens shading"
8057                container="array" hwlevel="full">
8058           <array>
8059             <size>4</size>
8060             <size>n</size>
8061             <size>m</size>
8062           </array>
8063           <description>The shading map is a low-resolution floating-point map
8064           that lists the coefficients used to correct for vignetting and color shading,
8065           for each Bayer color channel of RAW image data.</description>
8066           <range>Each gain factor is &amp;gt;= 1</range>
8067           <details>
8068           The map provided here is the same map that is used by the camera device to
8069           correct both color shading and vignetting for output non-RAW images.
8070
8071           When there is no lens shading correction applied to RAW
8072           output images (android.sensor.info.lensShadingApplied `==`
8073           false), this map is the complete lens shading correction
8074           map; when there is some lens shading correction applied to
8075           the RAW output image (android.sensor.info.lensShadingApplied
8076           `==` true), this map reports the remaining lens shading
8077           correction map that needs to be applied to get shading
8078           corrected images that match the camera device's output for
8079           non-RAW formats.
8080
8081           For a complete shading correction map, the least shaded
8082           section of the image will have a gain factor of 1; all
8083           other sections will have gains above 1.
8084
8085           When android.colorCorrection.mode = TRANSFORM_MATRIX, the map
8086           will take into account the colorCorrection settings.
8087
8088           The shading map is for the entire active pixel array, and is not
8089           affected by the crop region specified in the request. Each shading map
8090           entry is the value of the shading compensation map over a specific
8091           pixel on the sensor.  Specifically, with a (N x M) resolution shading
8092           map, and an active pixel array size (W x H), shading map entry
8093           (x,y) Ïµ (0 ... N-1, 0 ... M-1) is the value of the shading map at
8094           pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
8095           The map is assumed to be bilinearly interpolated between the sample points.
8096
8097           The channel order is [R, Geven, Godd, B], where Geven is the green
8098           channel for the even rows of a Bayer pattern, and Godd is the odd rows.
8099           The shading map is stored in a fully interleaved format, and its size
8100           is provided in the camera static metadata by android.lens.info.shadingMapSize.
8101
8102           The shading map will generally have on the order of 30-40 rows and columns,
8103           and will be smaller than 64x64.
8104
8105           As an example, given a very small map defined as:
8106
8107               android.lens.info.shadingMapSize = [ 4, 3 ]
8108               android.statistics.lensShadingMap =
8109               [ 1.3, 1.2, 1.15, 1.2,  1.2, 1.2, 1.15, 1.2,
8110                   1.1, 1.2, 1.2, 1.2,  1.3, 1.2, 1.3, 1.3,
8111                 1.2, 1.2, 1.25, 1.1,  1.1, 1.1, 1.1, 1.0,
8112                   1.0, 1.0, 1.0, 1.0,  1.2, 1.3, 1.25, 1.2,
8113                 1.3, 1.2, 1.2, 1.3,   1.2, 1.15, 1.1, 1.2,
8114                   1.2, 1.1, 1.0, 1.2,  1.3, 1.15, 1.2, 1.3 ]
8115
8116           The low-resolution scaling map images for each channel are
8117           (displayed using nearest-neighbor interpolation):
8118
8119           ![Red lens shading map](android.statistics.lensShadingMap/red_shading.png)
8120           ![Green (even rows) lens shading map](android.statistics.lensShadingMap/green_e_shading.png)
8121           ![Green (odd rows) lens shading map](android.statistics.lensShadingMap/green_o_shading.png)
8122           ![Blue lens shading map](android.statistics.lensShadingMap/blue_shading.png)
8123
8124           As a visualization only, inverting the full-color map to recover an
8125           image of a gray wall (using bicubic interpolation for visual quality)
8126           as captured by the sensor gives:
8127
8128           ![Image of a uniform white wall (inverse shading map)](android.statistics.lensShadingMap/inv_shading.png)
8129
8130           Note that the RAW image data might be subject to lens shading
8131           correction not reported on this map. Query
8132           android.sensor.info.lensShadingApplied to see if RAW image data has subject
8133           to lens shading correction. If android.sensor.info.lensShadingApplied
8134           is TRUE, the RAW image data is subject to partial or full lens shading
8135           correction. In the case full lens shading correction is applied to RAW
8136           images, the gain factor map reported in this key will contain all 1.0 gains.
8137           In other words, the map reported in this key is the remaining lens shading
8138           that needs to be applied on the RAW image to get images without lens shading
8139           artifacts. See android.request.maxNumOutputRaw for a list of RAW image
8140           formats.
8141           </details>
8142           <hal_details>
8143           The lens shading map calculation may depend on exposure and white balance statistics.
8144           When AE and AWB are in AUTO modes
8145           (android.control.aeMode `!=` OFF and android.control.awbMode `!=` OFF), the HAL
8146           may have all the information it need to generate most accurate lens shading map. When
8147           AE or AWB are in manual mode
8148           (android.control.aeMode `==` OFF or android.control.awbMode `==` OFF), the shading map
8149           may be adversely impacted by manual exposure or white balance parameters. To avoid
8150           generating unreliable shading map data, the HAL may choose to lock the shading map with
8151           the latest known good map generated when the AE and AWB are in AUTO modes.
8152           </hal_details>
8153         </entry>
8154         <entry name="predictedColorGains" type="float"
8155                visibility="hidden"
8156                deprecated="true"
8157                optional="true"
8158                type_notes="A 1D array of floats for 4 color channel gains"
8159                container="array">
8160           <array>
8161             <size>4</size>
8162           </array>
8163           <description>The best-fit color channel gains calculated
8164           by the camera device's statistics units for the current output frame.
8165           </description>
8166           <details>
8167           This may be different than the gains used for this frame,
8168           since statistics processing on data from a new frame
8169           typically completes after the transform has already been
8170           applied to that frame.
8171
8172           The 4 channel gains are defined in Bayer domain,
8173           see android.colorCorrection.gains for details.
8174
8175           This value should always be calculated by the auto-white balance (AWB) block,
8176           regardless of the android.control.* current values.
8177           </details>
8178         </entry>
8179         <entry name="predictedColorTransform" type="rational"
8180                visibility="hidden"
8181                deprecated="true"
8182                optional="true"
8183                type_notes="3x3 rational matrix in row-major order"
8184                container="array">
8185           <array>
8186             <size>3</size>
8187             <size>3</size>
8188           </array>
8189           <description>The best-fit color transform matrix estimate
8190           calculated by the camera device's statistics units for the current
8191           output frame.</description>
8192           <details>The camera device will provide the estimate from its
8193           statistics unit on the white balance transforms to use
8194           for the next frame. These are the values the camera device believes
8195           are the best fit for the current output frame. This may
8196           be different than the transform used for this frame, since
8197           statistics processing on data from a new frame typically
8198           completes after the transform has already been applied to
8199           that frame.
8200
8201           These estimates must be provided for all frames, even if
8202           capture settings and color transforms are set by the application.
8203
8204           This value should always be calculated by the auto-white balance (AWB) block,
8205           regardless of the android.control.* current values.
8206           </details>
8207         </entry>
8208         <entry name="sceneFlicker" type="byte" visibility="public" enum="true"
8209                hwlevel="full">
8210           <enum>
8211             <value>NONE
8212             <notes>The camera device does not detect any flickering illumination
8213             in the current scene.</notes></value>
8214             <value>50HZ
8215             <notes>The camera device detects illumination flickering at 50Hz
8216             in the current scene.</notes></value>
8217             <value>60HZ
8218             <notes>The camera device detects illumination flickering at 60Hz
8219             in the current scene.</notes></value>
8220           </enum>
8221           <description>The camera device estimated scene illumination lighting
8222           frequency.</description>
8223           <details>
8224           Many light sources, such as most fluorescent lights, flicker at a rate
8225           that depends on the local utility power standards. This flicker must be
8226           accounted for by auto-exposure routines to avoid artifacts in captured images.
8227           The camera device uses this entry to tell the application what the scene
8228           illuminant frequency is.
8229
8230           When manual exposure control is enabled
8231           (`android.control.aeMode == OFF` or `android.control.mode ==
8232           OFF`), the android.control.aeAntibandingMode doesn't perform
8233           antibanding, and the application can ensure it selects
8234           exposure times that do not cause banding issues by looking
8235           into this metadata field. See
8236           android.control.aeAntibandingMode for more details.
8237
8238           Reports NONE if there doesn't appear to be flickering illumination.
8239           </details>
8240         </entry>
8241         <clone entry="android.statistics.hotPixelMapMode" kind="controls">
8242         </clone>
8243         <entry name="hotPixelMap" type="int32" visibility="public"
8244         type_notes="list of coordinates based on android.sensor.pixelArraySize"
8245         container="array" typedef="point">
8246           <array>
8247             <size>2</size>
8248             <size>n</size>
8249           </array>
8250           <description>
8251           List of `(x, y)` coordinates of hot/defective pixels on the sensor.
8252           </description>
8253           <range>
8254           n &lt;= number of pixels on the sensor.
8255           The `(x, y)` coordinates must be bounded by
8256           android.sensor.info.pixelArraySize.
8257           </range>
8258           <details>
8259           A coordinate `(x, y)` must lie between `(0, 0)`, and
8260           `(width - 1, height - 1)` (inclusive), which are the top-left and
8261           bottom-right of the pixel array, respectively. The width and
8262           height dimensions are given in android.sensor.info.pixelArraySize.
8263           This may include hot pixels that lie outside of the active array
8264           bounds given by android.sensor.info.activeArraySize.
8265           </details>
8266           <hal_details>
8267           A hotpixel map contains the coordinates of pixels on the camera
8268           sensor that do report valid values (usually due to defects in
8269           the camera sensor). This includes pixels that are stuck at certain
8270           values, or have a response that does not accuractly encode the
8271           incoming light from the scene.
8272
8273           To avoid performance issues, there should be significantly fewer hot
8274           pixels than actual pixels on the camera sensor.
8275           </hal_details>
8276           <tag id="V1" />
8277           <tag id="RAW" />
8278         </entry>
8279       </dynamic>
8280       <controls>
8281         <entry name="lensShadingMapMode" type="byte" visibility="public" enum="true" hwlevel="full">
8282           <enum>
8283             <value>OFF
8284             <notes>Do not include a lens shading map in the capture result.</notes></value>
8285             <value>ON
8286             <notes>Include a lens shading map in the capture result.</notes></value>
8287           </enum>
8288           <description>Whether the camera device will output the lens
8289           shading map in output result metadata.</description>
8290           <range>android.statistics.info.availableLensShadingMapModes</range>
8291           <details>When set to ON,
8292           android.statistics.lensShadingMap will be provided in
8293           the output result metadata.
8294
8295           ON is always supported on devices with the RAW capability.
8296           </details>
8297           <tag id="RAW" />
8298         </entry>
8299       </controls>
8300       <dynamic>
8301         <clone entry="android.statistics.lensShadingMapMode" kind="controls">
8302         </clone>
8303       </dynamic>
8304       <controls>
8305         <entry name="oisDataMode" type="byte" visibility="public" enum="true" hal_version="3.3">
8306           <enum>
8307             <value>OFF
8308             <notes>Do not include OIS data in the capture result.</notes></value>
8309             <value>ON
8310             <notes>Include OIS data in the capture result.</notes></value>
8311           </enum>
8312           <description>A control for selecting whether OIS position information is included in output
8313           result metadata.</description>
8314           <range>android.Statistics.info.availableOisDataModes</range>
8315           <details>When set to ON,
8316           android.statistics.oisTimestamps, android.statistics.oisShiftPixelX,
8317           and android.statistics.oisShiftPixelY provide OIS data in the output result metadata.
8318           </details>
8319         </entry>
8320       </controls>
8321       <dynamic>
8322         <clone entry="android.statistics.oisDataMode" kind="controls">
8323         </clone>
8324         <entry name="oisTimestamps" type="int64" visibility="public" container="array" hal_version="3.3">
8325           <array>
8326             <size>n</size>
8327           </array>
8328           <description>
8329           An array of timestamps of OIS samples, in nanoseconds.
8330           </description>
8331           <units>nanoseconds</units>
8332           <details>
8333           The array contains the timestamps of OIS samples. The timestamps are in the same
8334           timebase as and comparable to android.sensor.timestamp.
8335           </details>
8336         </entry>
8337         <entry name="oisXShifts" type="float" visibility="public" container="array" hal_version="3.3">
8338           <array>
8339             <size>n</size>
8340           </array>
8341           <description>
8342           An array of shifts of OIS samples, in x direction.
8343           </description>
8344           <units>Pixels in active array.</units>
8345           <details>
8346           The array contains the amount of shifts in x direction, in pixels, based on OIS samples.
8347           A positive value is a shift from left to right in active array coordinate system. For
8348           example, if the optical center is (1000, 500) in active array coordinates, an shift of
8349           (3, 0) puts the new optical center at (1003, 500).
8350
8351           The number of shifts must match the number of timestamps in
8352           android.statistics.oisTimestamps.
8353           </details>
8354         </entry>
8355         <entry name="oisYShifts" type="float" visibility="public" container="array" hal_version="3.3">
8356           <array>
8357             <size>n</size>
8358           </array>
8359           <description>
8360           An array of shifts of OIS samples, in y direction.
8361           </description>
8362           <units>Pixels in active array.</units>
8363           <details>
8364           The array contains the amount of shifts in y direction, in pixels, based on OIS samples.
8365           A positive value is a shift from top to bottom in active array coordinate system. For
8366           example, if the optical center is (1000, 500) in active array coordinates, an shift of
8367           (0, 5) puts the new optical center at (1000, 505).
8368
8369           The number of shifts must match the number of timestamps in
8370           android.statistics.oisTimestamps.
8371           </details>
8372         </entry>
8373       </dynamic>
8374     </section>
8375     <section name="tonemap">
8376       <controls>
8377         <entry name="curveBlue" type="float" visibility="ndk_public"
8378         type_notes="1D array of float pairs (P_IN, P_OUT). The maximum number of pairs is specified by android.tonemap.maxCurvePoints."
8379         container="array" hwlevel="full">
8380           <array>
8381             <size>n</size>
8382             <size>2</size>
8383           </array>
8384           <description>Tonemapping / contrast / gamma curve for the blue
8385           channel, to use when android.tonemap.mode is
8386           CONTRAST_CURVE.</description>
8387           <details>See android.tonemap.curveRed for more details.</details>
8388         </entry>
8389         <entry name="curveGreen" type="float" visibility="ndk_public"
8390         type_notes="1D array of float pairs (P_IN, P_OUT). The maximum number of pairs is specified by android.tonemap.maxCurvePoints."
8391         container="array" hwlevel="full">
8392           <array>
8393             <size>n</size>
8394             <size>2</size>
8395           </array>
8396           <description>Tonemapping / contrast / gamma curve for the green
8397           channel, to use when android.tonemap.mode is
8398           CONTRAST_CURVE.</description>
8399           <details>See android.tonemap.curveRed for more details.</details>
8400         </entry>
8401         <entry name="curveRed" type="float" visibility="ndk_public"
8402         type_notes="1D array of float pairs (P_IN, P_OUT). The maximum number of pairs is specified by android.tonemap.maxCurvePoints."
8403         container="array" hwlevel="full">
8404           <array>
8405             <size>n</size>
8406             <size>2</size>
8407           </array>
8408           <description>Tonemapping / contrast / gamma curve for the red
8409           channel, to use when android.tonemap.mode is
8410           CONTRAST_CURVE.</description>
8411           <range>0-1 on both input and output coordinates, normalized
8412           as a floating-point value such that 0 == black and 1 == white.
8413           </range>
8414           <details>
8415           Each channel's curve is defined by an array of control points:
8416
8417               android.tonemap.curveRed =
8418                 [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
8419               2 &lt;= N &lt;= android.tonemap.maxCurvePoints
8420
8421           These are sorted in order of increasing `Pin`; it is
8422           required that input values 0.0 and 1.0 are included in the list to
8423           define a complete mapping. For input values between control points,
8424           the camera device must linearly interpolate between the control
8425           points.
8426
8427           Each curve can have an independent number of points, and the number
8428           of points can be less than max (that is, the request doesn't have to
8429           always provide a curve with number of points equivalent to
8430           android.tonemap.maxCurvePoints).
8431
8432           A few examples, and their corresponding graphical mappings; these
8433           only specify the red channel and the precision is limited to 4
8434           digits, for conciseness.
8435
8436           Linear mapping:
8437
8438               android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
8439
8440           ![Linear mapping curve](android.tonemap.curveRed/linear_tonemap.png)
8441
8442           Invert mapping:
8443
8444               android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
8445
8446           ![Inverting mapping curve](android.tonemap.curveRed/inverse_tonemap.png)
8447
8448           Gamma 1/2.2 mapping, with 16 control points:
8449
8450               android.tonemap.curveRed = [
8451                 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
8452                 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
8453                 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
8454                 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
8455
8456           ![Gamma = 1/2.2 tonemapping curve](android.tonemap.curveRed/gamma_tonemap.png)
8457
8458           Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:
8459
8460               android.tonemap.curveRed = [
8461                 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
8462                 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
8463                 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
8464                 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
8465
8466           ![sRGB tonemapping curve](android.tonemap.curveRed/srgb_tonemap.png)
8467         </details>
8468         <hal_details>
8469           For good quality of mapping, at least 128 control points are
8470           preferred.
8471
8472           A typical use case of this would be a gamma-1/2.2 curve, with as many
8473           control points used as are available.
8474         </hal_details>
8475         </entry>
8476         <entry name="curve" type="float" visibility="java_public" synthetic="true"
8477                typedef="tonemapCurve"
8478                hwlevel="full">
8479           <description>Tonemapping / contrast / gamma curve to use when android.tonemap.mode
8480           is CONTRAST_CURVE.</description>
8481           <details>
8482           The tonemapCurve consist of three curves for each of red, green, and blue
8483           channels respectively. The following example uses the red channel as an
8484           example. The same logic applies to green and blue channel.
8485           Each channel's curve is defined by an array of control points:
8486
8487               curveRed =
8488                 [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
8489               2 &lt;= N &lt;= android.tonemap.maxCurvePoints
8490
8491           These are sorted in order of increasing `Pin`; it is always
8492           guaranteed that input values 0.0 and 1.0 are included in the list to
8493           define a complete mapping. For input values between control points,
8494           the camera device must linearly interpolate between the control
8495           points.
8496
8497           Each curve can have an independent number of points, and the number
8498           of points can be less than max (that is, the request doesn't have to
8499           always provide a curve with number of points equivalent to
8500           android.tonemap.maxCurvePoints).
8501
8502           A few examples, and their corresponding graphical mappings; these
8503           only specify the red channel and the precision is limited to 4
8504           digits, for conciseness.
8505
8506           Linear mapping:
8507
8508               curveRed = [ (0, 0), (1.0, 1.0) ]
8509
8510           ![Linear mapping curve](android.tonemap.curveRed/linear_tonemap.png)
8511
8512           Invert mapping:
8513
8514               curveRed = [ (0, 1.0), (1.0, 0) ]
8515
8516           ![Inverting mapping curve](android.tonemap.curveRed/inverse_tonemap.png)
8517
8518           Gamma 1/2.2 mapping, with 16 control points:
8519
8520               curveRed = [
8521                 (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
8522                 (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
8523                 (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
8524                 (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
8525
8526           ![Gamma = 1/2.2 tonemapping curve](android.tonemap.curveRed/gamma_tonemap.png)
8527
8528           Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:
8529
8530               curveRed = [
8531                 (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
8532                 (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
8533                 (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
8534                 (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
8535
8536           ![sRGB tonemapping curve](android.tonemap.curveRed/srgb_tonemap.png)
8537         </details>
8538         <hal_details>
8539             This entry is created by the framework from the curveRed, curveGreen and
8540             curveBlue entries.
8541         </hal_details>
8542         </entry>
8543         <entry name="mode" type="byte" visibility="public" enum="true"
8544                hwlevel="full">
8545           <enum>
8546             <value>CONTRAST_CURVE
8547               <notes>Use the tone mapping curve specified in
8548               the android.tonemap.curve* entries.
8549
8550               All color enhancement and tonemapping must be disabled, except
8551               for applying the tonemapping curve specified by
8552               android.tonemap.curve.
8553
8554               Must not slow down frame rate relative to raw
8555               sensor output.
8556               </notes>
8557             </value>
8558             <value>FAST
8559               <notes>
8560               Advanced gamma mapping and color enhancement may be applied, without
8561               reducing frame rate compared to raw sensor output.
8562               </notes>
8563             </value>
8564             <value>HIGH_QUALITY
8565               <notes>
8566               High-quality gamma mapping and color enhancement will be applied, at
8567               the cost of possibly reduced frame rate compared to raw sensor output.
8568               </notes>
8569             </value>
8570             <value>GAMMA_VALUE
8571               <notes>
8572               Use the gamma value specified in android.tonemap.gamma to peform
8573               tonemapping.
8574
8575               All color enhancement and tonemapping must be disabled, except
8576               for applying the tonemapping curve specified by android.tonemap.gamma.
8577
8578               Must not slow down frame rate relative to raw sensor output.
8579               </notes>
8580             </value>
8581             <value>PRESET_CURVE
8582               <notes>
8583               Use the preset tonemapping curve specified in
8584               android.tonemap.presetCurve to peform tonemapping.
8585
8586               All color enhancement and tonemapping must be disabled, except
8587               for applying the tonemapping curve specified by
8588               android.tonemap.presetCurve.
8589
8590               Must not slow down frame rate relative to raw sensor output.
8591               </notes>
8592             </value>
8593           </enum>
8594           <description>High-level global contrast/gamma/tonemapping control.
8595           </description>
8596           <range>android.tonemap.availableToneMapModes</range>
8597           <details>
8598           When switching to an application-defined contrast curve by setting
8599           android.tonemap.mode to CONTRAST_CURVE, the curve is defined
8600           per-channel with a set of `(in, out)` points that specify the
8601           mapping from input high-bit-depth pixel value to the output
8602           low-bit-depth value.  Since the actual pixel ranges of both input
8603           and output may change depending on the camera pipeline, the values
8604           are specified by normalized floating-point numbers.
8605
8606           More-complex color mapping operations such as 3D color look-up
8607           tables, selective chroma enhancement, or other non-linear color
8608           transforms will be disabled when android.tonemap.mode is
8609           CONTRAST_CURVE.
8610
8611           When using either FAST or HIGH_QUALITY, the camera device will
8612           emit its own tonemap curve in android.tonemap.curve.
8613           These values are always available, and as close as possible to the
8614           actually used nonlinear/nonglobal transforms.
8615
8616           If a request is sent with CONTRAST_CURVE with the camera device's
8617           provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
8618           roughly the same.</details>
8619         </entry>
8620       </controls>
8621       <static>
8622         <entry name="maxCurvePoints" type="int32" visibility="public"
8623                hwlevel="full">
8624           <description>Maximum number of supported points in the
8625             tonemap curve that can be used for android.tonemap.curve.
8626           </description>
8627           <details>
8628           If the actual number of points provided by the application (in android.tonemap.curve*) is
8629           less than this maximum, the camera device will resample the curve to its internal
8630           representation, using linear interpolation.
8631
8632           The output curves in the result metadata may have a different number
8633           of points than the input curves, and will represent the actual
8634           hardware curves used as closely as possible when linearly interpolated.
8635           </details>
8636           <hal_details>
8637           This value must be at least 64. This should be at least 128.
8638           </hal_details>
8639         </entry>
8640         <entry name="availableToneMapModes" type="byte" visibility="public"
8641         type_notes="list of enums" container="array" typedef="enumList" hwlevel="full">
8642           <array>
8643             <size>n</size>
8644           </array>
8645           <description>
8646           List of tonemapping modes for android.tonemap.mode that are supported by this camera
8647           device.
8648           </description>
8649           <range>Any value listed in android.tonemap.mode</range>
8650           <details>
8651           Camera devices that support the MANUAL_POST_PROCESSING capability will always contain
8652           at least one of below mode combinations:
8653
8654           * CONTRAST_CURVE, FAST and HIGH_QUALITY
8655           * GAMMA_VALUE, PRESET_CURVE, FAST and HIGH_QUALITY
8656
8657           This includes all FULL level devices.
8658           </details>
8659           <hal_details>
8660             HAL must support both FAST and HIGH_QUALITY if automatic tonemap control is available
8661             on the camera device, but the underlying implementation can be the same for both modes.
8662             That is, if the highest quality implementation on the camera device does not slow down
8663             capture rate, then FAST and HIGH_QUALITY will generate the same output.
8664           </hal_details>
8665         </entry>
8666       </static>
8667       <dynamic>
8668         <clone entry="android.tonemap.curveBlue" kind="controls">
8669         </clone>
8670         <clone entry="android.tonemap.curveGreen" kind="controls">
8671         </clone>
8672         <clone entry="android.tonemap.curveRed" kind="controls">
8673         </clone>
8674         <clone entry="android.tonemap.curve" kind="controls">
8675         </clone>
8676         <clone entry="android.tonemap.mode" kind="controls">
8677         </clone>
8678       </dynamic>
8679       <controls>
8680         <entry name="gamma" type="float" visibility="public">
8681           <description> Tonemapping curve to use when android.tonemap.mode is
8682           GAMMA_VALUE
8683           </description>
8684           <details>
8685           The tonemap curve will be defined the following formula:
8686           * OUT = pow(IN, 1.0 / gamma)
8687           where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
8688           pow is the power function and gamma is the gamma value specified by this
8689           key.
8690
8691           The same curve will be applied to all color channels. The camera device
8692           may clip the input gamma value to its supported range. The actual applied
8693           value will be returned in capture result.
8694
8695           The valid range of gamma value varies on different devices, but values
8696           within [1.0, 5.0] are guaranteed not to be clipped.
8697           </details>
8698         </entry>
8699         <entry name="presetCurve" type="byte" visibility="public" enum="true">
8700           <enum>
8701             <value>SRGB
8702               <notes>Tonemapping curve is defined by sRGB</notes>
8703             </value>
8704             <value>REC709
8705               <notes>Tonemapping curve is defined by ITU-R BT.709</notes>
8706             </value>
8707           </enum>
8708           <description> Tonemapping curve to use when android.tonemap.mode is
8709           PRESET_CURVE
8710           </description>
8711           <details>
8712           The tonemap curve will be defined by specified standard.
8713
8714           sRGB (approximated by 16 control points):
8715
8716           ![sRGB tonemapping curve](android.tonemap.curveRed/srgb_tonemap.png)
8717
8718           Rec. 709 (approximated by 16 control points):
8719
8720           ![Rec. 709 tonemapping curve](android.tonemap.curveRed/rec709_tonemap.png)
8721
8722           Note that above figures show a 16 control points approximation of preset
8723           curves. Camera devices may apply a different approximation to the curve.
8724           </details>
8725         </entry>
8726       </controls>
8727       <dynamic>
8728         <clone entry="android.tonemap.gamma" kind="controls">
8729         </clone>
8730         <clone entry="android.tonemap.presetCurve" kind="controls">
8731         </clone>
8732       </dynamic>
8733     </section>
8734     <section name="led">
8735       <controls>
8736         <entry name="transmit" type="byte" visibility="hidden" optional="true"
8737                enum="true" typedef="boolean">
8738           <enum>
8739             <value>OFF</value>
8740             <value>ON</value>
8741           </enum>
8742           <description>This LED is nominally used to indicate to the user
8743           that the camera is powered on and may be streaming images back to the
8744           Application Processor. In certain rare circumstances, the OS may
8745           disable this when video is processed locally and not transmitted to
8746           any untrusted applications.
8747
8748           In particular, the LED *must* always be on when the data could be
8749           transmitted off the device. The LED *should* always be on whenever
8750           data is stored locally on the device.
8751
8752           The LED *may* be off if a trusted application is using the data that
8753           doesn't violate the above rules.
8754           </description>
8755         </entry>
8756       </controls>
8757       <dynamic>
8758         <clone entry="android.led.transmit" kind="controls"></clone>
8759       </dynamic>
8760       <static>
8761         <entry name="availableLeds" type="byte" visibility="hidden" optional="true"
8762                enum="true"
8763                container="array">
8764           <array>
8765             <size>n</size>
8766           </array>
8767           <enum>
8768             <value>TRANSMIT
8769               <notes>android.led.transmit control is used.</notes>
8770             </value>
8771           </enum>
8772           <description>A list of camera LEDs that are available on this system.
8773           </description>
8774         </entry>
8775       </static>
8776     </section>
8777     <section name="info">
8778       <static>
8779         <entry name="supportedHardwareLevel" type="byte" visibility="public"
8780                enum="true" hwlevel="legacy">
8781           <enum>
8782             <value>
8783               LIMITED
8784               <notes>
8785               This camera device does not have enough capabilities to qualify as a `FULL` device or
8786               better.
8787
8788               Only the stream configurations listed in the `LEGACY` and `LIMITED` tables in the
8789               {@link android.hardware.camera2.CameraDevice#createCaptureSession|ACameraDevice_createCaptureSession
8790               createCaptureSession} documentation are guaranteed to be supported.
8791
8792               All `LIMITED` devices support the `BACKWARDS_COMPATIBLE` capability, indicating basic
8793               support for color image capture. The only exception is that the device may
8794               alternatively support only the `DEPTH_OUTPUT` capability, if it can only output depth
8795               measurements and not color images.
8796
8797               `LIMITED` devices and above require the use of android.control.aePrecaptureTrigger
8798               to lock exposure metering (and calculate flash power, for cameras with flash) before
8799               capturing a high-quality still image.
8800
8801               A `LIMITED` device that only lists the `BACKWARDS_COMPATIBLE` capability is only
8802               required to support full-automatic operation and post-processing (`OFF` is not
8803               supported for android.control.aeMode, android.control.afMode, or
8804               android.control.awbMode)
8805
8806               Additional capabilities may optionally be supported by a `LIMITED`-level device, and
8807               can be checked for in android.request.availableCapabilities.
8808               </notes>
8809             </value>
8810             <value>
8811               FULL
8812               <notes>
8813               This camera device is capable of supporting advanced imaging applications.
8814
8815               The stream configurations listed in the `FULL`, `LEGACY` and `LIMITED` tables in the
8816               {@link android.hardware.camera2.CameraDevice#createCaptureSession|ACameraDevice_createCaptureSession
8817               createCaptureSession} documentation are guaranteed to be supported.
8818
8819               A `FULL` device will support below capabilities:
8820
8821               * `BURST_CAPTURE` capability (android.request.availableCapabilities contains
8822                 `BURST_CAPTURE`)
8823               * Per frame control (android.sync.maxLatency `==` PER_FRAME_CONTROL)
8824               * Manual sensor control (android.request.availableCapabilities contains `MANUAL_SENSOR`)
8825               * Manual post-processing control (android.request.availableCapabilities contains
8826                 `MANUAL_POST_PROCESSING`)
8827               * The required exposure time range defined in android.sensor.info.exposureTimeRange
8828               * The required maxFrameDuration defined in android.sensor.info.maxFrameDuration
8829
8830               Note:
8831               Pre-API level 23, FULL devices also supported arbitrary cropping region
8832               (android.scaler.croppingType `== FREEFORM`); this requirement was relaxed in API level
8833               23, and `FULL` devices may only support `CENTERED` cropping.
8834               </notes>
8835             </value>
8836             <value>
8837               LEGACY
8838               <notes>
8839               This camera device is running in backward compatibility mode.
8840
8841               Only the stream configurations listed in the `LEGACY` table in the {@link
8842               android.hardware.camera2.CameraDevice#createCaptureSession|ACameraDevice_createCaptureSession
8843               createCaptureSession} documentation are supported.
8844
8845               A `LEGACY` device does not support per-frame control, manual sensor control, manual
8846               post-processing, arbitrary cropping regions, and has relaxed performance constraints.
8847               No additional capabilities beyond `BACKWARD_COMPATIBLE` will ever be listed by a
8848               `LEGACY` device in android.request.availableCapabilities.
8849
8850               In addition, the android.control.aePrecaptureTrigger is not functional on `LEGACY`
8851               devices. Instead, every request that includes a JPEG-format output target is treated
8852               as triggering a still capture, internally executing a precapture trigger.  This may
8853               fire the flash for flash power metering during precapture, and then fire the flash
8854               for the final capture, if a flash is available on the device and the AE mode is set to
8855               enable the flash.
8856               </notes>
8857             </value>
8858             <value>
8859               3
8860               <notes>
8861               This camera device is capable of YUV reprocessing and RAW data capture, in addition to
8862               FULL-level capabilities.
8863
8864               The stream configurations listed in the `LEVEL_3`, `RAW`, `FULL`, `LEGACY` and
8865               `LIMITED` tables in the {@link
8866               android.hardware.camera2.CameraDevice#createCaptureSession|ACameraDevice_createCaptureSession
8867               createCaptureSession} documentation are guaranteed to be supported.
8868
8869               The following additional capabilities are guaranteed to be supported:
8870
8871               * `YUV_REPROCESSING` capability (android.request.availableCapabilities contains
8872                 `YUV_REPROCESSING`)
8873               * `RAW` capability (android.request.availableCapabilities contains
8874                 `RAW`)
8875               </notes>
8876             </value>
8877             <value hal_version="3.3">
8878               EXTERNAL
8879               <notes>
8880               This camera device is backed by an external camera connected to this Android device.
8881
8882               The device has capability identical to a LIMITED level device, with the following
8883               exceptions:
8884
8885               * The device may not report lens/sensor related information such as
8886                   - android.lens.focalLength
8887                   - android.lens.info.hyperfocalDistance
8888                   - android.sensor.info.physicalSize
8889                   - android.sensor.info.whiteLevel
8890                   - android.sensor.blackLevelPattern
8891                   - android.sensor.info.colorFilterArrangement
8892                   - android.sensor.rollingShutterSkew
8893               * The device will report 0 for android.sensor.orientation
8894               * The device has less guarantee on stable framerate, as the framerate partly depends
8895                 on the external camera being used.
8896               </notes>
8897             </value>
8898           </enum>
8899           <description>
8900           Generally classifies the overall set of the camera device functionality.
8901           </description>
8902           <details>
8903           The supported hardware level is a high-level description of the camera device's
8904           capabilities, summarizing several capabilities into one field.  Each level adds additional
8905           features to the previous one, and is always a strict superset of the previous level.
8906           The ordering is `LEGACY &lt; LIMITED &lt; FULL &lt; LEVEL_3`.
8907
8908           Starting from `LEVEL_3`, the level enumerations are guaranteed to be in increasing
8909           numerical value as well. To check if a given device is at least at a given hardware level,
8910           the following code snippet can be used:
8911
8912               // Returns true if the device supports the required hardware level, or better.
8913               boolean isHardwareLevelSupported(CameraCharacteristics c, int requiredLevel) {
8914                   int deviceLevel = c.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
8915                   if (deviceLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY) {
8916                       return requiredLevel == deviceLevel;
8917                   }
8918                   // deviceLevel is not LEGACY, can use numerical sort
8919                   return requiredLevel &lt;= deviceLevel;
8920               }
8921
8922           At a high level, the levels are:
8923
8924           * `LEGACY` devices operate in a backwards-compatibility mode for older
8925             Android devices, and have very limited capabilities.
8926           * `LIMITED` devices represent the
8927             baseline feature set, and may also include additional capabilities that are
8928             subsets of `FULL`.
8929           * `FULL` devices additionally support per-frame manual control of sensor, flash, lens and
8930             post-processing settings, and image capture at a high rate.
8931           * `LEVEL_3` devices additionally support YUV reprocessing and RAW image capture, along
8932             with additional output stream configurations.
8933
8934           See the individual level enums for full descriptions of the supported capabilities.  The
8935           android.request.availableCapabilities entry describes the device's capabilities at a
8936           finer-grain level, if needed. In addition, many controls have their available settings or
8937           ranges defined in individual entries from {@link
8938           android.hardware.camera2.CameraCharacteristics|ACameraManager_getCameraCharacteristics}.
8939
8940           Some features are not part of any particular hardware level or capability and must be
8941           queried separately. These include:
8942
8943           * Calibrated timestamps (android.sensor.info.timestampSource `==` REALTIME)
8944           * Precision lens control (android.lens.info.focusDistanceCalibration `==` CALIBRATED)
8945           * Face detection (android.statistics.info.availableFaceDetectModes)
8946           * Optical or electrical image stabilization
8947             (android.lens.info.availableOpticalStabilization,
8948              android.control.availableVideoStabilizationModes)
8949
8950           </details>
8951           <hal_details>
8952           A camera HALv3 device can implement one of three possible operational modes; LIMITED,
8953           FULL, and LEVEL_3.
8954
8955           FULL support or better is expected from new higher-end devices. Limited
8956           mode has hardware requirements roughly in line with those for a camera HAL device v1
8957           implementation, and is expected from older or inexpensive devices. Each level is a strict
8958           superset of the previous level, and they share the same essential operational flow.
8959
8960           For full details refer to "S3. Operational Modes" in camera3.h
8961
8962           Camera HAL3+ must not implement LEGACY mode. It is there for backwards compatibility in
8963           the `android.hardware.camera2` user-facing API only on legacy HALv1 devices, and is
8964           implemented by the camera framework code.
8965
8966           EXTERNAL level devices have lower peformance bar in CTS since the peformance might depend
8967           on the external camera being used and is not fully controlled by the device manufacturer.
8968           The ITS test suite is exempted for the same reason.
8969           </hal_details>
8970         </entry>
8971         <entry name="version" type="byte" visibility="public" typedef="string" hal_version="3.3">
8972           <description>
8973               A short string for manufacturer version information about the camera device, such as
8974               ISP hardware, sensors, etc.
8975           </description>
8976           <details>
8977               This can be used in {@link android.media.ExifInterface#TAG_IMAGE_DESCRIPTION TAG_IMAGE_DESCRIPTION}
8978               in jpeg EXIF. This key may be absent if no version information is available on the
8979               device.
8980           </details>
8981           <hal_details>
8982               The string must consist of only alphanumeric characters, punctuation, and
8983               whitespace, i.e. it must match regular expression "[\p{Alnum}\p{Punct}\p{Space}]*".
8984               It must not exceed 256 characters.
8985           </hal_details>
8986         </entry>
8987       </static>
8988     </section>
8989     <section name="blackLevel">
8990       <controls>
8991         <entry name="lock" type="byte" visibility="public" enum="true"
8992                typedef="boolean" hwlevel="full">
8993           <enum>
8994             <value>OFF</value>
8995             <value>ON</value>
8996           </enum>
8997           <description> Whether black-level compensation is locked
8998           to its current values, or is free to vary.</description>
8999           <details>When set to `true` (ON), the values used for black-level
9000           compensation will not change until the lock is set to
9001           `false` (OFF).
9002
9003           Since changes to certain capture parameters (such as
9004           exposure time) may require resetting of black level
9005           compensation, the camera device must report whether setting
9006           the black level lock was successful in the output result
9007           metadata.
9008
9009           For example, if a sequence of requests is as follows:
9010
9011           * Request 1: Exposure = 10ms, Black level lock = OFF
9012           * Request 2: Exposure = 10ms, Black level lock = ON
9013           * Request 3: Exposure = 10ms, Black level lock = ON
9014           * Request 4: Exposure = 20ms, Black level lock = ON
9015           * Request 5: Exposure = 20ms, Black level lock = ON
9016           * Request 6: Exposure = 20ms, Black level lock = ON
9017
9018           And the exposure change in Request 4 requires the camera
9019           device to reset the black level offsets, then the output
9020           result metadata is expected to be:
9021
9022           * Result 1: Exposure = 10ms, Black level lock = OFF
9023           * Result 2: Exposure = 10ms, Black level lock = ON
9024           * Result 3: Exposure = 10ms, Black level lock = ON
9025           * Result 4: Exposure = 20ms, Black level lock = OFF
9026           * Result 5: Exposure = 20ms, Black level lock = ON
9027           * Result 6: Exposure = 20ms, Black level lock = ON
9028
9029           This indicates to the application that on frame 4, black
9030           levels were reset due to exposure value changes, and pixel
9031           values may not be consistent across captures.
9032
9033           The camera device will maintain the lock to the extent
9034           possible, only overriding the lock to OFF when changes to
9035           other request parameters require a black level recalculation
9036           or reset.
9037           </details>
9038           <hal_details>
9039           If for some reason black level locking is no longer possible
9040           (for example, the analog gain has changed, which forces
9041           black level offsets to be recalculated), then the HAL must
9042           override this request (and it must report 'OFF' when this
9043           does happen) until the next capture for which locking is
9044           possible again.</hal_details>
9045           <tag id="HAL2" />
9046         </entry>
9047       </controls>
9048       <dynamic>
9049         <clone entry="android.blackLevel.lock"
9050           kind="controls">
9051           <details>
9052             Whether the black level offset was locked for this frame.  Should be
9053             ON if android.blackLevel.lock was ON in the capture request, unless
9054             a change in other capture settings forced the camera device to
9055             perform a black level reset.
9056           </details>
9057         </clone>
9058       </dynamic>
9059     </section>
9060     <section name="sync">
9061       <dynamic>
9062         <entry name="frameNumber" type="int64" visibility="ndk_public"
9063                enum="true" hwlevel="legacy">
9064           <enum>
9065             <value id="-1">CONVERGING
9066               <notes>
9067               The current result is not yet fully synchronized to any request.
9068
9069               Synchronization is in progress, and reading metadata from this
9070               result may include a mix of data that have taken effect since the
9071               last synchronization time.
9072
9073               In some future result, within android.sync.maxLatency frames,
9074               this value will update to the actual frame number frame number
9075               the result is guaranteed to be synchronized to (as long as the
9076               request settings remain constant).
9077             </notes>
9078             </value>
9079             <value id="-2">UNKNOWN
9080               <notes>
9081               The current result's synchronization status is unknown.
9082
9083               The result may have already converged, or it may be in
9084               progress.  Reading from this result may include some mix
9085               of settings from past requests.
9086
9087               After a settings change, the new settings will eventually all
9088               take effect for the output buffers and results. However, this
9089               value will not change when that happens. Altering settings
9090               rapidly may provide outcomes using mixes of settings from recent
9091               requests.
9092
9093               This value is intended primarily for backwards compatibility with
9094               the older camera implementations (for android.hardware.Camera).
9095             </notes>
9096             </value>
9097           </enum>
9098           <description>The frame number corresponding to the last request
9099           with which the output result (metadata + buffers) has been fully
9100           synchronized.</description>
9101           <range>Either a non-negative value corresponding to a
9102           `frame_number`, or one of the two enums (CONVERGING / UNKNOWN).
9103           </range>
9104           <details>
9105           When a request is submitted to the camera device, there is usually a
9106           delay of several frames before the controls get applied. A camera
9107           device may either choose to account for this delay by implementing a
9108           pipeline and carefully submit well-timed atomic control updates, or
9109           it may start streaming control changes that span over several frame
9110           boundaries.
9111
9112           In the latter case, whenever a request's settings change relative to
9113           the previous submitted request, the full set of changes may take
9114           multiple frame durations to fully take effect. Some settings may
9115           take effect sooner (in less frame durations) than others.
9116
9117           While a set of control changes are being propagated, this value
9118           will be CONVERGING.
9119
9120           Once it is fully known that a set of control changes have been
9121           finished propagating, and the resulting updated control settings
9122           have been read back by the camera device, this value will be set
9123           to a non-negative frame number (corresponding to the request to
9124           which the results have synchronized to).
9125
9126           Older camera device implementations may not have a way to detect
9127           when all camera controls have been applied, and will always set this
9128           value to UNKNOWN.
9129
9130           FULL capability devices will always have this value set to the
9131           frame number of the request corresponding to this result.
9132
9133           _Further details_:
9134
9135           * Whenever a request differs from the last request, any future
9136           results not yet returned may have this value set to CONVERGING (this
9137           could include any in-progress captures not yet returned by the camera
9138           device, for more details see pipeline considerations below).
9139           * Submitting a series of multiple requests that differ from the
9140           previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
9141           moves the new synchronization frame to the last non-repeating
9142           request (using the smallest frame number from the contiguous list of
9143           repeating requests).
9144           * Submitting the same request repeatedly will not change this value
9145           to CONVERGING, if it was already a non-negative value.
9146           * When this value changes to non-negative, that means that all of the
9147           metadata controls from the request have been applied, all of the
9148           metadata controls from the camera device have been read to the
9149           updated values (into the result), and all of the graphics buffers
9150           corresponding to this result are also synchronized to the request.
9151
9152           _Pipeline considerations_:
9153
9154           Submitting a request with updated controls relative to the previously
9155           submitted requests may also invalidate the synchronization state
9156           of all the results corresponding to currently in-flight requests.
9157
9158           In other words, results for this current request and up to
9159           android.request.pipelineMaxDepth prior requests may have their
9160           android.sync.frameNumber change to CONVERGING.
9161           </details>
9162           <hal_details>
9163           Using UNKNOWN here is illegal unless android.sync.maxLatency
9164           is also UNKNOWN.
9165
9166           FULL capability devices should simply set this value to the
9167           `frame_number` of the request this result corresponds to.
9168           </hal_details>
9169           <tag id="V1" />
9170         </entry>
9171       </dynamic>
9172       <static>
9173         <entry name="maxLatency" type="int32" visibility="public" enum="true"
9174                hwlevel="legacy">
9175           <enum>
9176             <value id="0">PER_FRAME_CONTROL
9177               <notes>
9178               Every frame has the requests immediately applied.
9179
9180               Changing controls over multiple requests one after another will
9181               produce results that have those controls applied atomically
9182               each frame.
9183
9184               All FULL capability devices will have this as their maxLatency.
9185               </notes>
9186             </value>
9187             <value id="-1">UNKNOWN
9188               <notes>
9189               Each new frame has some subset (potentially the entire set)
9190               of the past requests applied to the camera settings.
9191
9192               By submitting a series of identical requests, the camera device
9193               will eventually have the camera settings applied, but it is
9194               unknown when that exact point will be.
9195
9196               All LEGACY capability devices will have this as their maxLatency.
9197               </notes>
9198             </value>
9199           </enum>
9200           <description>
9201           The maximum number of frames that can occur after a request
9202           (different than the previous) has been submitted, and before the
9203           result's state becomes synchronized.
9204           </description>
9205           <units>Frame counts</units>
9206           <range>A positive value, PER_FRAME_CONTROL, or UNKNOWN.</range>
9207           <details>
9208           This defines the maximum distance (in number of metadata results),
9209           between the frame number of the request that has new controls to apply
9210           and the frame number of the result that has all the controls applied.
9211
9212           In other words this acts as an upper boundary for how many frames
9213           must occur before the camera device knows for a fact that the new
9214           submitted camera settings have been applied in outgoing frames.
9215           </details>
9216           <hal_details>
9217           For example if maxLatency was 2,
9218
9219               initial request = X (repeating)
9220               request1 = X
9221               request2 = Y
9222               request3 = Y
9223               request4 = Y
9224
9225               where requestN has frameNumber N, and the first of the repeating
9226               initial request's has frameNumber F (and F &lt; 1).
9227
9228               initial result = X' + { android.sync.frameNumber == F }
9229               result1 = X' + { android.sync.frameNumber == F }
9230               result2 = X' + { android.sync.frameNumber == CONVERGING }
9231               result3 = X' + { android.sync.frameNumber == CONVERGING }
9232               result4 = X' + { android.sync.frameNumber == 2 }
9233
9234               where resultN has frameNumber N.
9235
9236           Since `result4` has a `frameNumber == 4` and
9237           `android.sync.frameNumber == 2`, the distance is clearly
9238           `4 - 2 = 2`.
9239
9240           Use `frame_count` from camera3_request_t instead of
9241           android.request.frameCount or
9242           `{@link android.hardware.camera2.CaptureResult#getFrameNumber}`.
9243
9244           LIMITED devices are strongly encouraged to use a non-negative
9245           value. If UNKNOWN is used here then app developers do not have a way
9246           to know when sensor settings have been applied.
9247           </hal_details>
9248           <tag id="V1" />
9249         </entry>
9250       </static>
9251     </section>
9252     <section name="reprocess">
9253       <controls>
9254         <entry name="effectiveExposureFactor" type="float" visibility="java_public" hwlevel="limited">
9255             <description>
9256             The amount of exposure time increase factor applied to the original output
9257             frame by the application processing before sending for reprocessing.
9258             </description>
9259             <units>Relative exposure time increase factor.</units>
9260             <range> &amp;gt;= 1.0</range>
9261             <details>
9262             This is optional, and will be supported if the camera device supports YUV_REPROCESSING
9263             capability (android.request.availableCapabilities contains YUV_REPROCESSING).
9264
9265             For some YUV reprocessing use cases, the application may choose to filter the original
9266             output frames to effectively reduce the noise to the same level as a frame that was
9267             captured with longer exposure time. To be more specific, assuming the original captured
9268             images were captured with a sensitivity of S and an exposure time of T, the model in
9269             the camera device is that the amount of noise in the image would be approximately what
9270             would be expected if the original capture parameters had been a sensitivity of
9271             S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
9272             than S and T respectively. If the captured images were processed by the application
9273             before being sent for reprocessing, then the application may have used image processing
9274             algorithms and/or multi-frame image fusion to reduce the noise in the
9275             application-processed images (input images). By using the effectiveExposureFactor
9276             control, the application can communicate to the camera device the actual noise level
9277             improvement in the application-processed image. With this information, the camera
9278             device can select appropriate noise reduction and edge enhancement parameters to avoid
9279             excessive noise reduction (android.noiseReduction.mode) and insufficient edge
9280             enhancement (android.edge.mode) being applied to the reprocessed frames.
9281
9282             For example, for multi-frame image fusion use case, the application may fuse
9283             multiple output frames together to a final frame for reprocessing. When N image are
9284             fused into 1 image for reprocessing, the exposure time increase factor could be up to
9285             square root of N (based on a simple photon shot noise model). The camera device will
9286             adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
9287             produce the best quality images.
9288
9289             This is relative factor, 1.0 indicates the application hasn't processed the input
9290             buffer in a way that affects its effective exposure time.
9291
9292             This control is only effective for YUV reprocessing capture request. For noise
9293             reduction reprocessing, it is only effective when `android.noiseReduction.mode != OFF`.
9294             Similarly, for edge enhancement reprocessing, it is only effective when
9295             `android.edge.mode != OFF`.
9296             </details>
9297           <tag id="REPROC" />
9298         </entry>
9299       </controls>
9300       <dynamic>
9301       <clone entry="android.reprocess.effectiveExposureFactor" kind="controls">
9302       </clone>
9303       </dynamic>
9304       <static>
9305         <entry name="maxCaptureStall" type="int32" visibility="java_public" hwlevel="limited">
9306           <description>
9307           The maximal camera capture pipeline stall (in unit of frame count) introduced by a
9308           reprocess capture request.
9309           </description>
9310           <units>Number of frames.</units>
9311           <range> &amp;lt;= 4</range>
9312           <details>
9313           The key describes the maximal interference that one reprocess (input) request
9314           can introduce to the camera simultaneous streaming of regular (output) capture
9315           requests, including repeating requests.
9316
9317           When a reprocessing capture request is submitted while a camera output repeating request
9318           (e.g. preview) is being served by the camera device, it may preempt the camera capture
9319           pipeline for at least one frame duration so that the camera device is unable to process
9320           the following capture request in time for the next sensor start of exposure boundary.
9321           When this happens, the application may observe a capture time gap (longer than one frame
9322           duration) between adjacent capture output frames, which usually exhibits as preview
9323           glitch if the repeating request output targets include a preview surface. This key gives
9324           the worst-case number of frame stall introduced by one reprocess request with any kind of
9325           formats/sizes combination.
9326
9327           If this key reports 0, it means a reprocess request doesn't introduce any glitch to the
9328           ongoing camera repeating request outputs, as if this reprocess request is never issued.
9329
9330           This key is supported if the camera device supports PRIVATE or YUV reprocessing (
9331           i.e. android.request.availableCapabilities contains PRIVATE_REPROCESSING or
9332           YUV_REPROCESSING).
9333           </details>
9334           <tag id="REPROC" />
9335         </entry>
9336       </static>
9337     </section>
9338     <section name="depth">
9339       <static>
9340         <entry name="maxDepthSamples" type="int32" visibility="system" hwlevel="limited">
9341           <description>Maximum number of points that a depth point cloud may contain.
9342           </description>
9343           <details>
9344             If a camera device supports outputting depth range data in the form of a depth point
9345             cloud ({@link android.graphics.ImageFormat#DEPTH_POINT_CLOUD}), this is the maximum
9346             number of points an output buffer may contain.
9347
9348             Any given buffer may contain between 0 and maxDepthSamples points, inclusive.
9349             If output in the depth point cloud format is not supported, this entry will
9350             not be defined.
9351           </details>
9352           <tag id="DEPTH" />
9353         </entry>
9354         <entry name="availableDepthStreamConfigurations" type="int32" visibility="ndk_public"
9355                enum="true" container="array" typedef="streamConfiguration" hwlevel="limited">
9356           <array>
9357             <size>n</size>
9358             <size>4</size>
9359           </array>
9360           <enum>
9361             <value>OUTPUT</value>
9362             <value>INPUT</value>
9363           </enum>
9364           <description>The available depth dataspace stream
9365           configurations that this camera device supports
9366           (i.e. format, width, height, output/input stream).
9367           </description>
9368           <details>
9369             These are output stream configurations for use with
9370             dataSpace HAL_DATASPACE_DEPTH. The configurations are
9371             listed as `(format, width, height, input?)` tuples.
9372
9373             Only devices that support depth output for at least
9374             the HAL_PIXEL_FORMAT_Y16 dense depth map may include
9375             this entry.
9376
9377             A device that also supports the HAL_PIXEL_FORMAT_BLOB
9378             sparse depth point cloud must report a single entry for
9379             the format in this list as `(HAL_PIXEL_FORMAT_BLOB,
9380             android.depth.maxDepthSamples, 1, OUTPUT)` in addition to
9381             the entries for HAL_PIXEL_FORMAT_Y16.
9382           </details>
9383           <tag id="DEPTH" />
9384         </entry>
9385         <entry name="availableDepthMinFrameDurations" type="int64" visibility="ndk_public"
9386                container="array" typedef="streamConfigurationDuration" hwlevel="limited">
9387           <array>
9388             <size>4</size>
9389             <size>n</size>
9390           </array>
9391           <description>This lists the minimum frame duration for each
9392           format/size combination for depth output formats.
9393           </description>
9394           <units>(format, width, height, ns) x n</units>
9395           <details>
9396           This should correspond to the frame duration when only that
9397           stream is active, with all processing (typically in android.*.mode)
9398           set to either OFF or FAST.
9399
9400           When multiple streams are used in a request, the minimum frame
9401           duration will be max(individual stream min durations).
9402
9403           The minimum frame duration of a stream (of a particular format, size)
9404           is the same regardless of whether the stream is input or output.
9405
9406           See android.sensor.frameDuration and
9407           android.scaler.availableStallDurations for more details about
9408           calculating the max frame rate.
9409           </details>
9410           <tag id="DEPTH" />
9411         </entry>
9412         <entry name="availableDepthStallDurations" type="int64" visibility="ndk_public"
9413                container="array" typedef="streamConfigurationDuration" hwlevel="limited">
9414           <array>
9415             <size>4</size>
9416             <size>n</size>
9417           </array>
9418           <description>This lists the maximum stall duration for each
9419           output format/size combination for depth streams.
9420           </description>
9421           <units>(format, width, height, ns) x n</units>
9422           <details>
9423           A stall duration is how much extra time would get added
9424           to the normal minimum frame duration for a repeating request
9425           that has streams with non-zero stall.
9426
9427           This functions similarly to
9428           android.scaler.availableStallDurations for depth
9429           streams.
9430
9431           All depth output stream formats may have a nonzero stall
9432           duration.
9433           </details>
9434           <tag id="DEPTH" />
9435         </entry>
9436         <entry name="depthIsExclusive" type="byte" visibility="public"
9437                enum="true" typedef="boolean" hwlevel="limited">
9438           <enum>
9439             <value>FALSE</value>
9440             <value>TRUE</value>
9441           </enum>
9442           <description>Indicates whether a capture request may target both a
9443           DEPTH16 / DEPTH_POINT_CLOUD output, and normal color outputs (such as
9444           YUV_420_888, JPEG, or RAW) simultaneously.
9445           </description>
9446           <details>
9447           If TRUE, including both depth and color outputs in a single
9448           capture request is not supported. An application must interleave color
9449           and depth requests.  If FALSE, a single request can target both types
9450           of output.
9451
9452           Typically, this restriction exists on camera devices that
9453           need to emit a specific pattern or wavelength of light to
9454           measure depth values, which causes the color image to be
9455           corrupted during depth measurement.
9456           </details>
9457         </entry>
9458       </static>
9459     </section>
9460     <section name="logicalMultiCamera">
9461       <static>
9462         <entry name="physicalIds" type="byte" visibility="hidden"
9463                container="array" hwlevel="limited" hal_version="3.3">
9464           <array>
9465             <size>n</size>
9466           </array>
9467           <description>String containing the ids of the underlying physical cameras.
9468           </description>
9469           <units>UTF-8 null-terminated string</units>
9470           <details>
9471             For a logical camera, this is concatenation of all underlying physical camera ids.
9472             The null terminator for physical camera id must be preserved so that the whole string
9473             can be tokenized using '\0' to generate list of physical camera ids.
9474
9475             For example, if the physical camera ids of the logical camera are "2" and "3", the
9476             value of this tag will be ['2', '\0', '3', '\0'].
9477
9478             The number of physical camera ids must be no less than 2.
9479           </details>
9480           <tag id="LOGICALCAMERA" />
9481         </entry>
9482         <entry name="sensorSyncType" type="byte" visibility="public"
9483                enum="true" hwlevel="limited" hal_version="3.3">
9484           <enum>
9485             <value>APPROXIMATE
9486               <notes>
9487               A software mechanism is used to synchronize between the physical cameras. As a result,
9488               the timestamp of an image from a physical stream is only an approximation of the
9489               image sensor start-of-exposure time.
9490               </notes>
9491             </value>
9492             <value>CALIBRATED
9493               <notes>
9494               The camera device supports frame timestamp synchronization at the hardware level,
9495               and the timestamp of a physical stream image accurately reflects its
9496               start-of-exposure time.
9497               </notes>
9498             </value>
9499           </enum>
9500           <description>The accuracy of frame timestamp synchronization between physical cameras</description>
9501           <details>
9502           The accuracy of the frame timestamp synchronization determines the physical cameras'
9503           ability to start exposure at the same time. If the sensorSyncType is CALIBRATED,
9504           the physical camera sensors usually run in master-slave mode so that their shutter
9505           time is synchronized. For APPROXIMATE sensorSyncType, the camera sensors usually run in
9506           master-master mode, and there could be offset between their start of exposure.
9507
9508           In both cases, all images generated for a particular capture request still carry the same
9509           timestamps, so that they can be used to look up the matching frame number and
9510           onCaptureStarted callback.
9511           </details>
9512           <tag id="LOGICALCAMERA" />
9513         </entry>
9514       </static>
9515     </section>
9516   </namespace>
9517 </metadata>