1 /* 2 * Copyright (C) Texas Instruments - http://www.ti.com/ 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 #include <utils/Log.h> 18 19 #include <string.h> 20 #include <stdlib.h> 21 #include <TICameraParameters.h> 22 23 #define TI_KEY_ALGO_PREFIX "ti-algo-" 24 25 namespace Ti { 26 namespace Camera { 27 28 //TI extensions to camera mode 29 const char TICameraParameters::HIGH_PERFORMANCE_MODE[] = "high-performance"; 30 const char TICameraParameters::HIGH_QUALITY_MODE[] = "high-quality"; 31 const char TICameraParameters::HIGH_QUALITY_ZSL_MODE[] = "high-quality-zsl"; 32 const char TICameraParameters::CP_CAM_MODE[] = "cp-cam"; 33 const char TICameraParameters::VIDEO_MODE[] = "video-mode"; 34 const char TICameraParameters::VIDEO_MODE_HQ[] = "video-mode-hq"; 35 const char TICameraParameters::EXPOSURE_BRACKETING[] = "exposure-bracketing"; 36 const char TICameraParameters::ZOOM_BRACKETING[] = "zoom-bracketing"; 37 const char TICameraParameters::TEMP_BRACKETING[] = "temporal-bracketing"; 38 39 // TI extensions to standard android Parameters 40 const char TICameraParameters::KEY_SUPPORTED_CAMERAS[] = "camera-indexes"; 41 const char TICameraParameters::KEY_CAMERA[] = "camera-index"; 42 const char TICameraParameters::KEY_SHUTTER_ENABLE[] = "shutter-enable"; 43 const char TICameraParameters::KEY_CAMERA_NAME[] = "camera-name"; 44 const char TICameraParameters::KEY_BURST[] = "burst-capture"; 45 const char TICameraParameters::KEY_CAP_MODE[] = "mode"; 46 const char TICameraParameters::KEY_CAP_MODE_VALUES[] = "mode-values"; 47 const char TICameraParameters::KEY_VNF[] = "vnf"; 48 const char TICameraParameters::KEY_VNF_SUPPORTED[] = "vnf-supported"; 49 const char TICameraParameters::KEY_SATURATION[] = "saturation"; 50 const char TICameraParameters::KEY_BRIGHTNESS[] = "brightness"; 51 const char TICameraParameters::KEY_SUPPORTED_EXPOSURE[] = "exposure-mode-values"; 52 const char TICameraParameters::KEY_EXPOSURE_MODE[] = "exposure"; 53 const char TICameraParameters::KEY_SUPPORTED_MANUAL_EXPOSURE_MIN[] = "supported-manual-exposure-min"; 54 const char TICameraParameters::KEY_SUPPORTED_MANUAL_EXPOSURE_MAX[] = "supported-manual-exposure-max"; 55 const char TICameraParameters::KEY_SUPPORTED_MANUAL_EXPOSURE_STEP[] = "supported-manual-exposure-step"; 56 const char TICameraParameters::KEY_SUPPORTED_MANUAL_GAIN_ISO_MIN[] = "supported-manual-gain-iso-min"; 57 const char TICameraParameters::KEY_SUPPORTED_MANUAL_GAIN_ISO_MAX[] = "supported-manual-gain-iso-max"; 58 const char TICameraParameters::KEY_SUPPORTED_MANUAL_GAIN_ISO_STEP[] = "supported-manual-gain-iso-step"; 59 const char TICameraParameters::KEY_MANUAL_EXPOSURE[] = "manual-exposure"; 60 const char TICameraParameters::KEY_MANUAL_EXPOSURE_RIGHT[] = "manual-exposure-right"; 61 const char TICameraParameters::KEY_MANUAL_GAIN_ISO[] = "manual-gain-iso"; 62 const char TICameraParameters::KEY_MANUAL_GAIN_ISO_RIGHT[] = "manual-gain-iso-right"; 63 const char TICameraParameters::KEY_CONTRAST[] = "contrast"; 64 const char TICameraParameters::KEY_SHARPNESS[] = "sharpness"; 65 const char TICameraParameters::KEY_ISO[] = "iso"; 66 const char TICameraParameters::KEY_SUPPORTED_ISO_VALUES[] = "iso-mode-values"; 67 const char TICameraParameters::KEY_SUPPORTED_IPP[] = "ipp-values"; 68 const char TICameraParameters::KEY_IPP[] = "ipp"; 69 const char TICameraParameters::KEY_METERING_MODE[] = "meter-mode"; 70 const char TICameraParameters::KEY_EXP_BRACKETING_RANGE[] = "exp-bracketing-range"; 71 const char TICameraParameters::KEY_EXP_GAIN_BRACKETING_RANGE[] = "exp-gain-bracketing-range"; 72 const char TICameraParameters::KEY_ZOOM_BRACKETING_RANGE[] = "zoom-bracketing-range"; 73 const char TICameraParameters::KEY_TEMP_BRACKETING[] = "temporal-bracketing"; 74 const char TICameraParameters::KEY_TEMP_BRACKETING_RANGE_POS[] = "temporal-bracketing-range-positive"; 75 const char TICameraParameters::KEY_TEMP_BRACKETING_RANGE_NEG[] = "temporal-bracketing-range-negative"; 76 const char TICameraParameters::KEY_FLUSH_SHOT_CONFIG_QUEUE[] = "flush-shot-config-queue"; 77 const char TICameraParameters::KEY_MEASUREMENT_ENABLE[] = "measurement"; 78 const char TICameraParameters::KEY_GBCE[] = "gbce"; 79 const char TICameraParameters::KEY_GBCE_SUPPORTED[] = "gbce-supported"; 80 const char TICameraParameters::KEY_GLBCE[] = "glbce"; 81 const char TICameraParameters::KEY_GLBCE_SUPPORTED[] = "glbce-supported"; 82 const char TICameraParameters::KEY_CURRENT_ISO[] = "current-iso"; 83 const char TICameraParameters::KEY_SENSOR_ORIENTATION[] = "sensor-orientation"; 84 const char TICameraParameters::KEY_RECORDING_HINT[] = "internal-recording-hint"; 85 const char TICameraParameters::KEY_AUTO_FOCUS_LOCK[] = "auto-focus-lock"; 86 const char TICameraParameters::KEY_FRAMERATE_RANGES_EXT_SUPPORTED[] = "preview-fps-range-ext-values"; 87 const char TICameraParameters::KEY_FRAMERATES_EXT_SUPPORTED[] = "preview-fps-ext-values"; 88 89 const char TICameraParameters::RAW_WIDTH[] = "raw-width"; 90 const char TICameraParameters::RAW_HEIGHT[] = "raw-height"; 91 92 // TI extensions for Stereo Mode 93 const char TICameraParameters::KEY_S3D_PRV_FRAME_LAYOUT[] = "s3d-prv-frame-layout"; 94 const char TICameraParameters::KEY_S3D_PRV_FRAME_LAYOUT_VALUES[] = "s3d-prv-frame-layout-values"; 95 const char TICameraParameters::KEY_S3D_CAP_FRAME_LAYOUT[] = "s3d-cap-frame-layout"; 96 const char TICameraParameters::KEY_S3D_CAP_FRAME_LAYOUT_VALUES[] = "s3d-cap-frame-layout-values"; 97 98 //TI extentions fo 3D resolutions 99 const char TICameraParameters::KEY_SUPPORTED_PICTURE_SUBSAMPLED_SIZES[] = "supported-picture-subsampled-size-values"; 100 const char TICameraParameters::KEY_SUPPORTED_PICTURE_TOPBOTTOM_SIZES[] = "supported-picture-topbottom-size-values"; 101 const char TICameraParameters::KEY_SUPPORTED_PICTURE_SIDEBYSIDE_SIZES[] = "supported-picture-sidebyside-size-values"; 102 const char TICameraParameters::KEY_SUPPORTED_PREVIEW_SUBSAMPLED_SIZES[] = "supported-preview-subsampled-size-values"; 103 const char TICameraParameters::KEY_SUPPORTED_PREVIEW_TOPBOTTOM_SIZES[] = "supported-preview-topbottom-size-values"; 104 const char TICameraParameters::KEY_SUPPORTED_PREVIEW_SIDEBYSIDE_SIZES[] = "supported-preview-sidebyside-size-values"; 105 106 //TI extensions for SAC/SMC 107 const char TICameraParameters::KEY_AUTOCONVERGENCE_MODE[] = "auto-convergence-mode"; 108 const char TICameraParameters::KEY_AUTOCONVERGENCE_MODE_VALUES[] = "auto-convergence-mode-values"; 109 const char TICameraParameters::KEY_MANUAL_CONVERGENCE[] = "manual-convergence"; 110 const char TICameraParameters::KEY_SUPPORTED_MANUAL_CONVERGENCE_MIN[] = "supported-manual-convergence-min"; 111 const char TICameraParameters::KEY_SUPPORTED_MANUAL_CONVERGENCE_MAX[] = "supported-manual-convergence-max"; 112 const char TICameraParameters::KEY_SUPPORTED_MANUAL_CONVERGENCE_STEP[] = "supported-manual-convergence-step"; 113 114 //TI extensions for setting EXIF tags 115 const char TICameraParameters::KEY_EXIF_MODEL[] = "exif-model"; 116 const char TICameraParameters::KEY_EXIF_MAKE[] = "exif-make"; 117 118 //TI extensions for additiona GPS data 119 const char TICameraParameters::KEY_GPS_MAPDATUM[] = "gps-mapdatum"; 120 const char TICameraParameters::KEY_GPS_VERSION[] = "gps-version"; 121 const char TICameraParameters::KEY_GPS_DATESTAMP[] = "gps-datestamp"; 122 123 // TI extensions for slice mode implementation for VTC 124 const char TICameraParameters::KEY_VTC_HINT[] = "internal-vtc-hint"; 125 const char TICameraParameters::KEY_VIDEO_ENCODER_HANDLE[] = "encoder_handle"; 126 const char TICameraParameters::KEY_VIDEO_ENCODER_SLICE_HEIGHT[] = "encoder_slice_height"; 127 128 //TI extensions to Image post-processing 129 const char TICameraParameters::IPP_LDCNSF[] = "ldc-nsf"; 130 const char TICameraParameters::IPP_LDC[] = "ldc"; 131 const char TICameraParameters::IPP_NSF[] = "nsf"; 132 const char TICameraParameters::IPP_NONE[] = "off"; 133 134 // TI extensions to standard android pixel formats 135 const char TICameraParameters::PIXEL_FORMAT_UNUSED[] = "unused"; 136 const char TICameraParameters::PIXEL_FORMAT_JPS[] = "jps"; 137 const char TICameraParameters::PIXEL_FORMAT_MPO[] = "mpo"; 138 const char TICameraParameters::PIXEL_FORMAT_YUV422I_UYVY[] = "yuv422i-uyvy"; 139 140 // TI extensions to standard android scene mode settings 141 const char TICameraParameters::SCENE_MODE_CLOSEUP[] = "closeup"; 142 const char TICameraParameters::SCENE_MODE_AQUA[] = "aqua"; 143 const char TICameraParameters::SCENE_MODE_SNOWBEACH[] = "snow-beach"; 144 const char TICameraParameters::SCENE_MODE_MOOD[] = "mood"; 145 const char TICameraParameters::SCENE_MODE_NIGHT_INDOOR[] = "night-indoor"; 146 const char TICameraParameters::SCENE_MODE_DOCUMENT[] = "document"; 147 const char TICameraParameters::SCENE_MODE_BARCODE[] = "barcode"; 148 const char TICameraParameters::SCENE_MODE_VIDEO_SUPER_NIGHT[] = "super-night"; 149 const char TICameraParameters::SCENE_MODE_VIDEO_CINE[] = "cine"; 150 const char TICameraParameters::SCENE_MODE_VIDEO_OLD_FILM[] = "old-film"; 151 152 // TI extensions to standard android white balance values. 153 const char TICameraParameters::WHITE_BALANCE_TUNGSTEN[] = "tungsten"; 154 const char TICameraParameters::WHITE_BALANCE_HORIZON[] = "horizon"; 155 const char TICameraParameters::WHITE_BALANCE_SUNSET[] = "sunset"; 156 const char TICameraParameters::WHITE_BALANCE_FACE[] = "face-priority"; 157 158 // TI extensions to standard android focus modes. 159 const char TICameraParameters::FOCUS_MODE_PORTRAIT[] = "portrait"; 160 const char TICameraParameters::FOCUS_MODE_EXTENDED[] = "extended"; 161 const char TICameraParameters::FOCUS_MODE_FACE[] = "face-priority"; 162 const char TICameraParameters::FOCUS_MODE_OFF[] = "off"; 163 164 // TI extensions to add values for effect settings. 165 const char TICameraParameters::EFFECT_NATURAL[] = "natural"; 166 const char TICameraParameters::EFFECT_VIVID[] = "vivid"; 167 const char TICameraParameters::EFFECT_COLOR_SWAP[] = "color-swap"; 168 const char TICameraParameters::EFFECT_BLACKWHITE[] = "blackwhite"; 169 170 // TI extensions to add exposure preset modes 171 const char TICameraParameters::EXPOSURE_MODE_MANUAL[] = "manual"; 172 const char TICameraParameters::EXPOSURE_MODE_AUTO[] = "auto"; 173 const char TICameraParameters::EXPOSURE_MODE_NIGHT[] = "night"; 174 const char TICameraParameters::EXPOSURE_MODE_BACKLIGHT[] = "backlighting"; 175 const char TICameraParameters::EXPOSURE_MODE_SPOTLIGHT[] = "spotlight"; 176 const char TICameraParameters::EXPOSURE_MODE_SPORTS[] = "sports"; 177 const char TICameraParameters::EXPOSURE_MODE_SNOW[] = "snow"; 178 const char TICameraParameters::EXPOSURE_MODE_BEACH[] = "beach"; 179 const char TICameraParameters::EXPOSURE_MODE_APERTURE[] = "aperture"; 180 const char TICameraParameters::EXPOSURE_MODE_SMALL_APERTURE[] = "small-aperture"; 181 const char TICameraParameters::EXPOSURE_MODE_FACE[] = "face-priority"; 182 183 // TI extensions to add iso values 184 const char TICameraParameters::ISO_MODE_AUTO[] = "auto"; 185 const char TICameraParameters::ISO_MODE_100[] = "100"; 186 const char TICameraParameters::ISO_MODE_200[] = "200"; 187 const char TICameraParameters::ISO_MODE_400[] = "400"; 188 const char TICameraParameters::ISO_MODE_800[] = "800"; 189 const char TICameraParameters::ISO_MODE_1000[] = "1000"; 190 const char TICameraParameters::ISO_MODE_1200[] = "1200"; 191 const char TICameraParameters::ISO_MODE_1600[] = "1600"; 192 193 //TI extensions for stereo frame layouts 194 const char TICameraParameters::S3D_NONE[] = "none"; 195 const char TICameraParameters::S3D_TB_FULL[] = "tb-full"; 196 const char TICameraParameters::S3D_SS_FULL[] = "ss-full"; 197 const char TICameraParameters::S3D_TB_SUBSAMPLED[] = "tb-subsampled"; 198 const char TICameraParameters::S3D_SS_SUBSAMPLED[] = "ss-subsampled"; 199 200 // TI extensions to add auto convergence values 201 const char TICameraParameters::AUTOCONVERGENCE_MODE_DISABLE[] = "disable"; 202 const char TICameraParameters::AUTOCONVERGENCE_MODE_FRAME[] = "frame"; 203 const char TICameraParameters::AUTOCONVERGENCE_MODE_CENTER[] = "center"; 204 const char TICameraParameters::AUTOCONVERGENCE_MODE_TOUCH[] = "touch"; 205 const char TICameraParameters::AUTOCONVERGENCE_MODE_MANUAL[] = "manual"; 206 207 //TI values for camera direction 208 const char TICameraParameters::FACING_FRONT[]="front"; 209 const char TICameraParameters::FACING_BACK[]="back"; 210 211 //TI extensions to flash settings 212 const char TICameraParameters::FLASH_MODE_FILL_IN[] = "fill-in"; 213 214 //TI extensions to add sensor orientation parameters 215 const char TICameraParameters::ORIENTATION_SENSOR_NONE[] = "0"; 216 const char TICameraParameters::ORIENTATION_SENSOR_90[] = "90"; 217 const char TICameraParameters::ORIENTATION_SENSOR_180[] = "180"; 218 const char TICameraParameters::ORIENTATION_SENSOR_270[] = "270"; 219 220 const char TICameraParameters::KEY_MECHANICAL_MISALIGNMENT_CORRECTION_SUPPORTED[] = "mechanical-misalignment-correction-supported"; 221 const char TICameraParameters::KEY_MECHANICAL_MISALIGNMENT_CORRECTION[] = "mechanical-misalignment-correction"; 222 223 //TI extensions for enable/disable algos 224 const char TICameraParameters::KEY_ALGO_EXTERNAL_GAMMA[] = TI_KEY_ALGO_PREFIX "external-gamma"; 225 const char TICameraParameters::KEY_ALGO_NSF1[] = TI_KEY_ALGO_PREFIX "nsf1"; 226 const char TICameraParameters::KEY_ALGO_NSF2[] = TI_KEY_ALGO_PREFIX "nsf2"; 227 const char TICameraParameters::KEY_ALGO_SHARPENING[] = TI_KEY_ALGO_PREFIX "sharpening"; 228 const char TICameraParameters::KEY_ALGO_THREELINCOLORMAP[] = TI_KEY_ALGO_PREFIX "threelinecolormap"; 229 const char TICameraParameters::KEY_ALGO_GIC[] = TI_KEY_ALGO_PREFIX "gic"; 230 231 const char TICameraParameters::KEY_GAMMA_TABLE[] = "gamma-table"; 232 233 } // namespace Camera 234 } // namespace Ti 235