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 18 19 20 #define LOG_TAG "CameraHAL" 21 #include <utils/Log.h> 22 23 #include <string.h> 24 #include <stdlib.h> 25 #include <TICameraParameters.h> 26 #include "CameraHal.h" 27 28 namespace android { 29 30 //TI extensions to camera mode 31 const char TICameraParameters::HIGH_PERFORMANCE_MODE[] = "high-performance"; 32 const char TICameraParameters::HIGH_QUALITY_MODE[] = "high-quality"; 33 const char TICameraParameters::HIGH_QUALITY_ZSL_MODE[] = "high-quality-zsl"; 34 const char TICameraParameters::VIDEO_MODE[] = "video-mode"; 35 36 // TI extensions to standard android Parameters 37 const char TICameraParameters::KEY_SUPPORTED_CAMERAS[] = "camera-indexes"; 38 const char TICameraParameters::KEY_CAMERA[] = "camera-index"; 39 const char TICameraParameters::KEY_SHUTTER_ENABLE[] = "shutter-enable"; 40 const char TICameraParameters::KEY_CAMERA_NAME[] = "camera-name"; 41 const char TICameraParameters::KEY_BURST[] = "burst-capture"; 42 const char TICameraParameters::KEY_CAP_MODE[] = "mode"; 43 const char TICameraParameters::KEY_VNF[] = "vnf"; 44 const char TICameraParameters::KEY_SATURATION[] = "saturation"; 45 const char TICameraParameters::KEY_BRIGHTNESS[] = "brightness"; 46 const char TICameraParameters::KEY_EXPOSURE_MODE[] = "exposure"; 47 const char TICameraParameters::KEY_SUPPORTED_EXPOSURE[] = "exposure-mode-values"; 48 const char TICameraParameters::KEY_CONTRAST[] = "contrast"; 49 const char TICameraParameters::KEY_SHARPNESS[] = "sharpness"; 50 const char TICameraParameters::KEY_ISO[] = "iso"; 51 const char TICameraParameters::KEY_SUPPORTED_ISO_VALUES[] = "iso-mode-values"; 52 const char TICameraParameters::KEY_SUPPORTED_IPP[] = "ipp-values"; 53 const char TICameraParameters::KEY_IPP[] = "ipp"; 54 const char TICameraParameters::KEY_MAN_EXPOSURE[] = "manual-exposure"; 55 const char TICameraParameters::KEY_METERING_MODE[] = "meter-mode"; 56 const char TICameraParameters::KEY_PADDED_WIDTH[] = "padded-width"; 57 const char TICameraParameters::KEY_PADDED_HEIGHT[] = "padded-height"; 58 const char TICameraParameters::KEY_EXP_BRACKETING_RANGE[] = "exp-bracketing-range"; 59 const char TICameraParameters::KEY_TEMP_BRACKETING[] = "temporal-bracketing"; 60 const char TICameraParameters::KEY_TEMP_BRACKETING_RANGE_POS[] = "temporal-bracketing-range-positive"; 61 const char TICameraParameters::KEY_TEMP_BRACKETING_RANGE_NEG[] = "temporal-bracketing-range-negative"; 62 const char TICameraParameters::KEY_S3D_SUPPORTED[] = "s3d-supported"; 63 const char TICameraParameters::KEY_MEASUREMENT_ENABLE[] = "measurement"; 64 const char TICameraParameters::KEY_GBCE[] = "gbce"; 65 const char TICameraParameters::KEY_GLBCE[] = "glbce"; 66 const char TICameraParameters::KEY_CURRENT_ISO[] = "current-iso"; 67 const char TICameraParameters::KEY_SENSOR_ORIENTATION[] = "sensor-orientation"; 68 const char TICameraParameters::KEY_SENSOR_ORIENTATION_VALUES[] = "sensor-orientation-values"; 69 const char TICameraParameters::KEY_MINFRAMERATE[] = "min-framerate"; 70 const char TICameraParameters::KEY_MAXFRAMERATE[] = "max-framerate"; 71 const char TICameraParameters::KEY_RECORDING_HINT[] = "internal-recording-hint"; 72 const char TICameraParameters::KEY_AUTO_FOCUS_LOCK[] = "auto-focus-lock"; 73 74 //TI extensions for enabling/disabling GLBCE 75 const char TICameraParameters::GLBCE_ENABLE[] = "enable"; 76 const char TICameraParameters::GLBCE_DISABLE[] = "disable"; 77 78 //TI extensions for enabling/disabling GBCE 79 const char TICameraParameters::GBCE_ENABLE[] = "enable"; 80 const char TICameraParameters::GBCE_DISABLE[] = "disable"; 81 82 //TI extensions for enabling/disabling measurement 83 const char TICameraParameters::MEASUREMENT_ENABLE[] = "enable"; 84 const char TICameraParameters::MEASUREMENT_DISABLE[] = "disable"; 85 86 //TI extensions for zoom 87 const char TICameraParameters::ZOOM_SUPPORTED[] = "true"; 88 const char TICameraParameters::ZOOM_UNSUPPORTED[] = "false"; 89 90 // TI extensions for 2D Preview in Stereo Mode 91 const char TICameraParameters::KEY_S3D2D_PREVIEW[] = "s3d2d-preview"; 92 const char TICameraParameters::KEY_S3D2D_PREVIEW_MODE[] = "s3d2d-preview-values"; 93 94 //TI extensions for SAC/SMC 95 const char TICameraParameters::KEY_AUTOCONVERGENCE[] = "auto-convergence"; 96 const char TICameraParameters::KEY_AUTOCONVERGENCE_MODE[] = "auto-convergence-mode"; 97 const char TICameraParameters::KEY_MANUALCONVERGENCE_VALUES[] = "manual-convergence-values"; 98 99 //TI extensions for setting EXIF tags 100 const char TICameraParameters::KEY_EXIF_MODEL[] = "exif-model"; 101 const char TICameraParameters::KEY_EXIF_MAKE[] = "exif-make"; 102 103 //TI extensions for additiona GPS data 104 const char TICameraParameters::KEY_GPS_MAPDATUM[] = "gps-mapdatum"; 105 const char TICameraParameters::KEY_GPS_VERSION[] = "gps-version"; 106 const char TICameraParameters::KEY_GPS_DATESTAMP[] = "gps-datestamp"; 107 108 //TI extensions for enabling/disabling shutter sound 109 const char TICameraParameters::SHUTTER_ENABLE[] = "true"; 110 const char TICameraParameters::SHUTTER_DISABLE[] = "false"; 111 112 //TI extensions for Temporal Bracketing 113 const char TICameraParameters::BRACKET_ENABLE[] = "enable"; 114 const char TICameraParameters::BRACKET_DISABLE[] = "disable"; 115 116 //TI extensions to Image post-processing 117 const char TICameraParameters::IPP_LDCNSF[] = "ldc-nsf"; 118 const char TICameraParameters::IPP_LDC[] = "ldc"; 119 const char TICameraParameters::IPP_NSF[] = "nsf"; 120 const char TICameraParameters::IPP_NONE[] = "off"; 121 122 // TI extensions to standard android pixel formats 123 const char TICameraParameters::PIXEL_FORMAT_RAW[] = "raw"; 124 const char TICameraParameters::PIXEL_FORMAT_JPS[] = "jps"; 125 const char TICameraParameters::PIXEL_FORMAT_MPO[] = "mpo"; 126 const char TICameraParameters::PIXEL_FORMAT_RAW_JPEG[] = "raw+jpeg"; 127 const char TICameraParameters::PIXEL_FORMAT_RAW_MPO[] = "raw+mpo"; 128 129 // TI extensions to standard android scene mode settings 130 const char TICameraParameters::SCENE_MODE_SPORT[] = "sport"; 131 const char TICameraParameters::SCENE_MODE_CLOSEUP[] = "closeup"; 132 const char TICameraParameters::SCENE_MODE_AQUA[] = "aqua"; 133 const char TICameraParameters::SCENE_MODE_SNOWBEACH[] = "snow-beach"; 134 const char TICameraParameters::SCENE_MODE_MOOD[] = "mood"; 135 const char TICameraParameters::SCENE_MODE_NIGHT_INDOOR[] = "night-indoor"; 136 const char TICameraParameters::SCENE_MODE_DOCUMENT[] = "document"; 137 const char TICameraParameters::SCENE_MODE_BARCODE[] = "barcode"; 138 const char TICameraParameters::SCENE_MODE_VIDEO_SUPER_NIGHT[] = "super-night"; 139 const char TICameraParameters::SCENE_MODE_VIDEO_CINE[] = "cine"; 140 const char TICameraParameters::SCENE_MODE_VIDEO_OLD_FILM[] = "old-film"; 141 142 // TI extensions to standard android white balance values. 143 const char TICameraParameters::WHITE_BALANCE_TUNGSTEN[] = "tungsten"; 144 const char TICameraParameters::WHITE_BALANCE_HORIZON[] = "horizon"; 145 const char TICameraParameters::WHITE_BALANCE_SUNSET[] = "sunset"; 146 const char TICameraParameters::WHITE_BALANCE_FACE[] = "face-priority"; 147 148 // TI extensions to standard android focus modes. 149 const char TICameraParameters::FOCUS_MODE_PORTRAIT[] = "portrait"; 150 const char TICameraParameters::FOCUS_MODE_EXTENDED[] = "extended"; 151 const char TICameraParameters::FOCUS_MODE_FACE[] = "face-priority"; 152 153 // TI extensions to add values for effect settings. 154 const char TICameraParameters::EFFECT_NATURAL[] = "natural"; 155 const char TICameraParameters::EFFECT_VIVID[] = "vivid"; 156 const char TICameraParameters::EFFECT_COLOR_SWAP[] = "color-swap"; 157 const char TICameraParameters::EFFECT_BLACKWHITE[] = "blackwhite"; 158 159 // TI extensions to add exposure preset modes 160 const char TICameraParameters::EXPOSURE_MODE_OFF[] = "off"; 161 const char TICameraParameters::EXPOSURE_MODE_AUTO[] = "auto"; 162 const char TICameraParameters::EXPOSURE_MODE_NIGHT[] = "night"; 163 const char TICameraParameters::EXPOSURE_MODE_BACKLIGHT[] = "backlighting"; 164 const char TICameraParameters::EXPOSURE_MODE_SPOTLIGHT[] = "spotlight"; 165 const char TICameraParameters::EXPOSURE_MODE_SPORTS[] = "sports"; 166 const char TICameraParameters::EXPOSURE_MODE_SNOW[] = "snow"; 167 const char TICameraParameters::EXPOSURE_MODE_BEACH[] = "beach"; 168 const char TICameraParameters::EXPOSURE_MODE_APERTURE[] = "aperture"; 169 const char TICameraParameters::EXPOSURE_MODE_SMALL_APERTURE[] = "small-aperture"; 170 const char TICameraParameters::EXPOSURE_MODE_FACE[] = "face-priority"; 171 172 // TI extensions to add iso values 173 const char TICameraParameters::ISO_MODE_AUTO[] = "auto"; 174 const char TICameraParameters::ISO_MODE_100[] = "100"; 175 const char TICameraParameters::ISO_MODE_200[] = "200"; 176 const char TICameraParameters::ISO_MODE_400[] = "400"; 177 const char TICameraParameters::ISO_MODE_800[] = "800"; 178 const char TICameraParameters::ISO_MODE_1000[] = "1000"; 179 const char TICameraParameters::ISO_MODE_1200[] = "1200"; 180 const char TICameraParameters::ISO_MODE_1600[] = "1600"; 181 182 // TI extensions to add auto convergence values 183 const char TICameraParameters::AUTOCONVERGENCE_MODE_DISABLE[] = "mode-disable"; 184 const char TICameraParameters::AUTOCONVERGENCE_MODE_FRAME[] = "mode-frame"; 185 const char TICameraParameters::AUTOCONVERGENCE_MODE_CENTER[] = "mode-center"; 186 const char TICameraParameters::AUTOCONVERGENCE_MODE_FFT[] = "mode-fft"; 187 const char TICameraParameters::AUTOCONVERGENCE_MODE_MANUAL[] = "mode-manual"; 188 189 //TI values for camera direction 190 const char TICameraParameters::FACING_FRONT[]="front"; 191 const char TICameraParameters::FACING_BACK[]="back"; 192 193 //TI extensions to flash settings 194 const char TICameraParameters::FLASH_MODE_FILL_IN[] = "fill-in"; 195 196 //TI extensions to add sensor orientation parameters 197 const char TICameraParameters::ORIENTATION_SENSOR_NONE[] = "0"; 198 const char TICameraParameters::ORIENTATION_SENSOR_90[] = "90"; 199 const char TICameraParameters::ORIENTATION_SENSOR_180[] = "180"; 200 const char TICameraParameters::ORIENTATION_SENSOR_270[] = "270"; 201 }; 202 203