From 1cebdb77323e4554a316b9c34bf36957b7dad5ae Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Wed, 26 Mar 2014 18:10:09 +0000 Subject: Revert "camera: Fix setParameters for Preview FPS single/range values" Causes a regression on some devices, so reverting until we're in a position to fix those devices. This reverts commit 9078a1b3b9f9c0c48046ade0e8e18b0d79a659db. Bug: 13563098 Change-Id: I7aedd01fde8b8fdee77e972ec395f0ecadbf8ccb --- camera/CameraParameters.cpp | 53 +++++---------------------------------------- 1 file changed, 5 insertions(+), 48 deletions(-) (limited to 'camera') diff --git a/camera/CameraParameters.cpp b/camera/CameraParameters.cpp index 99e5df4..af091f4 100644 --- a/camera/CameraParameters.cpp +++ b/camera/CameraParameters.cpp @@ -16,7 +16,6 @@ */ #define LOG_TAG "CameraParams" -// #define LOG_NDEBUG 0 #include #include @@ -199,8 +198,6 @@ String8 CameraParameters::flatten() const flattened += ";"; } - ALOGV("%s: Flattened params = %s", __FUNCTION__, flattened.string()); - return flattened; } @@ -250,9 +247,7 @@ void CameraParameters::set(const char *key, const char *value) return; } - // Replacing a value updates the key's order to be the new largest order - ssize_t res = mMap.replaceValueFor(String8(key), String8(value)); - LOG_ALWAYS_FATAL_IF(res < 0, "replaceValueFor(%s,%s) failed", key, value); + mMap.replaceValueFor(String8(key), String8(value)); } void CameraParameters::set(const char *key, int value) @@ -271,12 +266,10 @@ void CameraParameters::setFloat(const char *key, float value) const char *CameraParameters::get(const char *key) const { - ssize_t idx = mMap.indexOfKey(String8(key)); - if (idx < 0) { - return NULL; - } else { - return mMap.valueAt(idx).string(); - } + String8 v = mMap.valueFor(String8(key)); + if (v.length() == 0) + return 0; + return v.string(); } int CameraParameters::getInt(const char *key) const @@ -294,36 +287,6 @@ float CameraParameters::getFloat(const char *key) const return strtof(v, 0); } -status_t CameraParameters::compareSetOrder(const char *key1, const char *key2, - int *order) const { - if (key1 == NULL) { - ALOGE("%s: key1 must not be NULL", __FUNCTION__); - return BAD_VALUE; - } else if (key2 == NULL) { - ALOGE("%s: key2 must not be NULL", __FUNCTION__); - return BAD_VALUE; - } else if (order == NULL) { - ALOGE("%s: order must not be NULL", __FUNCTION__); - return BAD_VALUE; - } - - ssize_t index1 = mMap.indexOfKey(String8(key1)); - ssize_t index2 = mMap.indexOfKey(String8(key2)); - if (index1 < 0) { - ALOGW("%s: Key1 (%s) was not set", __FUNCTION__, key1); - return NAME_NOT_FOUND; - } else if (index2 < 0) { - ALOGW("%s: Key2 (%s) was not set", __FUNCTION__, key2); - return NAME_NOT_FOUND; - } - - *order = (index1 == index2) ? 0 : - (index1 < index2) ? -1 : - 1; - - return OK; -} - void CameraParameters::remove(const char *key) { mMap.removeItem(String8(key)); @@ -449,12 +412,6 @@ void CameraParameters::getPreviewFpsRange(int *min_fps, int *max_fps) const parse_pair(p, min_fps, max_fps, ','); } -void CameraParameters::setPreviewFpsRange(int min_fps, int max_fps) -{ - String8 str = String8::format("%d,%d", min_fps, max_fps); - set(KEY_PREVIEW_FPS_RANGE, str.string()); -} - void CameraParameters::setPreviewFormat(const char *format) { set(KEY_PREVIEW_FORMAT, format); -- cgit v1.1