Home | History | Annotate | Download | only in HAL3
      1 /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
      2 *
      3 * Redistribution and use in source and binary forms, with or without
      4 * modification, are permitted provided that the following conditions are
      5 * met:
      6 *     * Redistributions of source code must retain the above copyright
      7 *       notice, this list of conditions and the following disclaimer.
      8 *     * Redistributions in binary form must reproduce the above
      9 *       copyright notice, this list of conditions and the following
     10 *       disclaimer in the documentation and/or other materials provided
     11 *       with the distribution.
     12 *     * Neither the name of The Linux Foundation nor the names of its
     13 *       contributors may be used to endorse or promote products derived
     14 *       from this software without specific prior written permission.
     15 *
     16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
     17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
     19 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
     20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
     23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
     26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27 *
     28 */
     29 
     30 #define LOG_TAG "QCamera3VendorTags"
     31 
     32 // Camera dependencies
     33 #include "QCamera3HWI.h"
     34 #include "QCamera3VendorTags.h"
     35 
     36 extern "C" {
     37 #include "mm_camera_dbg.h"
     38 }
     39 
     40 using namespace android;
     41 
     42 namespace qcamera {
     43 
     44 enum qcamera3_ext_tags qcamera3_ext3_section_bounds[QCAMERA3_SECTIONS_END -
     45     VENDOR_SECTION] = {
     46         QCAMERA3_PRIVATEDATA_END,
     47         QCAMERA3_CDS_END,
     48         QCAMERA3_OPAQUE_RAW_END,
     49         QCAMERA3_CROP_END,
     50         QCAMERA3_TUNING_META_DATA_END,
     51         QCAMERA3_TEMPORAL_DENOISE_END,
     52         QCAMERA3_ISO_EXP_PRIORITY_END,
     53         QCAMERA3_SATURATION_END,
     54         QCAMERA3_EXPOSURE_METER_END,
     55         QCAMERA3_AV_TIMER_END,
     56         QCAMERA3_SENSOR_META_DATA_END,
     57         QCAMERA3_DUALCAM_LINK_META_DATA_END,
     58         QCAMERA3_DUALCAM_CALIB_META_DATA_END,
     59         QCAMERA3_HAL_PRIVATEDATA_END,
     60         QCAMERA3_JPEG_ENCODE_CROP_END,
     61         QCAMERA3_VIDEO_HDR_END,
     62         QCAMERA3_IR_END,
     63         QCAMERA3_AEC_CONVERGENCE_SPEED_END,
     64         QCAMERA3_AWB_CONVERGENCE_SPEED_END,
     65         QCAMERA3_INSTANT_AEC_END,
     66         NEXUS_EXPERIMENTAL_2016_END,
     67         QCAMERA3_SHARPNESS_END,
     68         QCAMERA3_HISTOGRAM_END,
     69         QCAMERA3_BINNING_CORRECTION_END,
     70         QCAMERA3_STATS_END,
     71         NEXUS_EXPERIMENTAL_2017_END,
     72 };
     73 
     74 enum qcamera3_ext_tags tango_section_bounds[TANGO_SECTIONS_END -
     75     TANGO_SECTIONS_START] = {
     76         TANGO_MODE_DATA_END,
     77 };
     78 
     79 typedef struct vendor_tag_info {
     80     const char *tag_name;
     81     uint8_t     tag_type;
     82 } vendor_tag_info_t;
     83 
     84 const char *qcamera3_ext_section_names[QCAMERA3_SECTIONS_END -
     85         VENDOR_SECTION] = {
     86     "org.codeaurora.qcamera3.privatedata",
     87     "org.codeaurora.qcamera3.CDS",
     88     "org.codeaurora.qcamera3.opaque_raw",
     89     "org.codeaurora.qcamera3.crop",
     90     "org.codeaurora.qcamera3.tuning_meta_data",
     91     "org.codeaurora.qcamera3.temporal_denoise",
     92     "org.codeaurora.qcamera3.iso_exp_priority",
     93     "org.codeaurora.qcamera3.saturation",
     94     "org.codeaurora.qcamera3.exposure_metering",
     95     "org.codeaurora.qcamera3.av_timer",
     96     "org.codeaurora.qcamera3.sensor_meta_data",
     97     "org.codeaurora.qcamera3.dualcam_link_meta_data",
     98     "org.codeaurora.qcamera3.dualcam_calib_meta_data",
     99     "org.codeaurora.qcamera3.hal_private_data",
    100     "org.codeaurora.qcamera3.jpeg_encode_crop",
    101     "org.codeaurora.qcamera3.video_hdr_mode",
    102     "org.codeaurora.qcamera3.ir",
    103     "org.codeaurora.qcamera3.aec_convergence_speed",
    104     "org.codeaurora.qcamera3.awb_convergence_speed",
    105     "org.codeaurora.qcamera3.instant_aec",
    106     "com.google.nexus.experimental2016",
    107     "org.codeaurora.qcamera3.sharpness",
    108     "org.codeaurora.qcamera3.histogram",
    109     "org.codeaurora.qcamera3.binning_correction",
    110     "org.codeaurora.qcamera3.stats",
    111     "com.google.nexus.experimental2017",
    112 };
    113 
    114 const char *tango_section_names[TANGO_SECTIONS_END -
    115       TANGO_SECTIONS_START] = {
    116     "com.google.tango"
    117 };
    118 
    119 vendor_tag_info_t qcamera3_privatedata[QCAMERA3_PRIVATEDATA_END - QCAMERA3_PRIVATEDATA_START] = {
    120     { "privatedata_reprocess", TYPE_INT32 }
    121 };
    122 
    123 vendor_tag_info_t qcamera3_cds[QCAMERA3_CDS_END - QCAMERA3_CDS_START] = {
    124     { "cds_mode", TYPE_INT32 },
    125     { "cds_info", TYPE_BYTE }
    126 };
    127 
    128 vendor_tag_info_t qcamera3_opaque_raw[QCAMERA3_OPAQUE_RAW_END -
    129         QCAMERA3_OPAQUE_RAW_START] = {
    130     { "opaque_raw_strides", TYPE_INT32 },
    131     { "opaque_raw_format", TYPE_BYTE }
    132 };
    133 
    134 vendor_tag_info_t qcamera3_crop[QCAMERA3_CROP_END- QCAMERA3_CROP_START] = {
    135     { "count", TYPE_INT32 },
    136     { "data", TYPE_INT32},
    137     { "roimap", TYPE_INT32 }
    138 };
    139 
    140 vendor_tag_info_t qcamera3_tuning_meta_data[QCAMERA3_TUNING_META_DATA_END -
    141         QCAMERA3_TUNING_META_DATA_START] = {
    142     { "tuning_meta_data_blob", TYPE_INT32 }
    143 };
    144 
    145 vendor_tag_info_t qcamera3_temporal_denoise[QCAMERA3_TEMPORAL_DENOISE_END -
    146         QCAMERA3_TEMPORAL_DENOISE_START] = {
    147     { "enable", TYPE_BYTE },
    148     { "process_type", TYPE_INT32 }
    149 };
    150 
    151 vendor_tag_info qcamera3_iso_exp_priority[QCAMERA3_ISO_EXP_PRIORITY_END -
    152                                   QCAMERA3_ISO_EXP_PRIORITY_START] = {
    153     { "use_iso_exp_priority", TYPE_INT64 },
    154     { "select_priority", TYPE_INT32 },
    155     { "iso_available_modes", TYPE_INT32 },
    156     { "exposure_time_range", TYPE_INT64 }
    157 };
    158 
    159 vendor_tag_info qcamera3_saturation[QCAMERA3_SATURATION_END -
    160                                   QCAMERA3_SATURATION_START] = {
    161     { "use_saturation", TYPE_INT32 },
    162     { "range", TYPE_INT32 }
    163 };
    164 
    165 vendor_tag_info qcamera3_exposure_metering[QCAMERA3_EXPOSURE_METER_END -
    166                                   QCAMERA3_EXPOSURE_METER_START] = {
    167     { "exposure_metering_mode", TYPE_INT32},
    168     { "available_modes", TYPE_INT32 }
    169 };
    170 
    171 vendor_tag_info qcamera3_av_timer[QCAMERA3_AV_TIMER_END -
    172                                   QCAMERA3_AV_TIMER_START] = {
    173    {"use_av_timer", TYPE_BYTE }
    174 };
    175 
    176 vendor_tag_info qcamera3_sensor_meta_data[QCAMERA3_SENSOR_META_DATA_END -
    177                                   QCAMERA3_SENSOR_META_DATA_START] = {
    178    {"dynamic_black_level_pattern", TYPE_FLOAT },
    179    {"is_mono_only",                TYPE_BYTE }
    180 };
    181 
    182 vendor_tag_info_t
    183         qcamera3_dualcam_link_meta_data[QCAMERA3_DUALCAM_LINK_META_DATA_END -
    184         QCAMERA3_DUALCAM_LINK_META_DATA_START] = {
    185     { "enable",            TYPE_BYTE },
    186     { "is_main",           TYPE_BYTE },
    187     { "related_camera_id", TYPE_BYTE }
    188 };
    189 
    190 vendor_tag_info_t
    191         qcamera3_dualcam_calib_meta_data[QCAMERA3_DUALCAM_CALIB_META_DATA_END -
    192         QCAMERA3_DUALCAM_CALIB_META_DATA_START] = {
    193     { "dualcam_calib_meta_data_blob", TYPE_BYTE }
    194 };
    195 
    196 vendor_tag_info_t
    197         qcamera3_hal_privatedata[QCAMERA3_HAL_PRIVATEDATA_END -
    198         QCAMERA3_HAL_PRIVATEDATA_START] = {
    199     { "reprocess_flags",      TYPE_BYTE },
    200     { "reprocess_data_blob",  TYPE_BYTE },
    201     { "exif_debug_data_blob", TYPE_BYTE }
    202 };
    203 
    204 vendor_tag_info_t
    205         qcamera3_jpep_encode_crop[QCAMERA3_JPEG_ENCODE_CROP_END -
    206         QCAMERA3_JPEG_ENCODE_CROP_START] = {
    207     { "enable", TYPE_BYTE },
    208     { "rect",   TYPE_INT32 },
    209     { "roi",    TYPE_INT32}
    210 };
    211 
    212 vendor_tag_info_t qcamera3_video_hdr[QCAMERA3_VIDEO_HDR_END -
    213         QCAMERA3_VIDEO_HDR_START] = {
    214     { "vhdr_mode", TYPE_INT32 },
    215     { "vhdr_supported_modes", TYPE_INT32 }
    216 };
    217 
    218 vendor_tag_info_t qcamera3_ir[QCAMERA3_IR_END -
    219         QCAMERA3_IR_START] = {
    220     { "ir_mode", TYPE_INT32 },
    221     { "ir_supported_modes", TYPE_INT32}
    222 };
    223 
    224 vendor_tag_info_t qcamera3_aec_speed[QCAMERA3_AEC_CONVERGENCE_SPEED_END -
    225         QCAMERA3_AEC_CONVERGENCE_SPEED_START] = {
    226     {"aec_speed", TYPE_FLOAT }
    227 };
    228 
    229 vendor_tag_info_t qcamera3_awb_speed[QCAMERA3_AWB_CONVERGENCE_SPEED_END -
    230         QCAMERA3_AWB_CONVERGENCE_SPEED_START] = {
    231     {"awb_speed", TYPE_FLOAT }
    232 };
    233 
    234 vendor_tag_info_t
    235         qcamera3_instant_aec[QCAMERA3_INSTANT_AEC_END -
    236         QCAMERA3_INSTANT_AEC_START] = {
    237     { "instant_aec_mode", TYPE_INT32 },
    238     { "instant_aec_available_modes",   TYPE_INT32 }
    239 };
    240 
    241 vendor_tag_info_t nexus_experimental_2016[NEXUS_EXPERIMENTAL_2016_END -
    242         NEXUS_EXPERIMENTAL_2016_START] = {
    243    {"3a.hybrid_ae_enable",                     TYPE_BYTE  },
    244    {"control.af_scene_change",                 TYPE_BYTE  },
    245       // DevCamDebug vendor tag
    246    { "devcamdebug_meta_enable",                TYPE_BYTE  },
    247    // DevCamDebug vendor tag AF
    248    { "devcamdebug_af_lens_position",           TYPE_INT32 },
    249    { "devcamdebug_af_tof_confidence",          TYPE_INT32 },
    250    { "devcamdebug_af_tof_distance",            TYPE_INT32 },
    251    { "devcamdebug_af_luma",                    TYPE_INT32 },
    252    { "devcamdebug_af_haf_state",               TYPE_INT32 },
    253    { "devcamdebug_af_monitor_pdaf_target_pos", TYPE_INT32 },
    254    { "devcamdebug_af_monitor_pdaf_confidence", TYPE_INT32 },
    255    { "devcamdebug_af_monitor_pdaf_refocus",    TYPE_INT32 },
    256    { "devcamdebug_af_monitor_tof_target_pos",  TYPE_INT32 },
    257    { "devcamdebug_af_monitor_tof_confidence",  TYPE_INT32 },
    258    { "devcamdebug_af_monitor_tof_refocus",     TYPE_INT32 },
    259    { "devcamdebug_af_monitor_type_select",     TYPE_INT32 },
    260    { "devcamdebug_af_monitor_refocus",         TYPE_INT32 },
    261    { "devcamdebug_af_monitor_target_pos",      TYPE_INT32 },
    262    { "devcamdebug_af_search_pdaf_target_pos",  TYPE_INT32 },
    263    { "devcamdebug_af_search_pdaf_next_pos",    TYPE_INT32 },
    264    { "devcamdebug_af_search_pdaf_near_pos",    TYPE_INT32 },
    265    { "devcamdebug_af_search_pdaf_far_pos",     TYPE_INT32 },
    266    { "devcamdebug_af_search_pdaf_confidence",  TYPE_INT32 },
    267    { "devcamdebug_af_search_tof_target_pos",   TYPE_INT32 },
    268    { "devcamdebug_af_search_tof_next_pos",     TYPE_INT32 },
    269    { "devcamdebug_af_search_tof_near_pos",     TYPE_INT32 },
    270    { "devcamdebug_af_search_tof_far_pos",      TYPE_INT32 },
    271    { "devcamdebug_af_search_tof_confidence",   TYPE_INT32 },
    272    { "devcamdebug_af_search_type_select",      TYPE_INT32 },
    273    { "devcamdebug_af_search_next_pos",         TYPE_INT32 },
    274    { "devcamdebug_af_search_target_pos",       TYPE_INT32 },
    275    // DevCamDebug vendor tag AEC
    276    { "devcamdebug_aec_target_luma",            TYPE_INT32 },
    277    { "devcamdebug_aec_comp_luma",              TYPE_INT32 },
    278    { "devcamdebug_aec_avg_luma",               TYPE_INT32 },
    279    { "devcamdebug_aec_cur_luma",               TYPE_INT32 },
    280    { "devcamdebug_aec_linecount",              TYPE_INT32 },
    281    { "devcamdebug_aec_real_gain",              TYPE_FLOAT },
    282    { "devcamdebug_aec_exp_index",              TYPE_INT32 },
    283    { "devcamdebug_aec_lux_idx",                TYPE_FLOAT },
    284    // DevCamDebug vendor tag zzHDR
    285    { "devcamdebug_aec_l_real_gain",            TYPE_FLOAT },
    286    { "devcamdebug_aec_l_linecount",            TYPE_INT32 },
    287    { "devcamdebug_aec_s_real_gain",            TYPE_FLOAT },
    288    { "devcamdebug_aec_s_linecount",            TYPE_INT32 },
    289    { "devcamdebug_aec_hdr_sensitivity_ratio",  TYPE_FLOAT },
    290    { "devcamdebug_aec_hdr_exp_time_ratio",     TYPE_FLOAT },
    291    // DevCamDebug vendor tag ADRC
    292    { "devcamdebug_aec_total_drc_gain",         TYPE_FLOAT },
    293    { "devcamdebug_aec_color_drc_gain",         TYPE_FLOAT },
    294    { "devcamdebug_aec_gtm_ratio",              TYPE_FLOAT },
    295    { "devcamdebug_aec_ltm_ratio",              TYPE_FLOAT },
    296    { "devcamdebug_aec_la_ratio",               TYPE_FLOAT },
    297    { "devcamdebug_aec_gamma_ratio",            TYPE_FLOAT },
    298    // DevCamDebug vendor AEC MOTION
    299    { "devcamdebug_aec_camera_motion_dx",       TYPE_FLOAT },
    300    { "devcamdebug_aec_camera_motion_dy",       TYPE_FLOAT },
    301    { "devcamdebug_aec_subject_motion",         TYPE_FLOAT },
    302    // DevCamDebug vendor tag AWB
    303    { "devcamdebug_awb_r_gain",                 TYPE_FLOAT },
    304    { "devcamdebug_awb_g_gain",                 TYPE_FLOAT },
    305    { "devcamdebug_awb_b_gain",                 TYPE_FLOAT },
    306    { "devcamdebug_awb_cct",                    TYPE_INT32 },
    307    { "devcamdebug_awb_decision",               TYPE_INT32 },
    308 };
    309 
    310 vendor_tag_info_t qcamera3_sharpness[QCAMERA3_SHARPNESS_END -
    311         QCAMERA3_SHARPNESS_START] = {
    312     {"strength", TYPE_INT32 },
    313     {"range", TYPE_INT32 }
    314 };
    315 
    316 vendor_tag_info_t qcamera3_histogram[QCAMERA3_HISTOGRAM_END -
    317         QCAMERA3_HISTOGRAM_START] = {
    318     { "enable", TYPE_BYTE },
    319     { "buckets", TYPE_INT32 },
    320     { "max_count", TYPE_INT32 },
    321     { "stats", TYPE_INT32 }
    322 };
    323 
    324 vendor_tag_info_t qcamera3_binning_correction[QCAMERA3_BINNING_CORRECTION_END -
    325         QCAMERA3_BINNING_CORRECTION_START] = {
    326     { "binning_correction_mode", TYPE_INT32 },
    327     { "binning_correction_available_modes",   TYPE_INT32 }
    328 };
    329 
    330 vendor_tag_info_t qcamera3_stats[QCAMERA3_STATS_END -
    331         QCAMERA3_STATS_START] = {
    332     { "is_hdr_scene", TYPE_BYTE },
    333     { "is_hdr_scene_values", TYPE_BYTE },
    334     { "is_hdr_scene_confidence",   TYPE_FLOAT },
    335     { "is_hdr_scene_confidence_range", TYPE_FLOAT },
    336     { "bsgc_available", TYPE_BYTE },
    337     { "blink_detected", TYPE_BYTE },
    338     { "blink_degree", TYPE_BYTE },
    339     { "smile_degree", TYPE_BYTE },
    340     { "smile_confidence", TYPE_BYTE },
    341     { "gaze_angle", TYPE_BYTE },
    342     { "gaze_direction", TYPE_INT32 },
    343     { "gaze_degree", TYPE_BYTE }
    344 };
    345 
    346 vendor_tag_info_t nexus_experimental_2017[NEXUS_EXPERIMENTAL_2017_END -
    347         NEXUS_EXPERIMENTAL_2017_START] = {
    348     { "stats.histogramMode", TYPE_BYTE },
    349     { "stats.availableHistogramBucketCounts", TYPE_INT32 },
    350     { "stats.histogramBucketCount", TYPE_INT32 },
    351     { "stats.histogram", TYPE_INT32 },
    352     { "sensorEepromInfo", TYPE_BYTE },
    353     { "sensorEepromPDAFRightGains", TYPE_BYTE },
    354     { "sensorEepromPDAFLeftGains", TYPE_BYTE },
    355     { "sensorEepromPDAFConvCoeff", TYPE_BYTE },
    356     { "control.tracking_af_trigger", TYPE_BYTE },
    357     { "control.af_regions_confidence", TYPE_INT32 },
    358     { "stats.ois_frame_timestamp_vsync", TYPE_INT64 },
    359     { "stats.ois_frame_timestamp_boottime", TYPE_INT64 },
    360     { "stats.ois_timestamps_boottime", TYPE_INT64 },
    361     { "stats.ois_shift_x", TYPE_INT32 },
    362     { "stats.ois_shift_y", TYPE_INT32 },
    363     { "stats.ois_shift_pixel_x", TYPE_FLOAT },
    364     { "stats.ois_shift_pixel_y", TYPE_FLOAT },
    365     { "sensor.pd_data_dimensions", TYPE_INT32},
    366     { "sensor.pd_data_enable", TYPE_BYTE},
    367     { "control.exposure_time_boost", TYPE_FLOAT},
    368     { "request.makernote", TYPE_BYTE },
    369     { "request.next_still_intent_request_ready", TYPE_BYTE },
    370     { "request.postview", TYPE_INT32},
    371     { "request.postview_config", TYPE_INT32},
    372     { "request.postview_data", TYPE_BYTE},
    373     { "request.continuous_zsl_capture", TYPE_INT32},
    374     { "request.disable_hdrplus", TYPE_INT32},
    375     { "control.scene_distance", TYPE_INT32},
    376 };
    377 
    378 vendor_tag_info_t tango_mode_data[TANGO_MODE_DATA_END -
    379         TANGO_MODE_DATA_START] = {
    380     { "tango_mode", TYPE_BYTE}, //Unused. Reserved for backward compatibility
    381     { "sensor.fullfov", TYPE_BYTE },
    382 };
    383 
    384 vendor_tag_info_t *qcamera3_tag_info[QCAMERA3_SECTIONS_END -
    385         VENDOR_SECTION] = {
    386     qcamera3_privatedata,
    387     qcamera3_cds,
    388     qcamera3_opaque_raw,
    389     qcamera3_crop,
    390     qcamera3_tuning_meta_data,
    391     qcamera3_temporal_denoise,
    392     qcamera3_iso_exp_priority,
    393     qcamera3_saturation,
    394     qcamera3_exposure_metering,
    395     qcamera3_av_timer,
    396     qcamera3_sensor_meta_data,
    397     qcamera3_dualcam_link_meta_data,
    398     qcamera3_dualcam_calib_meta_data,
    399     qcamera3_hal_privatedata,
    400     qcamera3_jpep_encode_crop,
    401     qcamera3_video_hdr,
    402     qcamera3_ir,
    403     qcamera3_aec_speed,
    404     qcamera3_awb_speed,
    405     qcamera3_instant_aec,
    406     nexus_experimental_2016,
    407     qcamera3_sharpness,
    408     qcamera3_histogram,
    409     qcamera3_binning_correction,
    410     qcamera3_stats,
    411     nexus_experimental_2017,
    412 };
    413 
    414 vendor_tag_info_t *tango_tag_info[TANGO_SECTIONS_END -
    415       TANGO_SECTIONS_START] = {
    416     tango_mode_data,
    417 };
    418 
    419 uint32_t qcamera3_all_tags[] = {
    420     // QCAMERA3_PRIVATEDATA
    421     (uint32_t)QCAMERA3_PRIVATEDATA_REPROCESS,
    422 
    423     // QCAMERA3_CDS
    424     (uint32_t)QCAMERA3_CDS_MODE,
    425     (uint32_t)QCAMERA3_CDS_INFO,
    426 
    427     // QCAMERA3_OPAQUE_RAW
    428     (uint32_t)QCAMERA3_OPAQUE_RAW_STRIDES,
    429     (uint32_t)QCAMERA3_OPAQUE_RAW_FORMAT,
    430 
    431     // QCAMERA3_CROP
    432     (uint32_t)QCAMERA3_CROP_COUNT_REPROCESS,
    433     (uint32_t)QCAMERA3_CROP_REPROCESS,
    434     (uint32_t)QCAMERA3_CROP_ROI_MAP_REPROCESS,
    435 
    436     // QCAMERA3_TUNING_META_DATA
    437     (uint32_t)QCAMERA3_TUNING_META_DATA_BLOB,
    438 
    439     // QCAMERA3_TEMPORAL_DENOISE
    440     (uint32_t)QCAMERA3_TEMPORAL_DENOISE_ENABLE,
    441     (uint32_t)QCAMERA3_TEMPORAL_DENOISE_PROCESS_TYPE,
    442 
    443     // QCAMERA3_ISO_EXP_PRIORITY
    444     (uint32_t)QCAMERA3_USE_ISO_EXP_PRIORITY,
    445     (uint32_t)QCAMERA3_SELECT_PRIORITY,
    446     (uint32_t)QCAMERA3_ISO_AVAILABLE_MODES,
    447     (uint32_t)QCAMERA3_EXP_TIME_RANGE,
    448 
    449     // QCAMERA3_SATURATION
    450     (uint32_t)QCAMERA3_USE_SATURATION,
    451     (uint32_t)QCAMERA3_SATURATION_RANGE,
    452 
    453     // QCAMERA3_EXPOSURE_METERING
    454     (uint32_t)QCAMERA3_EXPOSURE_METER,
    455     (uint32_t)QCAMERA3_EXPOSURE_METER_AVAILABLE_MODES,
    456 
    457     //QCAMERA3_AVTIMER
    458     (uint32_t)QCAMERA3_USE_AV_TIMER,
    459 
    460     //QCAMERA3_SENSOR_META_DATA
    461     (uint32_t)QCAMERA3_SENSOR_DYNAMIC_BLACK_LEVEL_PATTERN,
    462     (uint32_t)QCAMERA3_SENSOR_IS_MONO_ONLY,
    463 
    464     //NEXUS_EXPERIMENTAL_2016
    465     (uint32_t)NEXUS_EXPERIMENTAL_2016_AF_SCENE_CHANGE,
    466     // DEVCAMDEBUG
    467     (uint32_t)DEVCAMDEBUG_META_ENABLE,
    468     // DEVCAMDEBUG AF
    469     (uint32_t)DEVCAMDEBUG_AF_LENS_POSITION,
    470     (uint32_t)DEVCAMDEBUG_AF_TOF_CONFIDENCE,
    471     (uint32_t)DEVCAMDEBUG_AF_TOF_DISTANCE,
    472     (uint32_t)DEVCAMDEBUG_AF_LUMA,
    473     (uint32_t)DEVCAMDEBUG_AF_HAF_STATE,
    474     (uint32_t)DEVCAMDEBUG_AF_MONITOR_PDAF_TARGET_POS,
    475     (uint32_t)DEVCAMDEBUG_AF_MONITOR_PDAF_CONFIDENCE,
    476     (uint32_t)DEVCAMDEBUG_AF_MONITOR_PDAF_REFOCUS,
    477     (uint32_t)DEVCAMDEBUG_AF_MONITOR_TOF_TARGET_POS,
    478     (uint32_t)DEVCAMDEBUG_AF_MONITOR_TOF_CONFIDENCE,
    479     (uint32_t)DEVCAMDEBUG_AF_MONITOR_TOF_REFOCUS,
    480     (uint32_t)DEVCAMDEBUG_AF_MONITOR_TYPE_SELECT,
    481     (uint32_t)DEVCAMDEBUG_AF_MONITOR_REFOCUS,
    482     (uint32_t)DEVCAMDEBUG_AF_MONITOR_TARGET_POS,
    483     (uint32_t)DEVCAMDEBUG_AF_SEARCH_PDAF_TARGET_POS,
    484     (uint32_t)DEVCAMDEBUG_AF_SEARCH_PDAF_NEXT_POS,
    485     (uint32_t)DEVCAMDEBUG_AF_SEARCH_PDAF_NEAR_POS,
    486     (uint32_t)DEVCAMDEBUG_AF_SEARCH_PDAF_FAR_POS,
    487     (uint32_t)DEVCAMDEBUG_AF_SEARCH_PDAF_CONFIDENCE,
    488     (uint32_t)DEVCAMDEBUG_AF_SEARCH_TOF_TARGET_POS,
    489     (uint32_t)DEVCAMDEBUG_AF_SEARCH_TOF_NEXT_POS,
    490     (uint32_t)DEVCAMDEBUG_AF_SEARCH_TOF_NEAR_POS,
    491     (uint32_t)DEVCAMDEBUG_AF_SEARCH_TOF_FAR_POS,
    492     (uint32_t)DEVCAMDEBUG_AF_SEARCH_TOF_CONFIDENCE,
    493     (uint32_t)DEVCAMDEBUG_AF_SEARCH_TYPE_SELECT,
    494     (uint32_t)DEVCAMDEBUG_AF_SEARCH_NEXT_POS,
    495     (uint32_t)DEVCAMDEBUG_AF_SEARCH_TARGET_POS,
    496     // DEVCAMDEBUG AEC
    497     (uint32_t)DEVCAMDEBUG_AEC_TARGET_LUMA,
    498     (uint32_t)DEVCAMDEBUG_AEC_COMP_LUMA,
    499     (uint32_t)DEVCAMDEBUG_AEC_AVG_LUMA,
    500     (uint32_t)DEVCAMDEBUG_AEC_CUR_LUMA,
    501     (uint32_t)DEVCAMDEBUG_AEC_LINECOUNT,
    502     (uint32_t)DEVCAMDEBUG_AEC_REAL_GAIN,
    503     (uint32_t)DEVCAMDEBUG_AEC_EXP_INDEX,
    504     (uint32_t)DEVCAMDEBUG_AEC_LUX_IDX,
    505     // DEVCAMDEBUG zzHDR
    506     (uint32_t)DEVCAMDEBUG_AEC_L_REAL_GAIN,
    507     (uint32_t)DEVCAMDEBUG_AEC_L_LINECOUNT,
    508     (uint32_t)DEVCAMDEBUG_AEC_S_REAL_GAIN,
    509     (uint32_t)DEVCAMDEBUG_AEC_S_LINECOUNT,
    510     (uint32_t)DEVCAMDEBUG_AEC_HDR_SENSITIVITY_RATIO,
    511     (uint32_t)DEVCAMDEBUG_AEC_HDR_EXP_TIME_RATIO,
    512     // DEVCAMDEBUG ADRC
    513     (uint32_t)DEVCAMDEBUG_AEC_TOTAL_DRC_GAIN,
    514     (uint32_t)DEVCAMDEBUG_AEC_COLOR_DRC_GAIN,
    515     (uint32_t)DEVCAMDEBUG_AEC_GTM_RATIO,
    516     (uint32_t)DEVCAMDEBUG_AEC_LTM_RATIO,
    517     (uint32_t)DEVCAMDEBUG_AEC_LA_RATIO,
    518     (uint32_t)DEVCAMDEBUG_AEC_GAMMA_RATIO,
    519     // DEVCAMDEBUG AEC MOTION
    520     (uint32_t)DEVCAMDEBUG_AEC_CAMERA_MOTION_DX,
    521     (uint32_t)DEVCAMDEBUG_AEC_CAMERA_MOTION_DY,
    522     (uint32_t)DEVCAMDEBUG_AEC_SUBJECT_MOTION,
    523     // DEVCAMDEBUG AWB
    524     (uint32_t)DEVCAMDEBUG_AWB_R_GAIN,
    525     (uint32_t)DEVCAMDEBUG_AWB_G_GAIN,
    526     (uint32_t)DEVCAMDEBUG_AWB_B_GAIN,
    527     (uint32_t)DEVCAMDEBUG_AWB_CCT,
    528     (uint32_t)DEVCAMDEBUG_AWB_DECISION,
    529     // DEVCAMDEBUG END
    530 
    531     // QCAMERA3_DUALCAM_LINK_META_DATA
    532     (uint32_t)QCAMERA3_DUALCAM_LINK_ENABLE,
    533     (uint32_t)QCAMERA3_DUALCAM_LINK_IS_MAIN,
    534     (uint32_t)QCAMERA3_DUALCAM_LINK_RELATED_CAMERA_ID,
    535 
    536     // QCAMERA3_DUALCAM_CALIB_META_DATA
    537     (uint32_t)QCAMERA3_DUALCAM_CALIB_META_DATA_BLOB,
    538 
    539     // QCAMERA3_HAL_PRIVATEDATA
    540     (uint32_t)QCAMERA3_HAL_PRIVATEDATA_REPROCESS_FLAGS,
    541     (uint32_t)QCAMERA3_HAL_PRIVATEDATA_REPROCESS_DATA_BLOB,
    542     (uint32_t)QCAMERA3_HAL_PRIVATEDATA_EXIF_DEBUG_DATA_BLOB,
    543 
    544     // QCAMERA3_JPEG_ENCODE_CROP
    545     (uint32_t)QCAMERA3_JPEG_ENCODE_CROP_ENABLE,
    546     (uint32_t)QCAMERA3_JPEG_ENCODE_CROP_RECT,
    547     (uint32_t)QCAMERA3_JPEG_ENCODE_CROP_ROI,
    548 
    549     // QCAMERA3_VIDEO_HDR
    550     (uint32_t)QCAMERA3_VIDEO_HDR_MODE,
    551     (uint32_t)QCAMERA3_AVAILABLE_VIDEO_HDR_MODES,
    552 
    553     // QCAMERA3_IR_MODE_ENABLE
    554     (uint32_t)QCAMERA3_IR_MODE,
    555     (uint32_t)QCAMERA3_IR_AVAILABLE_MODES,
    556 
    557     //QCAMERA3_AEC_CONVERGENCE_SPEED
    558     (uint32_t)QCAMERA3_AEC_CONVERGENCE_SPEED,
    559 
    560     //QCAMERA3_AWB_CONVERGENCE_SPEED
    561     (uint32_t)QCAMERA3_AWB_CONVERGENCE_SPEED,
    562 
    563     // QCAMERA3_INSTANT_AEC
    564     (uint32_t)QCAMERA3_INSTANT_AEC_MODE,
    565     (uint32_t)QCAMERA3_INSTANT_AEC_AVAILABLE_MODES,
    566 
    567     //NEXUS_EXPERIMENTAL_2016
    568     (uint32_t)NEXUS_EXPERIMENTAL_2016_HYBRID_AE_ENABLE,
    569 
    570     //QCAMERA3_SHARPNESS
    571     (uint32_t)QCAMERA3_SHARPNESS_STRENGTH,
    572     (uint32_t)QCAMERA3_SHARPNESS_RANGE,
    573 
    574     //QCAMERA3_HISTOGRAM
    575     (uint32_t)QCAMERA3_HISTOGRAM_MODE,
    576     (uint32_t)QCAMERA3_HISTOGRAM_BUCKETS,
    577     (uint32_t)QCAMERA3_HISTOGRAM_MAX_COUNT,
    578     (uint32_t)QCAMERA3_HISTOGRAM_STATS,
    579 
    580     // QCAMERA3_BINNING_CORRECTION_END
    581     (uint32_t)QCAMERA3_BINNING_CORRECTION_MODE,
    582     (uint32_t)QCAMERA3_AVAILABLE_BINNING_CORRECTION_MODES,
    583 
    584     // QCAMERA3_STATS
    585     (uint32_t)QCAMERA3_STATS_IS_HDR_SCENE,
    586     (uint32_t)QCAMERA3_STATS_IS_HDR_SCENE_CONFIDENCE,
    587     (uint32_t)QCAMERA3_STATS_BSGC_AVAILABLE,
    588     (uint32_t)QCAMERA3_STATS_BLINK_DETECTED,
    589     (uint32_t)QCAMERA3_STATS_BLINK_DEGREE,
    590     (uint32_t)QCAMERA3_STATS_SMILE_DEGREE,
    591     (uint32_t)QCAMERA3_STATS_SMILE_CONFIDENCE,
    592     (uint32_t)QCAMERA3_STATS_GAZE_ANGLE,
    593     (uint32_t)QCAMERA3_STATS_GAZE_DIRECTION,
    594     (uint32_t)QCAMERA3_STATS_GAZE_DEGREE,
    595 
    596     //NEXUS_EXPERIMENTAL_2017
    597     (uint32_t)NEXUS_EXPERIMENTAL_2017_HISTOGRAM_ENABLE,
    598     (uint32_t)NEXUS_EXPERIMENTAL_2017_HISTOGRAM_SUPPORTED_BINS,
    599     (uint32_t)NEXUS_EXPERIMENTAL_2017_HISTOGRAM_BINS,
    600     (uint32_t)NEXUS_EXPERIMENTAL_2017_HISTOGRAM,
    601     (uint32_t)NEXUS_EXPERIMENTAL_2017_EEPROM_VERSION_INFO,
    602     (uint32_t)NEXUS_EXPERIMENTAL_2017_EEPROM_PDAF_CALIB_RIGHT_GAINS,
    603     (uint32_t)NEXUS_EXPERIMENTAL_2017_EEPROM_PDAF_CALIB_LEFT_GAINS,
    604     (uint32_t)NEXUS_EXPERIMENTAL_2017_EEPROM_PDAF_CALIB_CONV_COEFF,
    605     (uint32_t)NEXUS_EXPERIMENTAL_2017_TRACKING_AF_TRIGGER,
    606     (uint32_t)NEXUS_EXPERIMENTAL_2017_AF_REGIONS_CONFIDENCE,
    607     (uint32_t)NEXUS_EXPERIMENTAL_2017_OIS_FRAME_TIMESTAMP_VSYNC,
    608     (uint32_t)NEXUS_EXPERIMENTAL_2017_OIS_FRAME_TIMESTAMP_BOOTTIME,
    609     (uint32_t)NEXUS_EXPERIMENTAL_2017_OIS_TIMESTAMPS_BOOTTIME,
    610     (uint32_t)NEXUS_EXPERIMENTAL_2017_OIS_SHIFT_X,
    611     (uint32_t)NEXUS_EXPERIMENTAL_2017_OIS_SHIFT_Y,
    612     (uint32_t)NEXUS_EXPERIMENTAL_2017_OIS_SHIFT_PIXEL_X,
    613     (uint32_t)NEXUS_EXPERIMENTAL_2017_OIS_SHIFT_PIXEL_Y,
    614     (uint32_t)NEXUS_EXPERIMENTAL_2017_PD_DATA_DIMENSIONS,
    615     (uint32_t)NEXUS_EXPERIMENTAL_2017_PD_DATA_ENABLE,
    616     (uint32_t)NEXUS_EXPERIMENTAL_2017_EXP_TIME_BOOST,
    617     (uint32_t)NEXUS_EXPERIMENTAL_2017_EXIF_MAKERNOTE,
    618     (uint32_t)NEXUS_EXPERIMENTAL_2017_NEXT_STILL_INTENT_REQUEST_READY,
    619     (uint32_t)NEXUS_EXPERIMENTAL_2017_POSTVIEW,
    620     (uint32_t)NEXUS_EXPERIMENTAL_2017_POSTVIEW_CONFIG,
    621     (uint32_t)NEXUS_EXPERIMENTAL_2017_POSTVIEW_DATA,
    622     (uint32_t)NEXUS_EXPERIMENTAL_2017_CONTINUOUS_ZSL_CAPTURE,
    623     (uint32_t)NEXUS_EXPERIMENTAL_2017_DISABLE_HDRPLUS,
    624     (uint32_t)NEXUS_EXPERIMENTAL_2017_SCENE_DISTANCE,
    625 
    626     //TANGO_MODE
    627     (uint32_t)TANGO_MODE_DATA_SENSOR_FULLFOV,
    628 };
    629 
    630 const vendor_tag_ops_t* QCamera3VendorTags::Ops = NULL;
    631 
    632 /*===========================================================================
    633  * FUNCTION   : get_vendor_tag_ops
    634  *
    635  * DESCRIPTION: Get the metadata vendor tag function pointers
    636  *
    637  * PARAMETERS :
    638  *    @ops   : function pointer table to be filled by HAL
    639  *
    640  *
    641  * RETURN     : NONE
    642  *==========================================================================*/
    643 void QCamera3VendorTags::get_vendor_tag_ops(
    644                                 vendor_tag_ops_t* ops)
    645 {
    646     LOGL("E");
    647 
    648     Ops = ops;
    649 
    650     ops->get_tag_count = get_tag_count;
    651     ops->get_all_tags = get_all_tags;
    652     ops->get_section_name = get_section_name;
    653     ops->get_tag_name = get_tag_name;
    654     ops->get_tag_type = get_tag_type;
    655     ops->reserved[0] = NULL;
    656 
    657     LOGL("X");
    658     return;
    659 }
    660 
    661 /*===========================================================================
    662  * FUNCTION   : get_tag_count
    663  *
    664  * DESCRIPTION: Get number of vendor tags supported
    665  *
    666  * PARAMETERS :
    667  *    @ops   :  Vendor tag ops data structure
    668  *
    669  *
    670  * RETURN     : Number of vendor tags supported
    671  *==========================================================================*/
    672 
    673 int QCamera3VendorTags::get_tag_count(
    674                 const vendor_tag_ops_t * ops)
    675 {
    676     size_t count = 0;
    677     if (ops == Ops)
    678         count = sizeof(qcamera3_all_tags)/sizeof(qcamera3_all_tags[0]);
    679 
    680     LOGL("count is %d", count);
    681     return (int)count;
    682 }
    683 
    684 /*===========================================================================
    685  * FUNCTION   : get_all_tags
    686  *
    687  * DESCRIPTION: Fill array with all supported vendor tags
    688  *
    689  * PARAMETERS :
    690  *    @ops      :  Vendor tag ops data structure
    691  *    @tag_array:  array of metadata tags
    692  *
    693  * RETURN     : Success: the section name of the specific tag
    694  *              Failure: NULL
    695  *==========================================================================*/
    696 void QCamera3VendorTags::get_all_tags(
    697                 const vendor_tag_ops_t * ops,
    698                 uint32_t *g_array)
    699 {
    700     if (ops != Ops)
    701         return;
    702 
    703     for (size_t i = 0;
    704             i < sizeof(qcamera3_all_tags)/sizeof(qcamera3_all_tags[0]);
    705             i++) {
    706         g_array[i] = qcamera3_all_tags[i];
    707         LOGD("g_array[%d] is %d", i, g_array[i]);
    708     }
    709 }
    710 
    711 /*===========================================================================
    712  * FUNCTION   : get_section_name
    713  *
    714  * DESCRIPTION: Get section name for vendor tag
    715  *
    716  * PARAMETERS :
    717  *    @ops   :  Vendor tag ops structure
    718  *    @tag   :  Vendor specific tag
    719  *
    720  *
    721  * RETURN     : Success: the section name of the specific tag
    722  *              Failure: NULL
    723  *==========================================================================*/
    724 
    725 const char* QCamera3VendorTags::get_section_name(
    726                 const vendor_tag_ops_t * ops,
    727                 uint32_t tag)
    728 {
    729     LOGL("E");
    730     if (ops != Ops)
    731         return NULL;
    732 
    733     const char *ret;
    734     uint32_t section = tag >> 16;
    735 
    736     if (section >= VENDOR_SECTION && section < QCAMERA3_SECTIONS_END)
    737         ret = qcamera3_ext_section_names[section - VENDOR_SECTION];
    738     else if (section >= TANGO_SECTIONS_START && section < TANGO_SECTIONS_END)
    739         ret = tango_section_names[section - TANGO_SECTIONS_START];
    740     else
    741         ret = NULL;
    742 
    743     if (ret)
    744         LOGL("section_name[%d] is %s", tag, ret);
    745     LOGL("X");
    746     return ret;
    747 }
    748 
    749 /*===========================================================================
    750  * FUNCTION   : get_tag_name
    751  *
    752  * DESCRIPTION: Get name of a vendor specific tag
    753  *
    754  * PARAMETERS :
    755  *    @tag   :  Vendor specific tag
    756  *
    757  *
    758  * RETURN     : Success: the name of the specific tag
    759  *              Failure: NULL
    760  *==========================================================================*/
    761 const char* QCamera3VendorTags::get_tag_name(
    762                 const vendor_tag_ops_t * ops,
    763                 uint32_t tag)
    764 {
    765     LOGL("E");
    766     const char *ret;
    767     uint32_t section = tag >> 16;
    768     uint32_t section_index = section - VENDOR_SECTION;
    769     uint32_t tag_index = tag & 0xFFFF;
    770 
    771     if (ops != Ops) {
    772         ret = NULL;
    773         goto done;
    774     }
    775 
    776     if (section >= VENDOR_SECTION && section < QCAMERA3_SECTIONS_END &&
    777         tag < (uint32_t)qcamera3_ext3_section_bounds[section_index])
    778         ret = qcamera3_tag_info[section_index][tag_index].tag_name;
    779     else if (section >= TANGO_SECTIONS_START && section < TANGO_SECTIONS_END &&
    780         tag < (uint32_t)tango_section_bounds[section - TANGO_SECTIONS_START])
    781         ret = tango_tag_info[section - TANGO_SECTIONS_START][tag_index].tag_name;
    782     else
    783         ret = NULL;
    784 
    785     if (ret)
    786         LOGL("tag name for tag %d is %s", tag, ret);
    787     LOGL("X");
    788 
    789 done:
    790     return ret;
    791 }
    792 
    793 /*===========================================================================
    794  * FUNCTION   : get_tag_type
    795  *
    796  * DESCRIPTION: Get type of a vendor specific tag
    797  *
    798  * PARAMETERS :
    799  *    @tag   :  Vendor specific tag
    800  *
    801  *
    802  * RETURN     : Success: the type of the specific tag
    803  *              Failure: -1
    804  *==========================================================================*/
    805 int QCamera3VendorTags::get_tag_type(
    806                 const vendor_tag_ops_t *ops,
    807                 uint32_t tag)
    808 {
    809     LOGL("E");
    810     int ret;
    811     uint32_t section = tag >> 16;
    812     uint32_t section_index = section - VENDOR_SECTION;
    813     uint32_t tag_index = tag & 0xFFFF;
    814 
    815     if (ops != Ops) {
    816         ret = -1;
    817         goto done;
    818     }
    819     if (section >= VENDOR_SECTION && section < QCAMERA3_SECTIONS_END &&
    820         tag < (uint32_t)qcamera3_ext3_section_bounds[section_index])
    821         ret = qcamera3_tag_info[section_index][tag_index].tag_type;
    822     else if (section >= TANGO_SECTIONS_START && section < TANGO_SECTIONS_END &&
    823         tag < (uint32_t)tango_section_bounds[section - TANGO_SECTIONS_START])
    824         ret = tango_tag_info[section - TANGO_SECTIONS_START][tag_index].tag_type;
    825     else
    826         ret = NULL;
    827 
    828     LOGL("tag type for tag %d is %d", tag, ret);
    829     LOGL("X");
    830 done:
    831     return ret;
    832 }
    833 
    834 }; //end namespace qcamera
    835