diff options
author | Maarten Hooft <mthooft@google.com> | 2010-10-24 14:38:43 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-24 14:38:43 -0700 |
commit | 8b24ebe9c3c387c4f00585a08c4af610fe4d8fca (patch) | |
tree | 85ee538e003bfc3346766e6b242f52957771ecf8 /libcamera | |
parent | 456869b6d03338ad10a24e1b3b84f84e1cbe5fd5 (diff) | |
parent | 1d2473857dbf657673da207a15e752cbacac5510 (diff) | |
download | device_samsung_crespo-8b24ebe9c3c387c4f00585a08c4af610fe4d8fca.zip device_samsung_crespo-8b24ebe9c3c387c4f00585a08c4af610fe4d8fca.tar.gz device_samsung_crespo-8b24ebe9c3c387c4f00585a08c4af610fe4d8fca.tar.bz2 |
am 1d247385: am 2cd9fac4: Merge "libcamera: Add torch mode of flash" into gingerbread
Merge commit '1d2473857dbf657673da207a15e752cbacac5510'
* commit '1d2473857dbf657673da207a15e752cbacac5510':
libcamera: Add torch mode of flash
Diffstat (limited to 'libcamera')
-rw-r--r-- | libcamera/SecCamera.cpp | 3 | ||||
-rw-r--r-- | libcamera/SecCameraHWInterface.cpp | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libcamera/SecCamera.cpp b/libcamera/SecCamera.cpp index 93450b1..f3267b1 100644 --- a/libcamera/SecCamera.cpp +++ b/libcamera/SecCamera.cpp @@ -1009,6 +1009,9 @@ int SecCamera::stopPreview(void) /* if auto focus wasn't complete by now, stop it */ fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_SET_AUTO_FOCUS, AUTO_FOCUS_OFF); + if (m_params->flash_mode == FLASH_MODE_TORCH) + setFlashMode(FLASH_MODE_OFF); + #ifdef ENABLE_HDMI_DISPLAY hdmi_deinitialize(); hdmi_gl_streamon(0); diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp index a82ba7a..4a16bc2 100644 --- a/libcamera/SecCameraHWInterface.cpp +++ b/libcamera/SecCameraHWInterface.cpp @@ -268,6 +268,8 @@ void CameraHardwareSec::initDefaultParameters(int cameraId) parameterString.append(CameraParameters::FLASH_MODE_OFF); parameterString.append(","); parameterString.append(CameraParameters::FLASH_MODE_AUTO); + parameterString.append(","); + parameterString.append(CameraParameters::FLASH_MODE_TORCH); p.set(CameraParameters::KEY_SUPPORTED_FLASH_MODES, parameterString.string()); p.set(CameraParameters::KEY_FLASH_MODE, @@ -1948,6 +1950,8 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params) new_flash_mode = FLASH_MODE_AUTO; else if (!strcmp(new_flash_mode_str, CameraParameters::FLASH_MODE_ON)) new_flash_mode = FLASH_MODE_ON; + else if (!strcmp(new_flash_mode_str, CameraParameters::FLASH_MODE_TORCH)) + new_flash_mode = FLASH_MODE_TORCH; else { LOGE("%s::unmatched flash_mode(%s)", __func__, new_flash_mode_str); //red-eye ret = UNKNOWN_ERROR; |