summaryrefslogtreecommitdiffstats
path: root/libcamera
diff options
context:
space:
mode:
authorMike J. Chen <mjchen@sta.samsung.com>2010-10-27 16:29:04 -0700
committerWu-cheng Li <wuchengli@google.com>2010-10-28 11:48:32 +0900
commitefbd4cb5c555608cb0abd292ca228768211d7226 (patch)
tree6142cbb705320a77ce270ad1bee6884176c1a9e3 /libcamera
parent999aaed857c2b96ab63a1d07f4641fd8422c492a (diff)
downloaddevice_samsung_crespo-efbd4cb5c555608cb0abd292ca228768211d7226.zip
device_samsung_crespo-efbd4cb5c555608cb0abd292ca228768211d7226.tar.gz
device_samsung_crespo-efbd4cb5c555608cb0abd292ca228768211d7226.tar.bz2
S5PC11X: libcamera: Fix nightshot mode exception
Move the check for fps range changes before the scene mode check. Otherwise, we would change the fps range out from under the caller and a previously valid setting would become invalid suddenly. Change-Id: I998a406387f76cd3f0a586ec61a86ea0fc3a311c Signed-off-by: Mike J. Chen <mjchen@sta.samsung.com> pid:3654
Diffstat (limited to 'libcamera')
-rw-r--r--libcamera/SecCameraHWInterface.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp
index 509f4fd..3cc4876 100644
--- a/libcamera/SecCameraHWInterface.cpp
+++ b/libcamera/SecCameraHWInterface.cpp
@@ -1696,6 +1696,23 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
}
}
+ // fps range
+ int new_min_fps = 0;
+ int new_max_fps = 0;
+ int current_min_fps, current_max_fps;
+ params.getPreviewFpsRange(&new_min_fps, &new_max_fps);
+ mParameters.getPreviewFpsRange(&current_min_fps, &current_max_fps);
+ /* our fps range is determined by the sensor, reject any request
+ * that isn't exactly what we're already at.
+ */
+ if ((new_min_fps != current_min_fps) || (new_max_fps != current_max_fps)) {
+ LOGW("%s : requested new_min_fps = %d, new_max_fps = %d not allowed",
+ __func__, new_min_fps, new_max_fps);
+ LOGE("%s : current_min_fps = %d, current_max_fps = %d",
+ __func__, current_min_fps, current_max_fps);
+ ret = UNKNOWN_ERROR;
+ }
+
// scene mode
const char *new_scene_mode_str = params.get(CameraParameters::KEY_SCENE_MODE);
@@ -1842,23 +1859,6 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
// ---------------------------------------------------------------------------
- // fps range
- int new_min_fps = 0;
- int new_max_fps = 0;
- int current_min_fps, current_max_fps;
- params.getPreviewFpsRange(&new_min_fps, &new_max_fps);
- mParameters.getPreviewFpsRange(&current_min_fps, &current_max_fps);
- /* our fps range is determined by the sensor, reject any request
- * that isn't exactly what we're already at.
- */
- if ((new_min_fps != current_min_fps) || (new_max_fps != current_max_fps)) {
- LOGW("%s : requested new_min_fps = %d, new_max_fps = %d not allowed",
- __func__, new_min_fps, new_max_fps);
- LOGE("%s : current_min_fps = %d, current_max_fps = %d",
- __func__, current_min_fps, current_max_fps);
- ret = UNKNOWN_ERROR;
- }
-
// image effect
const char *new_image_effect_str = params.get(CameraParameters::KEY_EFFECT);
if (new_image_effect_str != NULL) {