diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2011-12-18 12:06:04 +0700 |
---|---|---|
committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2011-12-18 12:06:04 +0700 |
commit | c5c6cb6e68bad6359aa192321eeae7a3708b7661 (patch) | |
tree | aa1dab981d4436557ecbbcd6e622a4f8d9dce903 /libcamera | |
parent | fca72a33c2578915a5ccb3957e918a398d9b0cbf (diff) | |
download | device_samsung_aries-common-c5c6cb6e68bad6359aa192321eeae7a3708b7661.zip device_samsung_aries-common-c5c6cb6e68bad6359aa192321eeae7a3708b7661.tar.gz device_samsung_aries-common-c5c6cb6e68bad6359aa192321eeae7a3708b7661.tar.bz2 |
Fix FFC
Diffstat (limited to 'libcamera')
-rwxr-xr-x | libcamera/SecCamera.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/libcamera/SecCamera.cpp b/libcamera/SecCamera.cpp index b064227..fd7fbc2 100755 --- a/libcamera/SecCamera.cpp +++ b/libcamera/SecCamera.cpp @@ -740,7 +740,11 @@ int SecCamera::startPreview(void) /* enum_fmt, s_fmt sample */ int ret = fimc_v4l2_enum_fmt(m_cam_fd,m_preview_v4lformat); CHECK(ret); - ret = fimc_v4l2_s_fmt(m_cam_fd, m_preview_width,m_preview_height,m_preview_v4lformat, 0); + + if (m_camera_id == CAMERA_ID_BACK) + ret = fimc_v4l2_s_fmt(m_cam_fd, m_preview_width,m_preview_height,m_preview_v4lformat, 0); + else + ret = fimc_v4l2_s_fmt(m_cam_fd, m_preview_height,m_preview_width,m_preview_v4lformat, 0); CHECK(ret); ret = fimc_v4l2_reqbufs(m_cam_fd, V4L2_BUF_TYPE_VIDEO_CAPTURE, MAX_BUFFERS); @@ -898,8 +902,14 @@ int SecCamera::startRecord(void) LOGI("%s: m_recording_width = %d, m_recording_height = %d\n", __func__, m_recording_width, m_recording_height); - ret = fimc_v4l2_s_fmt(m_cam_fd2, m_recording_width, - m_recording_height, V4L2_PIX_FMT_NV12T, 0); + if (m_camera_id == CAMERA_ID_BACK) { + ret = fimc_v4l2_s_fmt(m_cam_fd2, m_recording_width, + m_recording_height, V4L2_PIX_FMT_NV12T, 0); + } + else { + ret = fimc_v4l2_s_fmt(m_cam_fd2, m_recording_height, + m_recording_width, V4L2_PIX_FMT_NV12T, 0); + } CHECK(ret); ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_FRAME_RATE, @@ -1433,7 +1443,8 @@ int SecCamera::getSnapshotAndJpeg(unsigned char *yuv_buf, unsigned char *jpeg_bu 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); + // FFC: Swap width and height + ret = fimc_v4l2_s_fmt_cap(m_cam_fd, m_snapshot_height, m_snapshot_width, m_snapshot_v4lformat); CHECK(ret); ret = fimc_v4l2_reqbufs(m_cam_fd, V4L2_BUF_TYPE_VIDEO_CAPTURE, nframe); CHECK(ret); |