From: jinhyung.jo Date: Mon, 17 Dec 2012 12:21:21 +0000 (+0900) Subject: maru_camera : fixed a capture failure X-Git-Tag: TizenStudio_2.0_p2.3~1140 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d864d2b74e4b7524de17803e68f8868e567bd80f;p=sdk%2Femulator%2Fqemu.git maru_camera : fixed a capture failure Fixed a bug that cannot capture a image when the resolution differs between preview and capture in Linux system. Signed-off-by: Jinhyung Jo --- diff --git a/tizen/src/hw/maru_camera_linux_pci.c b/tizen/src/hw/maru_camera_linux_pci.c index 38601ca..46a5916 100644 --- a/tizen/src/hw/maru_camera_linux_pci.c +++ b/tizen/src/hw/maru_camera_linux_pci.c @@ -760,6 +760,7 @@ void marucam_device_start_preview(MaruCamState *state) void marucam_device_stop_preview(MaruCamState *state) { struct timespec req; + struct v4l2_requestbuffers reqbuf; MaruCamParam *param = state->param; param->top = 0; req.tv_sec = 0; @@ -784,6 +785,14 @@ void marucam_device_stop_preview(MaruCamState *state) n_framebuffer = 0; } state->buf_size = 0; + + reqbuf.count = 0; + reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + reqbuf.memory = V4L2_MEMORY_MMAP; + if (xioctl(v4l2_fd, VIDIOC_REQBUFS, &reqbuf) < 0) { + ERR("Failed to ioctl() with VIDIOC_REQBUF in stop_preview: %s\n", + strerror(errno)); + } INFO("Stopping preview\n"); }