From c5c6cb6e68bad6359aa192321eeae7a3708b7661 Mon Sep 17 00:00:00 2001 From: Pawit Pornkitprasan Date: Sun, 18 Dec 2011 12:06:04 +0700 Subject: Fix FFC --- libcamera/SecCamera.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'libcamera') 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); -- cgit v1.1