Home | History | Annotate | Download | only in system
      1 /*
      2  * Copyright (C) 2012 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 /**
     18  * !! Do not include this file directly !!
     19  *
     20  * Include camera_metadata.h instead.
     21  */
     22 
     23 /**
     24  * Top level hierarchy definitions for camera metadata. *_INFO sections are for
     25  * the static metadata that can be retrived without opening the camera device.
     26  * New sections must be added right before ANDROID_SECTION_COUNT to maintain
     27  * existing enumerations.
     28  */
     29 enum {
     30     ANDROID_REQUEST = 0,
     31     ANDROID_LENS,
     32     ANDROID_LENS_INFO,
     33     ANDROID_SENSOR,
     34     ANDROID_SENSOR_INFO,
     35     ANDROID_FLASH,
     36     ANDROID_FLASH_INFO,
     37     ANDROID_HOT_PIXEL,
     38     ANDROID_HOT_PIXEL_INFO,
     39     ANDROID_DEMOSAIC,
     40     ANDROID_DEMOSAIC_INFO,
     41     ANDROID_NOISE,
     42     ANDROID_NOISE_INFO,
     43     ANDROID_SHADING,
     44     ANDROID_SHADING_INFO,
     45     ANDROID_GEOMETRIC,
     46     ANDROID_GEOMETRIC_INFO,
     47     ANDROID_COLOR,
     48     ANDROID_COLOR_INFO,
     49     ANDROID_TONEMAP,
     50     ANDROID_TONEMAP_INFO,
     51     ANDROID_EDGE,
     52     ANDROID_EDGE_INFO,
     53     ANDROID_SCALER,
     54     ANDROID_SCALER_INFO,
     55     ANDROID_JPEG,
     56     ANDROID_JPEG_INFO,
     57     ANDROID_STATS,
     58     ANDROID_STATS_INFO,
     59     ANDROID_CONTROL,
     60     ANDROID_CONTROL_INFO,
     61     ANDROID_SECTION_COUNT,
     62 
     63     VENDOR_SECTION = 0x8000
     64 };
     65 
     66 /**
     67  * Hierarchy positions in enum space. All vendor extension tags must be
     68  * defined with tag >= VENDOR_SECTION_START
     69  */
     70 enum {
     71     ANDROID_REQUEST_START         = ANDROID_REQUEST        << 16,
     72     ANDROID_LENS_START            = ANDROID_LENS           << 16,
     73     ANDROID_LENS_INFO_START       = ANDROID_LENS_INFO      << 16,
     74     ANDROID_SENSOR_START          = ANDROID_SENSOR         << 16,
     75     ANDROID_SENSOR_INFO_START     = ANDROID_SENSOR_INFO    << 16,
     76     ANDROID_FLASH_START           = ANDROID_FLASH          << 16,
     77     ANDROID_FLASH_INFO_START      = ANDROID_FLASH_INFO     << 16,
     78     ANDROID_HOT_PIXEL_START       = ANDROID_HOT_PIXEL      << 16,
     79     ANDROID_HOT_PIXEL_INFO_START  = ANDROID_HOT_PIXEL_INFO << 16,
     80     ANDROID_DEMOSAIC_START        = ANDROID_DEMOSAIC       << 16,
     81     ANDROID_DEMOSAIC_INFO_START   = ANDROID_DEMOSAIC_INFO  << 16,
     82     ANDROID_NOISE_START           = ANDROID_NOISE          << 16,
     83     ANDROID_NOISE_INFO_START      = ANDROID_NOISE_INFO     << 16,
     84     ANDROID_SHADING_START         = ANDROID_SHADING        << 16,
     85     ANDROID_SHADING_INFO_START    = ANDROID_SHADING_INFO   << 16,
     86     ANDROID_GEOMETRIC_START       = ANDROID_GEOMETRIC      << 16,
     87     ANDROID_GEOMETRIC_INFO_START  = ANDROID_GEOMETRIC_INFO << 16,
     88     ANDROID_COLOR_START           = ANDROID_COLOR          << 16,
     89     ANDROID_COLOR_INFO_START      = ANDROID_COLOR_INFO     << 16,
     90     ANDROID_TONEMAP_START         = ANDROID_TONEMAP        << 16,
     91     ANDROID_TONEMAP_INFO_START    = ANDROID_TONEMAP_INFO   << 16,
     92     ANDROID_EDGE_START            = ANDROID_EDGE           << 16,
     93     ANDROID_EDGE_INFO_START       = ANDROID_EDGE_INFO      << 16,
     94     ANDROID_SCALER_START          = ANDROID_SCALER         << 16,
     95     ANDROID_SCALER_INFO_START     = ANDROID_SCALER_INFO    << 16,
     96     ANDROID_JPEG_START            = ANDROID_JPEG           << 16,
     97     ANDROID_JPEG_INFO_START       = ANDROID_JPEG_INFO      << 16,
     98     ANDROID_STATS_START           = ANDROID_STATS          << 16,
     99     ANDROID_STATS_INFO_START      = ANDROID_STATS_INFO     << 16,
    100     ANDROID_CONTROL_START         = ANDROID_CONTROL        << 16,
    101     ANDROID_CONTROL_INFO_START    = ANDROID_CONTROL_INFO   << 16,
    102     VENDOR_SECTION_START          = VENDOR_SECTION         << 16
    103 };
    104 
    105 /**
    106  * Main enum for defining camera metadata tags.  New entries must always go
    107  * before the section _END tag to preserve existing enumeration values.  In
    108  * addition, the name and type of the tag needs to be added to
    109  * system/media/camera/src/camera_metadata_tag_info.c
    110  */
    111 enum {
    112     ANDROID_REQUEST_ID = ANDROID_REQUEST_START,
    113     ANDROID_REQUEST_METADATA_MODE,
    114     ANDROID_REQUEST_OUTPUT_STREAMS,
    115     ANDROID_REQUEST_FRAME_COUNT,
    116     ANDROID_REQUEST_END,
    117 
    118     ANDROID_LENS_FOCUS_DISTANCE = ANDROID_LENS_START,
    119     ANDROID_LENS_APERTURE,
    120     ANDROID_LENS_FOCAL_LENGTH,
    121     ANDROID_LENS_FILTER_DENSITY,
    122     ANDROID_LENS_OPTICAL_STABILIZATION_MODE,
    123     ANDROID_LENS_FOCUS_RANGE,
    124     ANDROID_LENS_END,
    125 
    126     ANDROID_LENS_MINIMUM_FOCUS_DISTANCE = ANDROID_LENS_INFO_START,
    127     ANDROID_LENS_AVAILABLE_FOCAL_LENGTHS,
    128     ANDROID_LENS_AVAILABLE_APERTURES,
    129     ANDROID_LENS_AVAILABLE_FILTER_DENSITY,
    130     ANDROID_LENS_AVAILABLE_OPTICAL_STABILIZATION,
    131     ANDROID_LENS_SHADING_MAP,
    132     ANDROID_LENS_GEOMETRIC_CORRECTION_MAP,
    133     ANDROID_LENS_FACING,
    134     ANDROID_LENS_POSITION,
    135     ANDROID_LENS_INFO_END,
    136 
    137     ANDROID_SENSOR_EXPOSURE_TIME = ANDROID_SENSOR_START,
    138     ANDROID_SENSOR_FRAME_DURATION,
    139     ANDROID_SENSOR_SENSITIVITY,
    140     ANDROID_SENSOR_TIMESTAMP,
    141     ANDROID_SENSOR_END,
    142 
    143     ANDROID_SENSOR_EXPOSURE_TIME_RANGE = ANDROID_SENSOR_INFO_START,
    144     ANDROID_SENSOR_MAX_FRAME_DURATION,
    145     ANDROID_SENSOR_AVAILABLE_SENSITIVITIES,
    146     ANDROID_SENSOR_COLOR_FILTER_ARRANGEMENT,
    147     ANDROID_SENSOR_PIXEL_ARRAY_SIZE,
    148     ANDROID_SENSOR_ACTIVE_ARRAY_SIZE,
    149     ANDROID_SENSOR_WHITE_LEVEL,
    150     ANDROID_SENSOR_BLACK_LEVEL_PATTERN,
    151     ANDROID_SENSOR_COLOR_TRANSFORM_1,
    152     ANDROID_SENSOR_COLOR_TRANSFORM_2,
    153     ANDROID_SENSOR_REFERENCE_ILLUMINANT_1,
    154     ANDROID_SENSOR_REFERENCE_ILLUMINANT_2,
    155     ANDROID_SENSOR_FORWARD_MATRIX_1,
    156     ANDROID_SENSOR_FORWARD_MATRIX_2,
    157     ANDROID_SENSOR_CALIBRATION_TRANSFORM_1,
    158     ANDROID_SENSOR_CALIBRATION_TRANSFORM_2,
    159     ANDROID_SENSOR_BASE_GAIN_FACTOR,
    160     ANDROID_SENSOR_MAX_ANALOG_SENSITIVITY,
    161     ANDROID_SENSOR_NOISE_MODEL_COEFFICIENTS,
    162     ANDROID_SENSOR_ORIENTATION,
    163     ANDROID_SENSOR_INFO_END,
    164 
    165     ANDROID_FLASH_MODE = ANDROID_FLASH_START,
    166     ANDROID_FLASH_FIRING_POWER,
    167     ANDROID_FLASH_FIRING_TIME,
    168     ANDROID_FLASH_END,
    169 
    170     ANDROID_FLASH_AVAILABLE_MODES = ANDROID_FLASH_INFO_START,
    171     ANDROID_FLASH_CHARGE_DURATION,
    172     ANDROID_FLASH_INFO_END,
    173 
    174     ANDROID_HOT_PIXEL_MODE = ANDROID_HOT_PIXEL_START,
    175     ANDROID_HOT_PIXEL_END,
    176 
    177     ANDROID_HOT_PIXEL_INFO_END = ANDROID_HOT_PIXEL_INFO_START,
    178 
    179     ANDROID_DEMOSAIC_MODE = ANDROID_DEMOSAIC_START,
    180     ANDROID_DEMOSAIC_END,
    181 
    182     ANDROID_DEMOSAIC_INFO_END = ANDROID_DEMOSAIC_INFO_START,
    183 
    184     ANDROID_NOISE_MODE = ANDROID_NOISE_START,
    185     ANDROID_NOISE_STRENGTH,
    186     ANDROID_NOISE_END,
    187 
    188     ANDROID_NOISE_INFO_END = ANDROID_NOISE_INFO_START,
    189 
    190     ANDROID_SHADING_MODE  = ANDROID_SHADING_START,
    191     ANDROID_SHADING_END,
    192 
    193     ANDROID_SHADING_INFO_END = ANDROID_SHADING_INFO_START,
    194 
    195     ANDROID_GEOMETRIC_MODE  = ANDROID_GEOMETRIC_START,
    196     ANDROID_GEOMETRIC_END,
    197 
    198     ANDROID_GEOMETRIC_INFO_END = ANDROID_GEOMETRIC_INFO_START,
    199 
    200     ANDROID_COLOR_MODE = ANDROID_COLOR_START,
    201     ANDROID_COLOR_TRANSFORM,
    202     ANDROID_COLOR_END,
    203 
    204     ANDROID_COLOR_AVAILABLE_MODES = ANDROID_COLOR_INFO_START,
    205     ANDROID_COLOR_INFO_END,
    206 
    207     ANDROID_TONEMAP_MODE = ANDROID_TONEMAP_START,
    208     ANDROID_TONEMAP_CURVE_RED,
    209     ANDROID_TONEMAP_CURVE_GREEN,
    210     ANDROID_TONEMAP_CURVE_BLUE,
    211     ANDROID_TONEMAP_END,
    212 
    213     ANDROID_TONEMAP_MAX_CURVE_POINTS = ANDROID_TONEMAP_INFO_START,
    214     ANDROID_TONEMAP_INFO_END,
    215 
    216     ANDROID_EDGE_MODE = ANDROID_EDGE_START,
    217     ANDROID_EDGE_STRENGTH,
    218     ANDROID_EDGE_END,
    219 
    220     ANDROID_EDGE_INFO_END = ANDROID_EDGE_INFO_START,
    221 
    222     ANDROID_SCALER_SIZE = ANDROID_SCALER_START,
    223     ANDROID_SCALER_FORMAT,
    224     ANDROID_SCALER_CROP_REGION,
    225     ANDROID_SCALER_ROTATION,
    226     ANDROID_SCALER_END,
    227 
    228     ANDROID_SCALER_AVAILABLE_FORMATS = ANDROID_SCALER_INFO_START,
    229     ANDROID_SCALER_AVAILABLE_SIZES_PER_FORMAT,
    230     ANDROID_SCALER_AVAILABLE_SIZES,
    231     ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,
    232     ANDROID_SCALER_AVAILABLE_MAX_ZOOM,
    233     ANDROID_SCALER_INFO_END,
    234 
    235     ANDROID_JPEG_QUALITY = ANDROID_JPEG_START,
    236     ANDROID_JPEG_THUMBNAIL_SIZE,
    237     ANDROID_JPEG_THUMBNAIL_QUALITY,
    238     ANDROID_JPEG_GPS_COORDINATES,
    239     ANDROID_JPEG_GPS_PROCESSING_METHOD,
    240     ANDROID_JPEG_GPS_TIMESTAMP,
    241     ANDROID_JPEG_ORIENTATION,
    242     ANDROID_JPEG_END,
    243 
    244     ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES  = ANDROID_JPEG_INFO_START,
    245     ANDROID_JPEG_INFO_END,
    246 
    247     ANDROID_STATS_FACE_DETECT_MODE = ANDROID_STATS_START,
    248     ANDROID_STATS_FACE_RECTANGLES,
    249     ANDROID_STATS_FACE_SCORES,
    250     ANDROID_STATS_FACE_LANDMARKS,
    251     ANDROID_STATS_FACE_IDS,
    252     ANDROID_STATS_HISTOGRAM_MODE,
    253     ANDROID_STATS_HISTOGRAM,
    254     ANDROID_STATS_SHARPNESS_MAP_MODE,
    255     ANDROID_STATS_SHARPNESS_MAP,
    256     ANDROID_STATS_END,
    257 
    258     ANDROID_STATS_AVAILABLE_FACE_DETECT_MODES = ANDROID_STATS_INFO_START,
    259     ANDROID_STATS_MAX_FACE_COUNT,
    260     ANDROID_STATS_HISTOGRAM_BUCKET_COUNT,
    261     ANDROID_STATS_MAX_HISTOGRAM_COUNT,
    262     ANDROID_STATS_SHARPNESS_MAP_SIZE,
    263     ANDROID_STATS_MAX_SHARPNESS_MAP_VALUE,
    264     ANDROID_STATS_INFO_END,
    265 
    266     ANDROID_CONTROL_MODE = ANDROID_CONTROL_START,
    267     ANDROID_CONTROL_AE_MODE,
    268     ANDROID_CONTROL_AE_REGIONS,
    269     ANDROID_CONTROL_AE_EXP_COMPENSATION,
    270     ANDROID_CONTROL_AE_TARGET_FPS_RANGE,
    271     ANDROID_CONTROL_AE_ANTIBANDING_MODE,
    272     ANDROID_CONTROL_AWB_MODE,
    273     ANDROID_CONTROL_AWB_REGIONS,
    274     ANDROID_CONTROL_AF_MODE,
    275     ANDROID_CONTROL_AF_REGIONS,
    276     ANDROID_CONTROL_AF_TRIGGER,
    277     ANDROID_CONTROL_AF_STATE,
    278     ANDROID_CONTROL_VIDEO_STABILIZATION_MODE,
    279     ANDROID_CONTROL_END,
    280 
    281     ANDROID_CONTROL_AVAILABLE_MODES = ANDROID_CONTROL_INFO_START,
    282     ANDROID_CONTROL_MAX_REGIONS,
    283     ANDROID_CONTROL_AE_AVAILABLE_MODES,
    284     ANDROID_CONTROL_AE_EXP_COMPENSATION_STEP,
    285     ANDROID_CONTROL_AE_EXP_COMPENSATION_RANGE,
    286     ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,
    287     ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES,
    288     ANDROID_CONTROL_AWB_AVAILABLE_MODES,
    289     ANDROID_CONTROL_AF_AVAILABLE_MODES,
    290     ANDROID_CONTROL_INFO_END
    291 };
    292 
    293 /**
    294  * Enumeration definitions for the various entries that need them
    295  */
    296 
    297 // ANDROID_REQUEST_METADATA_MODE
    298 enum {
    299     ANDROID_REQUEST_METADATA_NONE = 0,
    300     ANDROID_REQUEST_METADATA_FULL
    301 };
    302 
    303 // ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
    304 enum {
    305     ANDROID_SENSOR_RGGB = 0,
    306     ANDROID_SENSOR_GRBG,
    307     ANDROID_SENSOR_GBRG,
    308     ANDROID_SENSOR_BGGR,
    309     ANDROID_SENSOR_RGB
    310 };
    311 
    312 // ANDROID_SCALER_AVAILABLE_FORMATS uses HAL_PIXEL_FORMAT_* from
    313 // system/graphics.h
    314