CameraMetadata.java revision f353742124af698098884b4172644af0851b30ca
1/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.camera2;
18
19import android.hardware.camera2.impl.CameraMetadataNative;
20
21import java.lang.reflect.Field;
22import java.lang.reflect.Modifier;
23import java.util.ArrayList;
24import java.util.Collections;
25import java.util.List;
26
27/**
28 * The base class for camera controls and information.
29 *
30 * <p>
31 * This class defines the basic key/value map used for querying for camera
32 * characteristics or capture results, and for setting camera request
33 * parameters.
34 * </p>
35 *
36 * <p>
37 * All instances of CameraMetadata are immutable. The list of keys with {@link #getKeys()}
38 * never changes, nor do the values returned by any key with {@link #get} throughout
39 * the lifetime of the object.
40 * </p>
41 *
42 * @see CameraDevice
43 * @see CameraManager
44 * @see CameraCharacteristics
45 **/
46public abstract class CameraMetadata {
47
48    /**
49     * Set a camera metadata field to a value. The field definitions can be
50     * found in {@link CameraCharacteristics}, {@link CaptureResult}, and
51     * {@link CaptureRequest}.
52     *
53     * @param key The metadata field to write.
54     * @param value The value to set the field to, which must be of a matching
55     * type to the key.
56     *
57     * @hide
58     */
59    protected CameraMetadata() {
60    }
61
62    /**
63     * Get a camera metadata field value.
64     *
65     * <p>The field definitions can be
66     * found in {@link CameraCharacteristics}, {@link CaptureResult}, and
67     * {@link CaptureRequest}.</p>
68     *
69     * <p>Querying the value for the same key more than once will return a value
70     * which is equal to the previous queried value.</p>
71     *
72     * @throws IllegalArgumentException if the key was not valid
73     *
74     * @param key The metadata field to read.
75     * @return The value of that key, or {@code null} if the field is not set.
76     */
77    public abstract <T> T get(Key<T> key);
78
79    /**
80     * Returns a list of the keys contained in this map.
81     *
82     * <p>The list returned is not modifiable, so any attempts to modify it will throw
83     * a {@code UnsupportedOperationException}.</p>
84     *
85     * <p>All values retrieved by a key from this list with {@link #get} are guaranteed to be
86     * non-{@code null}. Each key is only listed once in the list. The order of the keys
87     * is undefined.</p>
88     *
89     * @return List of the keys contained in this map.
90     */
91    public List<Key<?>> getKeys() {
92        return Collections.unmodifiableList(getKeysStatic(this.getClass(), this));
93    }
94
95    /**
96     * Return a list of all the Key<?> that are declared as a field inside of the class
97     * {@code type}.
98     *
99     * <p>
100     * Optionally, if {@code instance} is not null, then filter out any keys with null values.
101     * </p>
102     */
103    /*package*/ static ArrayList<Key<?>> getKeysStatic(Class<? extends CameraMetadata> type,
104            CameraMetadata instance) {
105        ArrayList<Key<?>> keyList = new ArrayList<Key<?>>();
106
107        Field[] fields = type.getDeclaredFields();
108        for (Field field : fields) {
109            // Filter for Keys that are public
110            if (field.getType().isAssignableFrom(Key.class) &&
111                    (field.getModifiers() & Modifier.PUBLIC) != 0) {
112                Key<?> key;
113                try {
114                    key = (Key<?>) field.get(instance);
115                } catch (IllegalAccessException e) {
116                    throw new AssertionError("Can't get IllegalAccessException", e);
117                } catch (IllegalArgumentException e) {
118                    throw new AssertionError("Can't get IllegalArgumentException", e);
119                }
120                if (instance == null || instance.get(key) != null) {
121                    keyList.add(key);
122                }
123            }
124        }
125
126        return keyList;
127    }
128
129    public static class Key<T> {
130
131        private boolean mHasTag;
132        private int mTag;
133        private final Class<T> mType;
134        private final String mName;
135
136        /**
137         * @hide
138         */
139        public Key(String name, Class<T> type) {
140            if (name == null) {
141                throw new NullPointerException("Key needs a valid name");
142            } else if (type == null) {
143                throw new NullPointerException("Type needs to be non-null");
144            }
145            mName = name;
146            mType = type;
147        }
148
149        public final String getName() {
150            return mName;
151        }
152
153        @Override
154        public final int hashCode() {
155            return mName.hashCode();
156        }
157
158        @Override
159        @SuppressWarnings("unchecked")
160        public final boolean equals(Object o) {
161            if (this == o) {
162                return true;
163            }
164
165            if (!(o instanceof Key)) {
166                return false;
167            }
168
169            Key lhs = (Key) o;
170
171            return mName.equals(lhs.mName) && mType.equals(lhs.mType);
172        }
173
174        /**
175         * <p>
176         * Get the tag corresponding to this key. This enables insertion into the
177         * native metadata.
178         * </p>
179         *
180         * <p>This value is looked up the first time, and cached subsequently.</p>
181         *
182         * @return The tag numeric value corresponding to the string
183         *
184         * @hide
185         */
186        public final int getTag() {
187            if (!mHasTag) {
188                mTag = CameraMetadataNative.getTag(mName);
189                mHasTag = true;
190            }
191            return mTag;
192        }
193
194        /**
195         * @hide
196         */
197        public final Class<T> getType() {
198            return mType;
199        }
200    }
201
202    /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
203     * The enum values below this point are generated from metadata
204     * definitions in /system/media/camera/docs. Do not modify by hand or
205     * modify the comment blocks at the start or end.
206     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
207
208    //
209    // Enumeration values for CameraCharacteristics#LENS_FACING
210    //
211
212    /**
213     * @see CameraCharacteristics#LENS_FACING
214     */
215    public static final int LENS_FACING_FRONT = 0;
216
217    /**
218     * @see CameraCharacteristics#LENS_FACING
219     */
220    public static final int LENS_FACING_BACK = 1;
221
222    //
223    // Enumeration values for CameraCharacteristics#LED_AVAILABLE_LEDS
224    //
225
226    /**
227     * <p>android.led.transmit control is used</p>
228     * @see CameraCharacteristics#LED_AVAILABLE_LEDS
229     * @hide
230     */
231    public static final int LED_AVAILABLE_LEDS_TRANSMIT = 0;
232
233    //
234    // Enumeration values for CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
235    //
236
237    /**
238     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
239     */
240    public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0;
241
242    /**
243     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
244     */
245    public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1;
246
247    //
248    // Enumeration values for CaptureRequest#COLOR_CORRECTION_MODE
249    //
250
251    /**
252     * <p>Use the android.colorCorrection.transform matrix
253     * and android.colorCorrection.gains to do color conversion</p>
254     * @see CaptureRequest#COLOR_CORRECTION_MODE
255     */
256    public static final int COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0;
257
258    /**
259     * <p>Must not slow down frame rate relative to raw
260     * bayer output</p>
261     * @see CaptureRequest#COLOR_CORRECTION_MODE
262     */
263    public static final int COLOR_CORRECTION_MODE_FAST = 1;
264
265    /**
266     * <p>Frame rate may be reduced by high
267     * quality</p>
268     * @see CaptureRequest#COLOR_CORRECTION_MODE
269     */
270    public static final int COLOR_CORRECTION_MODE_HIGH_QUALITY = 2;
271
272    //
273    // Enumeration values for CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
274    //
275
276    /**
277     * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
278     */
279    public static final int CONTROL_AE_ANTIBANDING_MODE_OFF = 0;
280
281    /**
282     * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
283     */
284    public static final int CONTROL_AE_ANTIBANDING_MODE_50HZ = 1;
285
286    /**
287     * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
288     */
289    public static final int CONTROL_AE_ANTIBANDING_MODE_60HZ = 2;
290
291    /**
292     * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
293     */
294    public static final int CONTROL_AE_ANTIBANDING_MODE_AUTO = 3;
295
296    //
297    // Enumeration values for CaptureRequest#CONTROL_AE_MODE
298    //
299
300    /**
301     * <p>Autoexposure is disabled; sensor.exposureTime,
302     * sensor.sensitivity and sensor.frameDuration are used</p>
303     * @see CaptureRequest#CONTROL_AE_MODE
304     */
305    public static final int CONTROL_AE_MODE_OFF = 0;
306
307    /**
308     * <p>Autoexposure is active, no flash
309     * control</p>
310     * @see CaptureRequest#CONTROL_AE_MODE
311     */
312    public static final int CONTROL_AE_MODE_ON = 1;
313
314    /**
315     * <p>If autoexposure is active and flash exists, auto
316     * flash control; flash may be fired when precapture
317     * trigger is activated, and for captures for which
318     * captureIntent = STILL_CAPTURE</p>
319     * @see CaptureRequest#CONTROL_AE_MODE
320     */
321    public static final int CONTROL_AE_MODE_ON_AUTO_FLASH = 2;
322
323    /**
324     * <p>If autoexposure is active and flash exists, auto
325     * flash control for precapture trigger and always flash
326     * when captureIntent = STILL_CAPTURE</p>
327     * @see CaptureRequest#CONTROL_AE_MODE
328     */
329    public static final int CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3;
330
331    /**
332     * <p>Optional. Automatic red eye reduction with flash.
333     * If deemed necessary, red eye reduction sequence should
334     * fire when precapture trigger is activated, and final
335     * flash should fire when captureIntent =
336     * STILL_CAPTURE</p>
337     * @see CaptureRequest#CONTROL_AE_MODE
338     */
339    public static final int CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE = 4;
340
341    //
342    // Enumeration values for CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
343    //
344
345    /**
346     * <p>The trigger is idle.</p>
347     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
348     */
349    public static final int CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0;
350
351    /**
352     * <p>The precapture metering sequence
353     * must be started. The exact effect of the precapture
354     * trigger depends on the current AE mode and
355     * state.</p>
356     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
357     */
358    public static final int CONTROL_AE_PRECAPTURE_TRIGGER_START = 1;
359
360    //
361    // Enumeration values for CaptureRequest#CONTROL_AF_MODE
362    //
363
364    /**
365     * <p>The auto-focus routine does not control the lens;
366     * android.lens.focusDistance is controlled by the
367     * application</p>
368     * @see CaptureRequest#CONTROL_AF_MODE
369     */
370    public static final int CONTROL_AF_MODE_OFF = 0;
371
372    /**
373     * <p>If lens is not fixed focus.</p>
374     * <p>Use android.lens.info.minimumFocusDistance to determine if lens
375     * is fixed-focus. In this mode, the lens does not move unless
376     * the autofocus trigger action is called. When that trigger
377     * is activated, AF must transition to ACTIVE_SCAN, then to
378     * the outcome of the scan (FOCUSED or NOT_FOCUSED).</p>
379     * <p>Triggering AF_CANCEL resets the lens position to default,
380     * and sets the AF state to INACTIVE.</p>
381     * @see CaptureRequest#CONTROL_AF_MODE
382     */
383    public static final int CONTROL_AF_MODE_AUTO = 1;
384
385    /**
386     * <p>In this mode, the lens does not move unless the
387     * autofocus trigger action is called.</p>
388     * <p>When that trigger is activated, AF must transition to
389     * ACTIVE_SCAN, then to the outcome of the scan (FOCUSED or
390     * NOT_FOCUSED).  Triggering cancel AF resets the lens
391     * position to default, and sets the AF state to
392     * INACTIVE.</p>
393     * @see CaptureRequest#CONTROL_AF_MODE
394     */
395    public static final int CONTROL_AF_MODE_MACRO = 2;
396
397    /**
398     * <p>In this mode, the AF algorithm modifies the lens
399     * position continually to attempt to provide a
400     * constantly-in-focus image stream.</p>
401     * <p>The focusing behavior should be suitable for good quality
402     * video recording; typically this means slower focus
403     * movement and no overshoots. When the AF trigger is not
404     * involved, the AF algorithm should start in INACTIVE state,
405     * and then transition into PASSIVE_SCAN and PASSIVE_FOCUSED
406     * states as appropriate. When the AF trigger is activated,
407     * the algorithm should immediately transition into
408     * AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the
409     * lens position until a cancel AF trigger is received.</p>
410     * <p>Once cancel is received, the algorithm should transition
411     * back to INACTIVE and resume passive scan. Note that this
412     * behavior is not identical to CONTINUOUS_PICTURE, since an
413     * ongoing PASSIVE_SCAN must immediately be
414     * canceled.</p>
415     * @see CaptureRequest#CONTROL_AF_MODE
416     */
417    public static final int CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3;
418
419    /**
420     * <p>In this mode, the AF algorithm modifies the lens
421     * position continually to attempt to provide a
422     * constantly-in-focus image stream.</p>
423     * <p>The focusing behavior should be suitable for still image
424     * capture; typically this means focusing as fast as
425     * possible. When the AF trigger is not involved, the AF
426     * algorithm should start in INACTIVE state, and then
427     * transition into PASSIVE_SCAN and PASSIVE_FOCUSED states as
428     * appropriate as it attempts to maintain focus. When the AF
429     * trigger is activated, the algorithm should finish its
430     * PASSIVE_SCAN if active, and then transition into
431     * AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the
432     * lens position until a cancel AF trigger is received.</p>
433     * <p>When the AF cancel trigger is activated, the algorithm
434     * should transition back to INACTIVE and then act as if it
435     * has just been started.</p>
436     * @see CaptureRequest#CONTROL_AF_MODE
437     */
438    public static final int CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4;
439
440    /**
441     * <p>Extended depth of field (digital focus). AF
442     * trigger is ignored, AF state should always be
443     * INACTIVE.</p>
444     * @see CaptureRequest#CONTROL_AF_MODE
445     */
446    public static final int CONTROL_AF_MODE_EDOF = 5;
447
448    //
449    // Enumeration values for CaptureRequest#CONTROL_AF_TRIGGER
450    //
451
452    /**
453     * <p>The trigger is idle.</p>
454     * @see CaptureRequest#CONTROL_AF_TRIGGER
455     */
456    public static final int CONTROL_AF_TRIGGER_IDLE = 0;
457
458    /**
459     * <p>Autofocus must trigger now.</p>
460     * @see CaptureRequest#CONTROL_AF_TRIGGER
461     */
462    public static final int CONTROL_AF_TRIGGER_START = 1;
463
464    /**
465     * <p>Autofocus must return to initial
466     * state, and cancel any active trigger.</p>
467     * @see CaptureRequest#CONTROL_AF_TRIGGER
468     */
469    public static final int CONTROL_AF_TRIGGER_CANCEL = 2;
470
471    //
472    // Enumeration values for CaptureRequest#CONTROL_AWB_MODE
473    //
474
475    /**
476     * @see CaptureRequest#CONTROL_AWB_MODE
477     */
478    public static final int CONTROL_AWB_MODE_OFF = 0;
479
480    /**
481     * @see CaptureRequest#CONTROL_AWB_MODE
482     */
483    public static final int CONTROL_AWB_MODE_AUTO = 1;
484
485    /**
486     * @see CaptureRequest#CONTROL_AWB_MODE
487     */
488    public static final int CONTROL_AWB_MODE_INCANDESCENT = 2;
489
490    /**
491     * @see CaptureRequest#CONTROL_AWB_MODE
492     */
493    public static final int CONTROL_AWB_MODE_FLUORESCENT = 3;
494
495    /**
496     * @see CaptureRequest#CONTROL_AWB_MODE
497     */
498    public static final int CONTROL_AWB_MODE_WARM_FLUORESCENT = 4;
499
500    /**
501     * @see CaptureRequest#CONTROL_AWB_MODE
502     */
503    public static final int CONTROL_AWB_MODE_DAYLIGHT = 5;
504
505    /**
506     * @see CaptureRequest#CONTROL_AWB_MODE
507     */
508    public static final int CONTROL_AWB_MODE_CLOUDY_DAYLIGHT = 6;
509
510    /**
511     * @see CaptureRequest#CONTROL_AWB_MODE
512     */
513    public static final int CONTROL_AWB_MODE_TWILIGHT = 7;
514
515    /**
516     * @see CaptureRequest#CONTROL_AWB_MODE
517     */
518    public static final int CONTROL_AWB_MODE_SHADE = 8;
519
520    //
521    // Enumeration values for CaptureRequest#CONTROL_CAPTURE_INTENT
522    //
523
524    /**
525     * <p>This request doesn't fall into the other
526     * categories. Default to preview-like
527     * behavior.</p>
528     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
529     */
530    public static final int CONTROL_CAPTURE_INTENT_CUSTOM = 0;
531
532    /**
533     * <p>This request is for a preview-like usecase. The
534     * precapture trigger may be used to start off a metering
535     * w/flash sequence</p>
536     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
537     */
538    public static final int CONTROL_CAPTURE_INTENT_PREVIEW = 1;
539
540    /**
541     * <p>This request is for a still capture-type
542     * usecase.</p>
543     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
544     */
545    public static final int CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2;
546
547    /**
548     * <p>This request is for a video recording
549     * usecase.</p>
550     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
551     */
552    public static final int CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3;
553
554    /**
555     * <p>This request is for a video snapshot (still
556     * image while recording video) usecase</p>
557     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
558     */
559    public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4;
560
561    /**
562     * <p>This request is for a ZSL usecase; the
563     * application will stream full-resolution images and
564     * reprocess one or several later for a final
565     * capture</p>
566     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
567     */
568    public static final int CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG = 5;
569
570    //
571    // Enumeration values for CaptureRequest#CONTROL_EFFECT_MODE
572    //
573
574    /**
575     * @see CaptureRequest#CONTROL_EFFECT_MODE
576     */
577    public static final int CONTROL_EFFECT_MODE_OFF = 0;
578
579    /**
580     * @see CaptureRequest#CONTROL_EFFECT_MODE
581     */
582    public static final int CONTROL_EFFECT_MODE_MONO = 1;
583
584    /**
585     * @see CaptureRequest#CONTROL_EFFECT_MODE
586     */
587    public static final int CONTROL_EFFECT_MODE_NEGATIVE = 2;
588
589    /**
590     * @see CaptureRequest#CONTROL_EFFECT_MODE
591     */
592    public static final int CONTROL_EFFECT_MODE_SOLARIZE = 3;
593
594    /**
595     * @see CaptureRequest#CONTROL_EFFECT_MODE
596     */
597    public static final int CONTROL_EFFECT_MODE_SEPIA = 4;
598
599    /**
600     * @see CaptureRequest#CONTROL_EFFECT_MODE
601     */
602    public static final int CONTROL_EFFECT_MODE_POSTERIZE = 5;
603
604    /**
605     * @see CaptureRequest#CONTROL_EFFECT_MODE
606     */
607    public static final int CONTROL_EFFECT_MODE_WHITEBOARD = 6;
608
609    /**
610     * @see CaptureRequest#CONTROL_EFFECT_MODE
611     */
612    public static final int CONTROL_EFFECT_MODE_BLACKBOARD = 7;
613
614    /**
615     * @see CaptureRequest#CONTROL_EFFECT_MODE
616     */
617    public static final int CONTROL_EFFECT_MODE_AQUA = 8;
618
619    //
620    // Enumeration values for CaptureRequest#CONTROL_MODE
621    //
622
623    /**
624     * <p>Full application control of pipeline. All 3A
625     * routines are disabled, no other settings in
626     * android.control.* have any effect</p>
627     * @see CaptureRequest#CONTROL_MODE
628     */
629    public static final int CONTROL_MODE_OFF = 0;
630
631    /**
632     * <p>Use settings for each individual 3A routine.
633     * Manual control of capture parameters is disabled. All
634     * controls in android.control.* besides sceneMode take
635     * effect</p>
636     * @see CaptureRequest#CONTROL_MODE
637     */
638    public static final int CONTROL_MODE_AUTO = 1;
639
640    /**
641     * <p>Use specific scene mode. Enabling this disables
642     * control.aeMode, control.awbMode and control.afMode
643     * controls; the HAL must ignore those settings while
644     * USE_SCENE_MODE is active (except for FACE_PRIORITY
645     * scene mode). Other control entries are still active.
646     * This setting can only be used if availableSceneModes !=
647     * UNSUPPORTED</p>
648     * @see CaptureRequest#CONTROL_MODE
649     */
650    public static final int CONTROL_MODE_USE_SCENE_MODE = 2;
651
652    //
653    // Enumeration values for CaptureRequest#CONTROL_SCENE_MODE
654    //
655
656    /**
657     * @see CaptureRequest#CONTROL_SCENE_MODE
658     */
659    public static final int CONTROL_SCENE_MODE_UNSUPPORTED = 0;
660
661    /**
662     * <p>if face detection support exists Use face
663     * detection data to drive 3A routines. If face detection
664     * statistics are disabled, should still operate correctly
665     * (but not return face detection statistics to the
666     * framework).</p>
667     * <p>Unlike the other scene modes, aeMode, awbMode, and afMode
668     * remain active when FACE_PRIORITY is set. This is due to
669     * compatibility concerns with the old camera
670     * API</p>
671     * @see CaptureRequest#CONTROL_SCENE_MODE
672     */
673    public static final int CONTROL_SCENE_MODE_FACE_PRIORITY = 1;
674
675    /**
676     * @see CaptureRequest#CONTROL_SCENE_MODE
677     */
678    public static final int CONTROL_SCENE_MODE_ACTION = 2;
679
680    /**
681     * @see CaptureRequest#CONTROL_SCENE_MODE
682     */
683    public static final int CONTROL_SCENE_MODE_PORTRAIT = 3;
684
685    /**
686     * @see CaptureRequest#CONTROL_SCENE_MODE
687     */
688    public static final int CONTROL_SCENE_MODE_LANDSCAPE = 4;
689
690    /**
691     * @see CaptureRequest#CONTROL_SCENE_MODE
692     */
693    public static final int CONTROL_SCENE_MODE_NIGHT = 5;
694
695    /**
696     * @see CaptureRequest#CONTROL_SCENE_MODE
697     */
698    public static final int CONTROL_SCENE_MODE_NIGHT_PORTRAIT = 6;
699
700    /**
701     * @see CaptureRequest#CONTROL_SCENE_MODE
702     */
703    public static final int CONTROL_SCENE_MODE_THEATRE = 7;
704
705    /**
706     * @see CaptureRequest#CONTROL_SCENE_MODE
707     */
708    public static final int CONTROL_SCENE_MODE_BEACH = 8;
709
710    /**
711     * @see CaptureRequest#CONTROL_SCENE_MODE
712     */
713    public static final int CONTROL_SCENE_MODE_SNOW = 9;
714
715    /**
716     * @see CaptureRequest#CONTROL_SCENE_MODE
717     */
718    public static final int CONTROL_SCENE_MODE_SUNSET = 10;
719
720    /**
721     * @see CaptureRequest#CONTROL_SCENE_MODE
722     */
723    public static final int CONTROL_SCENE_MODE_STEADYPHOTO = 11;
724
725    /**
726     * @see CaptureRequest#CONTROL_SCENE_MODE
727     */
728    public static final int CONTROL_SCENE_MODE_FIREWORKS = 12;
729
730    /**
731     * @see CaptureRequest#CONTROL_SCENE_MODE
732     */
733    public static final int CONTROL_SCENE_MODE_SPORTS = 13;
734
735    /**
736     * @see CaptureRequest#CONTROL_SCENE_MODE
737     */
738    public static final int CONTROL_SCENE_MODE_PARTY = 14;
739
740    /**
741     * @see CaptureRequest#CONTROL_SCENE_MODE
742     */
743    public static final int CONTROL_SCENE_MODE_CANDLELIGHT = 15;
744
745    /**
746     * @see CaptureRequest#CONTROL_SCENE_MODE
747     */
748    public static final int CONTROL_SCENE_MODE_BARCODE = 16;
749
750    //
751    // Enumeration values for CaptureRequest#EDGE_MODE
752    //
753
754    /**
755     * <p>No edge enhancement is applied</p>
756     * @see CaptureRequest#EDGE_MODE
757     */
758    public static final int EDGE_MODE_OFF = 0;
759
760    /**
761     * <p>Must not slow down frame rate relative to raw
762     * bayer output</p>
763     * @see CaptureRequest#EDGE_MODE
764     */
765    public static final int EDGE_MODE_FAST = 1;
766
767    /**
768     * <p>Frame rate may be reduced by high
769     * quality</p>
770     * @see CaptureRequest#EDGE_MODE
771     */
772    public static final int EDGE_MODE_HIGH_QUALITY = 2;
773
774    //
775    // Enumeration values for CaptureRequest#FLASH_MODE
776    //
777
778    /**
779     * <p>Do not fire the flash for this
780     * capture</p>
781     * @see CaptureRequest#FLASH_MODE
782     */
783    public static final int FLASH_MODE_OFF = 0;
784
785    /**
786     * <p>if android.flash.available is true Fire flash
787     * for this capture based on firingPower,
788     * firingTime.</p>
789     * @see CaptureRequest#FLASH_MODE
790     */
791    public static final int FLASH_MODE_SINGLE = 1;
792
793    /**
794     * <p>if android.flash.available is true Flash
795     * continuously on, power set by
796     * firingPower</p>
797     * @see CaptureRequest#FLASH_MODE
798     */
799    public static final int FLASH_MODE_TORCH = 2;
800
801    //
802    // Enumeration values for CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
803    //
804
805    /**
806     * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
807     */
808    public static final int LENS_OPTICAL_STABILIZATION_MODE_OFF = 0;
809
810    /**
811     * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
812     */
813    public static final int LENS_OPTICAL_STABILIZATION_MODE_ON = 1;
814
815    //
816    // Enumeration values for CaptureRequest#NOISE_REDUCTION_MODE
817    //
818
819    /**
820     * <p>No noise reduction is applied</p>
821     * @see CaptureRequest#NOISE_REDUCTION_MODE
822     */
823    public static final int NOISE_REDUCTION_MODE_OFF = 0;
824
825    /**
826     * <p>Must not slow down frame rate relative to raw
827     * bayer output</p>
828     * @see CaptureRequest#NOISE_REDUCTION_MODE
829     */
830    public static final int NOISE_REDUCTION_MODE_FAST = 1;
831
832    /**
833     * <p>May slow down frame rate to provide highest
834     * quality</p>
835     * @see CaptureRequest#NOISE_REDUCTION_MODE
836     */
837    public static final int NOISE_REDUCTION_MODE_HIGH_QUALITY = 2;
838
839    //
840    // Enumeration values for CaptureRequest#STATISTICS_FACE_DETECT_MODE
841    //
842
843    /**
844     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
845     */
846    public static final int STATISTICS_FACE_DETECT_MODE_OFF = 0;
847
848    /**
849     * <p>Optional Return rectangle and confidence
850     * only</p>
851     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
852     */
853    public static final int STATISTICS_FACE_DETECT_MODE_SIMPLE = 1;
854
855    /**
856     * <p>Optional Return all face
857     * metadata</p>
858     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
859     */
860    public static final int STATISTICS_FACE_DETECT_MODE_FULL = 2;
861
862    //
863    // Enumeration values for CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
864    //
865
866    /**
867     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
868     */
869    public static final int STATISTICS_LENS_SHADING_MAP_MODE_OFF = 0;
870
871    /**
872     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
873     */
874    public static final int STATISTICS_LENS_SHADING_MAP_MODE_ON = 1;
875
876    //
877    // Enumeration values for CaptureRequest#TONEMAP_MODE
878    //
879
880    /**
881     * <p>Use the tone mapping curve specified in
882     * android.tonemap.curve</p>
883     * @see CaptureRequest#TONEMAP_MODE
884     */
885    public static final int TONEMAP_MODE_CONTRAST_CURVE = 0;
886
887    /**
888     * <p>Must not slow down frame rate relative to raw
889     * bayer output</p>
890     * @see CaptureRequest#TONEMAP_MODE
891     */
892    public static final int TONEMAP_MODE_FAST = 1;
893
894    /**
895     * <p>Frame rate may be reduced by high
896     * quality</p>
897     * @see CaptureRequest#TONEMAP_MODE
898     */
899    public static final int TONEMAP_MODE_HIGH_QUALITY = 2;
900
901    //
902    // Enumeration values for CaptureResult#CONTROL_AE_STATE
903    //
904
905    /**
906     * <p>AE is off.  When a camera device is opened, it starts in
907     * this state.</p>
908     * @see CaptureResult#CONTROL_AE_STATE
909     */
910    public static final int CONTROL_AE_STATE_INACTIVE = 0;
911
912    /**
913     * <p>AE doesn't yet have a good set of control values
914     * for the current scene</p>
915     * @see CaptureResult#CONTROL_AE_STATE
916     */
917    public static final int CONTROL_AE_STATE_SEARCHING = 1;
918
919    /**
920     * <p>AE has a good set of control values for the
921     * current scene</p>
922     * @see CaptureResult#CONTROL_AE_STATE
923     */
924    public static final int CONTROL_AE_STATE_CONVERGED = 2;
925
926    /**
927     * <p>AE has been locked (aeMode =
928     * LOCKED)</p>
929     * @see CaptureResult#CONTROL_AE_STATE
930     */
931    public static final int CONTROL_AE_STATE_LOCKED = 3;
932
933    /**
934     * <p>AE has a good set of control values, but flash
935     * needs to be fired for good quality still
936     * capture</p>
937     * @see CaptureResult#CONTROL_AE_STATE
938     */
939    public static final int CONTROL_AE_STATE_FLASH_REQUIRED = 4;
940
941    /**
942     * <p>AE has been asked to do a precapture sequence
943     * (through the
944     * trigger_action(CAMERA2_TRIGGER_PRECAPTURE_METERING)
945     * call), and is currently executing it. Once PRECAPTURE
946     * completes, AE will transition to CONVERGED or
947     * FLASH_REQUIRED as appropriate</p>
948     * @see CaptureResult#CONTROL_AE_STATE
949     */
950    public static final int CONTROL_AE_STATE_PRECAPTURE = 5;
951
952    //
953    // Enumeration values for CaptureResult#CONTROL_AF_STATE
954    //
955
956    /**
957     * <p>AF off or has not yet tried to scan/been asked
958     * to scan.  When a camera device is opened, it starts in
959     * this state.</p>
960     * @see CaptureResult#CONTROL_AF_STATE
961     */
962    public static final int CONTROL_AF_STATE_INACTIVE = 0;
963
964    /**
965     * <p>if CONTINUOUS_* modes are supported. AF is
966     * currently doing an AF scan initiated by a continuous
967     * autofocus mode</p>
968     * @see CaptureResult#CONTROL_AF_STATE
969     */
970    public static final int CONTROL_AF_STATE_PASSIVE_SCAN = 1;
971
972    /**
973     * <p>if CONTINUOUS_* modes are supported. AF currently
974     * believes it is in focus, but may restart scanning at
975     * any time.</p>
976     * @see CaptureResult#CONTROL_AF_STATE
977     */
978    public static final int CONTROL_AF_STATE_PASSIVE_FOCUSED = 2;
979
980    /**
981     * <p>if AUTO or MACRO modes are supported. AF is doing
982     * an AF scan because it was triggered by AF
983     * trigger</p>
984     * @see CaptureResult#CONTROL_AF_STATE
985     */
986    public static final int CONTROL_AF_STATE_ACTIVE_SCAN = 3;
987
988    /**
989     * <p>if any AF mode besides OFF is supported. AF
990     * believes it is focused correctly and is
991     * locked</p>
992     * @see CaptureResult#CONTROL_AF_STATE
993     */
994    public static final int CONTROL_AF_STATE_FOCUSED_LOCKED = 4;
995
996    /**
997     * <p>if any AF mode besides OFF is supported. AF has
998     * failed to focus successfully and is
999     * locked</p>
1000     * @see CaptureResult#CONTROL_AF_STATE
1001     */
1002    public static final int CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5;
1003
1004    /**
1005     * <p>if CONTINUOUS_* modes are supported. AF finished a
1006     * passive scan without finding focus, and may restart
1007     * scanning at any time.</p>
1008     * @see CaptureResult#CONTROL_AF_STATE
1009     */
1010    public static final int CONTROL_AF_STATE_PASSIVE_UNFOCUSED = 6;
1011
1012    //
1013    // Enumeration values for CaptureResult#CONTROL_AWB_STATE
1014    //
1015
1016    /**
1017     * <p>AWB is not in auto mode.  When a camera device is opened, it
1018     * starts in this state.</p>
1019     * @see CaptureResult#CONTROL_AWB_STATE
1020     */
1021    public static final int CONTROL_AWB_STATE_INACTIVE = 0;
1022
1023    /**
1024     * <p>AWB doesn't yet have a good set of control
1025     * values for the current scene</p>
1026     * @see CaptureResult#CONTROL_AWB_STATE
1027     */
1028    public static final int CONTROL_AWB_STATE_SEARCHING = 1;
1029
1030    /**
1031     * <p>AWB has a good set of control values for the
1032     * current scene</p>
1033     * @see CaptureResult#CONTROL_AWB_STATE
1034     */
1035    public static final int CONTROL_AWB_STATE_CONVERGED = 2;
1036
1037    /**
1038     * <p>AE has been locked (aeMode =
1039     * LOCKED)</p>
1040     * @see CaptureResult#CONTROL_AWB_STATE
1041     */
1042    public static final int CONTROL_AWB_STATE_LOCKED = 3;
1043
1044    //
1045    // Enumeration values for CaptureResult#FLASH_STATE
1046    //
1047
1048    /**
1049     * <p>No flash on camera</p>
1050     * @see CaptureResult#FLASH_STATE
1051     */
1052    public static final int FLASH_STATE_UNAVAILABLE = 0;
1053
1054    /**
1055     * <p>if android.flash.available is true Flash is
1056     * charging and cannot be fired</p>
1057     * @see CaptureResult#FLASH_STATE
1058     */
1059    public static final int FLASH_STATE_CHARGING = 1;
1060
1061    /**
1062     * <p>if android.flash.available is true Flash is
1063     * ready to fire</p>
1064     * @see CaptureResult#FLASH_STATE
1065     */
1066    public static final int FLASH_STATE_READY = 2;
1067
1068    /**
1069     * <p>if android.flash.available is true Flash fired
1070     * for this capture</p>
1071     * @see CaptureResult#FLASH_STATE
1072     */
1073    public static final int FLASH_STATE_FIRED = 3;
1074
1075    //
1076    // Enumeration values for CaptureResult#LENS_STATE
1077    //
1078
1079    /**
1080     * @see CaptureResult#LENS_STATE
1081     */
1082    public static final int LENS_STATE_STATIONARY = 0;
1083
1084    /**
1085     * @see CaptureResult#LENS_STATE
1086     */
1087    public static final int LENS_STATE_MOVING = 1;
1088
1089    //
1090    // Enumeration values for CaptureResult#STATISTICS_SCENE_FLICKER
1091    //
1092
1093    /**
1094     * @see CaptureResult#STATISTICS_SCENE_FLICKER
1095     */
1096    public static final int STATISTICS_SCENE_FLICKER_NONE = 0;
1097
1098    /**
1099     * @see CaptureResult#STATISTICS_SCENE_FLICKER
1100     */
1101    public static final int STATISTICS_SCENE_FLICKER_50HZ = 1;
1102
1103    /**
1104     * @see CaptureResult#STATISTICS_SCENE_FLICKER
1105     */
1106    public static final int STATISTICS_SCENE_FLICKER_60HZ = 2;
1107
1108    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
1109     * End generated code
1110     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
1111
1112}
1113