diff options
author | Jean Johnson <jean-johnson@ti.com> | 2012-02-24 15:30:10 -0600 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-07-25 08:55:42 -0500 |
commit | ab55c4f48093216abd635ec1d7033d43389a912d (patch) | |
tree | 22ca32e6d58340d857ee8bfded9496f637571904 | |
parent | bc320dc9ce08e62d2aa515a348f83c18496eea2a (diff) | |
parent | 8aad806c9bd1cc5cd80ac8794037cd822611df09 (diff) | |
download | hardware_ti_omap4-ab55c4f48093216abd635ec1d7033d43389a912d.zip hardware_ti_omap4-ab55c4f48093216abd635ec1d7033d43389a912d.tar.gz hardware_ti_omap4-ab55c4f48093216abd635ec1d7033d43389a912d.tar.bz2 |
Merge "CameraHAL: Default framerate fix" into p-ics-mr1
-rw-r--r-- | camera/OMXCameraAdapter/OMXCapabilities.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/camera/OMXCameraAdapter/OMXCapabilities.cpp b/camera/OMXCameraAdapter/OMXCapabilities.cpp index 30a16b8..80a0cca 100644 --- a/camera/OMXCameraAdapter/OMXCapabilities.cpp +++ b/camera/OMXCameraAdapter/OMXCapabilities.cpp @@ -1808,7 +1808,7 @@ status_t OMXCameraAdapter::insertGLBCESupported(CameraProperties::Properties* pa status_t OMXCameraAdapter::insertDefaults(CameraProperties::Properties* params, OMX_TI_CAPTYPE &caps) { status_t ret = NO_ERROR; - char *pos; + char *pos, *str, *def; char temp[MAX_PROP_VALUE_LENGTH]; LOG_FUNCTION_NAME; @@ -1902,7 +1902,29 @@ status_t OMXCameraAdapter::insertDefaults(CameraProperties::Properties* params, } params->set(CameraProperties::PREVIEW_FORMAT, DEFAULT_PREVIEW_FORMAT); - params->set(CameraProperties::PREVIEW_FRAME_RATE, DEFAULT_FRAMERATE); + + /* Set default value if supported, otherwise set max supported value */ + strncpy(temp, params->get(CameraProperties::SUPPORTED_PREVIEW_FRAME_RATES), + MAX_PROP_VALUE_LENGTH - 1); + def = str = temp; + while (1) { + if ((pos = strstr(str, PARAM_SEP))) { + *pos = '\0'; + } + if (!strcmp(str, DEFAULT_FRAMERATE)) { + def = str; + break; + } + if (atoi(str) > atoi(def)) { + def = str; + } + if (pos == NULL) { + break; + } + str = pos + strlen(PARAM_SEP); + } + params->set(CameraProperties::PREVIEW_FRAME_RATE, def); + params->set(CameraProperties::REQUIRED_PREVIEW_BUFS, DEFAULT_NUM_PREV_BUFS); params->set(CameraProperties::REQUIRED_IMAGE_BUFS, DEFAULT_NUM_PIC_BUFS); params->set(CameraProperties::SATURATION, DEFAULT_SATURATION); |