diff options
author | Ivan Evlogiev <x0099089@ti.com> | 2011-12-02 13:54:41 +0200 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-07-25 08:55:37 -0500 |
commit | 9f5eca216a5dafd2d7fa85ffb2bc6d236fd414f1 (patch) | |
tree | 1f50b6d5e715e0a0d7066c9e0945d8efaed8f927 /camera/OMXCameraAdapter/OMXCapabilities.cpp | |
parent | 7098591b5d2f2372ecc5b29268263a732e74452e (diff) | |
download | hardware_ti_omap4-9f5eca216a5dafd2d7fa85ffb2bc6d236fd414f1.zip hardware_ti_omap4-9f5eca216a5dafd2d7fa85ffb2bc6d236fd414f1.tar.gz hardware_ti_omap4-9f5eca216a5dafd2d7fa85ffb2bc6d236fd414f1.tar.bz2 |
Camera Hal: Add supported capture modes
Add supported capture modes, so the camera
app can filter them from the menu
Change-Id: I767a8cca6e0f9c72ed6228627bb9ce0ad3376c33
Signed-off-by: Ivan Evlogiev <x0099089@ti.com>
Diffstat (limited to 'camera/OMXCameraAdapter/OMXCapabilities.cpp')
-rw-r--r-- | camera/OMXCameraAdapter/OMXCapabilities.cpp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/camera/OMXCameraAdapter/OMXCapabilities.cpp b/camera/OMXCameraAdapter/OMXCapabilities.cpp index d5daa3d..b19f76c 100644 --- a/camera/OMXCameraAdapter/OMXCapabilities.cpp +++ b/camera/OMXCameraAdapter/OMXCapabilities.cpp @@ -252,6 +252,16 @@ const LUTtype OMXCameraAdapter::mMechanicalMisalignmentCorrectionLUT = { mMechanicalMisalignmentCorrection }; +const userToOMX_LUT OMXCameraAdapter::mBracketingModes [] = { + { TICameraParameters::TEMP_BRACKETING , OMX_BracketTemporal }, + { TICameraParameters::EXPOSURE_BRACKETING , OMX_BracketExposureRelativeInEV }, +}; + +const LUTtype OMXCameraAdapter::mBracketingModesLUT = { + ARRAY_SIZE(mBracketingModes), + mBracketingModes +}; + // values for supported camera facing direction const CapU32 OMXCameraAdapter::mFacing [] = { { OMX_TI_SENFACING_BACK , TICameraParameters::FACING_BACK }, @@ -1276,6 +1286,51 @@ status_t OMXCameraAdapter::insertMechanicalMisalignmentCorrection(CameraProperti return ret; } +status_t OMXCameraAdapter::insertCaptureModes(CameraProperties::Properties* params, OMX_TI_CAPTYPE &caps) +{ + status_t ret = NO_ERROR; + char supported[MAX_PROP_VALUE_LENGTH]; + const char *p; + + LOG_FUNCTION_NAME; + + memset(supported, '\0', sizeof(supported)); + + // 3D mode detect: Misalignment is present only in 3d mode + if (caps.bMechanicalMisalignmentSupported) + { + strncat(supported, TICameraParameters::HIGH_QUALITY_MODE, REMAINING_BYTES(supported)); + strncat(supported, PARAM_SEP, REMAINING_BYTES(supported)); + strncat(supported, TICameraParameters::VIDEO_MODE, REMAINING_BYTES(supported)); + } + else // 2D mode detect: Misalignment is present only in 3d mode + { + strncat(supported, TICameraParameters::HIGH_QUALITY_MODE, REMAINING_BYTES(supported)); + strncat(supported, PARAM_SEP, REMAINING_BYTES(supported)); + strncat(supported, TICameraParameters::VIDEO_MODE, REMAINING_BYTES(supported)); + strncat(supported, PARAM_SEP, REMAINING_BYTES(supported)); + strncat(supported, TICameraParameters::HIGH_PERFORMANCE_MODE, REMAINING_BYTES(supported)); + strncat(supported, PARAM_SEP, REMAINING_BYTES(supported)); + strncat(supported, TICameraParameters::HIGH_QUALITY_ZSL_MODE, REMAINING_BYTES(supported)); + } + + for ( unsigned int i = 0 ; i < caps.ulBracketingModesCount; i++ ) { + p = getLUTvalue_OMXtoHAL(caps.eBracketingModes[i], mBracketingModesLUT); + if ( NULL != p ) { + if (supported[0] != '\0') { + strncat(supported, PARAM_SEP, REMAINING_BYTES(supported)); + } + strncat(supported, p, REMAINING_BYTES(supported)); + } + } + + params->set(CameraProperties::CAP_MODE_VALUES, supported); + + LOG_FUNCTION_NAME_EXIT; + + return ret; +} + status_t OMXCameraAdapter::insertDefaults(CameraProperties::Properties* params, OMX_TI_CAPTYPE &caps) { status_t ret = NO_ERROR; @@ -1449,6 +1504,10 @@ status_t OMXCameraAdapter::insertCapabilities(CameraProperties::Properties* para ret = insertMechanicalMisalignmentCorrection(params, caps); } + if ( NO_ERROR == ret) { + ret = insertCaptureModes(params, caps); + } + //NOTE: Ensure that we always call insertDefaults after inserting the supported capabilities //as there are checks inside insertDefaults to make sure a certain default is supported // or not |