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