maru_camera : fixed a capture failure
authorjinhyung.jo <jinhyung.jo@samsung.com>
Mon, 17 Dec 2012 12:21:21 +0000 (21:21 +0900)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Mon, 17 Dec 2012 12:21:21 +0000 (21:21 +0900)
Fixed a bug that cannot capture a image when the resolution differs between preview and capture in Linux system.

Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
tizen/src/hw/maru_camera_linux_pci.c

index 38601ca..46a5916 100644 (file)
@@ -760,6 +760,7 @@ void marucam_device_start_preview(MaruCamState *state)
 void marucam_device_stop_preview(MaruCamState *state)\r
 {\r
     struct timespec req;\r
+    struct v4l2_requestbuffers reqbuf;\r
     MaruCamParam *param = state->param;\r
     param->top = 0;\r
     req.tv_sec = 0;\r
@@ -784,6 +785,14 @@ void marucam_device_stop_preview(MaruCamState *state)
         n_framebuffer = 0;\r
     }\r
     state->buf_size = 0;\r
+\r
+    reqbuf.count = 0;\r
+    reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;\r
+    reqbuf.memory = V4L2_MEMORY_MMAP;\r
+    if (xioctl(v4l2_fd, VIDIOC_REQBUFS, &reqbuf) < 0) {\r
+        ERR("Failed to ioctl() with VIDIOC_REQBUF in stop_preview: %s\n",\r
+            strerror(errno));\r
+    }\r
     INFO("Stopping preview\n");\r
 }\r
 \r