summaryrefslogtreecommitdiffstats
path: root/libcamera
diff options
context:
space:
mode:
authorJeong-Seok Yang <jseok.yang@samsung.com>2010-11-07 21:40:39 -0800
committerWu-cheng Li <wuchengli@google.com>2010-11-10 11:45:41 +0800
commitccd411fa68c7edc1b225893f580dca7d5ad65b61 (patch)
tree2e3cc99d78245cebfa572f62e8d706d6677a49d0 /libcamera
parentff9ac66894939af067597ea00e554d1d84e9f818 (diff)
downloaddevice_samsung_crespo-ccd411fa68c7edc1b225893f580dca7d5ad65b61.zip
device_samsung_crespo-ccd411fa68c7edc1b225893f580dca7d5ad65b61.tar.gz
device_samsung_crespo-ccd411fa68c7edc1b225893f580dca7d5ad65b61.tar.bz2
libcamera: Fix a problem when switching recording mode in night scnen
Bug fix: Exception occured when switching recording video mode in night scene mode. Change-Id: I8861082983bbcf02efbc246c26f37e1fcaa0d402 Signed-off-by: Jeong-Seok Yang <jseok.yang@samsung.com> pid:3848 bug:3181349
Diffstat (limited to 'libcamera')
-rw-r--r--libcamera/SecCameraHWInterface.cpp42
1 files changed, 24 insertions, 18 deletions
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp
index 9d5c775..9be2cb9 100644
--- a/libcamera/SecCameraHWInterface.cpp
+++ b/libcamera/SecCameraHWInterface.cpp
@@ -1748,6 +1748,10 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
}
}
+ // scene mode
+ const char *new_scene_mode_str = params.get(CameraParameters::KEY_SCENE_MODE);
+ const char *current_scene_mode_str = mParameters.get(CameraParameters::KEY_SCENE_MODE);
+
// fps range
int new_min_fps = 0;
int new_max_fps = 0;
@@ -1756,31 +1760,36 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
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.
+ * but the check is performed when requesting only changing fps range
*/
- 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);
+ if (new_scene_mode_str && current_scene_mode_str) {
+ if (!strcmp(new_scene_mode_str, current_scene_mode_str)) {
+ 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;
+ }
+ }
+ } else {
+ /* Check basic validation if scene mode is different */
+ if ((new_min_fps > new_max_fps) ||
+ (new_min_fps < 0) || (new_max_fps < 0))
ret = UNKNOWN_ERROR;
}
- // scene mode
- const char *new_scene_mode_str = params.get(CameraParameters::KEY_SCENE_MODE);
-
- LOGV("%s : new_scene_mode_str %s", __func__, new_scene_mode_str);
-
if (new_scene_mode_str != NULL) {
int new_scene_mode = -1;
const char *new_flash_mode_str = params.get(CameraParameters::KEY_FLASH_MODE);
const char *new_focus_mode_str;
- if (mSecCamera->getCameraId() == SecCamera::CAMERA_ID_BACK) {
- new_focus_mode_str = params.get(CameraParameters::KEY_FOCUS_MODE);
- } else {
- new_focus_mode_str = NULL;
- }
+ new_focus_mode_str = params.get(CameraParameters::KEY_FOCUS_MODE);
+ // fps range is (15000,30000) by default.
+ mParameters.set(CameraParameters::KEY_SUPPORTED_PREVIEW_FPS_RANGE, "(15000,30000)");
+ mParameters.set(CameraParameters::KEY_PREVIEW_FPS_RANGE,
+ "15000,30000");
if (!strcmp(new_scene_mode_str, CameraParameters::SCENE_MODE_AUTO)) {
new_scene_mode = SCENE_MODE_NONE;
@@ -1790,9 +1799,6 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params)
new_focus_mode_str = CameraParameters::FOCUS_MODE_AUTO;
}
new_flash_mode_str = CameraParameters::FLASH_MODE_OFF;
- mParameters.set(CameraParameters::KEY_SUPPORTED_PREVIEW_FPS_RANGE, "(15000,30000)");
- mParameters.set(CameraParameters::KEY_PREVIEW_FPS_RANGE,
- "15000,30000");
if (!strcmp(new_scene_mode_str,
CameraParameters::SCENE_MODE_PORTRAIT)) {