diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2012-01-01 14:55:17 +0700 |
---|---|---|
committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2012-01-01 14:55:17 +0700 |
commit | 6bd36e859fd23df01deb6a18537c435769152833 (patch) | |
tree | 60553e6c51e1a8b03bd01abc90d5a9f7ef696d35 /libcamera | |
parent | 924499f2a732595e442f2f675bccd9d9e5104e34 (diff) | |
download | device_samsung_aries-common-6bd36e859fd23df01deb6a18537c435769152833.zip device_samsung_aries-common-6bd36e859fd23df01deb6a18537c435769152833.tar.gz device_samsung_aries-common-6bd36e859fd23df01deb6a18537c435769152833.tar.bz2 |
aries-common: Implement camera zoom (original implementation by havlenapetr)
Diffstat (limited to 'libcamera')
-rwxr-xr-x | libcamera/SecCameraHWInterface.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp index 9e37f6a..8b873c2 100755 --- a/libcamera/SecCameraHWInterface.cpp +++ b/libcamera/SecCameraHWInterface.cpp @@ -292,6 +292,12 @@ void CameraHardwareSec::initDefaultParameters(int cameraId) // touch focus p.set(CameraParameters::KEY_MAX_NUM_FOCUS_AREAS, "1"); p.set(CameraParameters::KEY_FOCUS_AREAS, "(0,0,0,0,0)"); + + // zoom + p.set(CameraParameters::KEY_ZOOM, "0"); + p.set(CameraParameters::KEY_MAX_ZOOM, "12"); + p.set(CameraParameters::KEY_ZOOM_RATIOS, "100,125,150,175,200,225,250,275,300,325,350,375,400"); + p.set(CameraParameters::KEY_ZOOM_SUPPORTED, CameraParameters::TRUE); } else { p.set(CameraParameters::KEY_SUPPORTED_PREVIEW_FPS_RANGE, "(7500,30000)"); p.set(CameraParameters::KEY_PREVIEW_FPS_RANGE, "7500,30000"); @@ -1821,6 +1827,20 @@ status_t CameraHardwareSec::setParameters(const CameraParameters& params) ret = UNKNOWN_ERROR; } } + + // zoom + int new_zoom = params.getInt(CameraParameters::KEY_ZOOM); + int max_zoom = params.getInt(CameraParameters::KEY_MAX_ZOOM); + LOGV("%s : new_zoom %d", __func__, new_zoom); + if (0 <= new_zoom && new_zoom <= max_zoom) { + LOGV("%s : set zoom:%d\n", __func__, new_zoom); + if (mSecCamera->setZoom(new_zoom) < 0) { + LOGE("ERR(%s):Fail on mSecCamera->setZoom(%d)", __func__, new_zoom); + ret = UNKNOWN_ERROR; + } else { + mParameters.set(CameraParameters::KEY_ZOOM, new_zoom); + } + } } else { if (!isSupportedParameter(new_focus_mode_str, mParameters.get(CameraParameters::KEY_SUPPORTED_FOCUS_MODES))) { |