diff options
author | Jeong-Seok Yang <jseok.yang@samsung.com> | 2010-09-27 14:43:58 -0700 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2010-10-04 12:43:32 -0700 |
commit | 7b8b6c31705402c57dae994060030bb90bad917d (patch) | |
tree | fe600b6a2c9f168313516d29c8f5f050b6dbd137 /libcamera | |
parent | efa316cd8a1b94b6ccd693b475122994db5ef34a (diff) | |
download | device_samsung_crespo-7b8b6c31705402c57dae994060030bb90bad917d.zip device_samsung_crespo-7b8b6c31705402c57dae994060030bb90bad917d.tar.gz device_samsung_crespo-7b8b6c31705402c57dae994060030bb90bad917d.tar.bz2 |
libcamera: minor bug fix & change some parameters
1. Fixed : Camera fail when setting exposure with negative value
2. Change: Added "1280x960" and removed "800x480" in supported resolutions
3. Change: Exposure time is adjusted in EXIF informations.
4. Change: Change flash mode parameter to "on,off,auto"
Change-Id: I8cdd2f200780a57e7a324d7f83afc1315b558ce1
Signed-off-by: Jeong-Seok Yang <jseok.yang@samsung.com>
Diffstat (limited to 'libcamera')
-rw-r--r-- | libcamera/SecCamera.cpp | 21 | ||||
-rw-r--r-- | libcamera/SecCameraHWInterface.cpp | 10 |
2 files changed, 17 insertions, 14 deletions
diff --git a/libcamera/SecCamera.cpp b/libcamera/SecCamera.cpp index c83fca2..fb3ea77 100644 --- a/libcamera/SecCamera.cpp +++ b/libcamera/SecCamera.cpp @@ -1102,7 +1102,7 @@ int SecCamera::startPreview(void) CHECK(ret); ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_ISO, m_iso); CHECK(ret); - ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_BRIGHTNESS, m_brightness + BRIGHTNESS_NORMAL); + ret = setBrightness(m_brightness - BRIGHTNESS_NORMAL); CHECK(ret); ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_FRAME_RATE, m_fps); CHECK(ret); @@ -1176,13 +1176,13 @@ int SecCamera::startPreview(void) ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_SCENE_MODE, m_scene_mode); CHECK(ret); } - ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_BRIGHTNESS, m_brightness + BRIGHTNESS_NORMAL); + ret = setBrightness(m_brightness - BRIGHTNESS_NORMAL); CHECK(ret); ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_SHARPNESS, m_sharpness); CHECK(ret); } else { // In case VGA camera /* Brightness setting */ - ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_BRIGHTNESS, m_brightness + BRIGHTNESS_NORMAL); + ret = setBrightness(m_brightness - BRIGHTNESS_NORMAL); CHECK(ret); } #endif @@ -1876,8 +1876,6 @@ int SecCamera::getSnapshotAndJpeg(unsigned char *yuv_buf, unsigned char *jpeg_bu LOG_TIME_START(1) // prepare int nframe = 1; - LOGE("[zzangdol] w %d, h %d\n", m_snapshot_width, m_snapshot_height); - ret = fimc_v4l2_enum_fmt(m_cam_fd,m_snapshot_v4lformat); CHECK(ret); ret = fimc_v4l2_s_fmt_cap(m_cam_fd, m_snapshot_width, m_snapshot_height, m_snapshot_v4lformat); @@ -2340,6 +2338,8 @@ int SecCamera::setBrightness(int brightness) { LOGV("%s(brightness(%d))", __func__, brightness); + brightness += BRIGHTNESS_NORMAL; + if (brightness < BRIGHTNESS_MINUS_4 || BRIGHTNESS_PLUS_4 < brightness) { LOGE("ERR(%s):Invalid brightness(%d)", __func__, brightness); return -1; @@ -2349,7 +2349,7 @@ int SecCamera::setBrightness(int brightness) m_brightness = brightness; #ifdef SWP1_CAMERA_ADD_ADVANCED_FUNCTION if (m_flag_camera_start) { - if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_BRIGHTNESS, brightness + BRIGHTNESS_NORMAL) < 0) { + if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_BRIGHTNESS, brightness) < 0) { LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_BRIGHTNESS", __func__); return -1; } @@ -3595,14 +3595,13 @@ void SecCamera::setExifChangedAttribute() //2 0th IFD Exif Private Tags //3 Exposure Time - int shutterSpeed = fimc_v4l2_s_ctrl(m_cam_fd, - V4L2_CID_CAMERA_GET_SHT_TIME, - 0); + int shutterSpeed = fimc_v4l2_g_ctrl(m_cam_fd, + V4L2_CID_CAMERA_GET_SHT_TIME); mExifInfo.exposure_time.num = 1; - mExifInfo.exposure_time.den = 1000000.0 / shutterSpeed; /* us -> sec */ + mExifInfo.exposure_time.den = 1000.0 / shutterSpeed; /* ms -> sec */ //3 ISO Speed Rating - int iso = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_GET_ISO, 0); + int iso = fimc_v4l2_g_ctrl(m_cam_fd, V4L2_CID_CAMERA_GET_ISO); if (m_iso == ISO_AUTO) { mExifInfo.iso_speed_rating = iso; } else { diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp index f01024a..0cd0544 100644 --- a/libcamera/SecCameraHWInterface.cpp +++ b/libcamera/SecCameraHWInterface.cpp @@ -176,7 +176,7 @@ void CameraHardwareSec::initDefaultParameters(int cameraId) p.set(CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES, "800x480,640x480"); p.set(CameraParameters::KEY_SUPPORTED_PICTURE_SIZES, - "2560x1920,2048x1536,1600x1200,800x480,640x480"); + "2560x1920,2048x1536,1600x1200,1280x960,640x480"); } else { p.set(CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES, @@ -239,8 +239,12 @@ void CameraHardwareSec::initDefaultParameters(int cameraId) parameterString.append(CameraParameters::EFFECT_SEPIA); p.set(CameraParameters::KEY_SUPPORTED_EFFECTS, parameterString.string()); - p.set(CameraParameters::KEY_SUPPORTED_FLASH_MODES, - CameraParameters::FLASH_MODE_OFF); + parameterString = CameraParameters::FLASH_MODE_ON; + parameterString.append(","); + parameterString.append(CameraParameters::FLASH_MODE_OFF); + parameterString.append(","); + parameterString.append(CameraParameters::FLASH_MODE_AUTO); + p.set(CameraParameters::KEY_SUPPORTED_FLASH_MODES, parameterString.string()); parameterString = CameraParameters::SCENE_MODE_AUTO; parameterString.append(","); |