libv4l2: Support non-blocking mode for dqbuf
authorHyeonmyeong Choi <hyeon.choi@samsung.com>
Sat, 12 Jan 2013 14:44:05 +0000 (23:44 +0900)
committerHwang Tonghun <thun.hwang@samsung.com>
Sun, 24 Feb 2013 06:48:05 +0000 (15:48 +0900)
When dqbuf() return -EAGAIN, this is not error at non-blocking mode.

Change-Id: I84a0629dc442b9a13fda08451334f90f84c86f6e
Signed-off-by: Hyeonmyeong Choi <hyeon.choi@samsung.com>
libv4l2/exynos_v4l2.c

index 842d1bac3aaf768093cf2e0a4c43f0db26486c18..c737c07d77dd1ad9157d6b35a7473973f52fbce0 100644 (file)
@@ -541,6 +541,9 @@ int exynos_v4l2_dqbuf(int fd, struct v4l2_buffer *buf)
 
     ret = ioctl(fd, VIDIOC_DQBUF, buf);
     if (ret) {
+        if (errno == EAGAIN)
+            return -errno;
+
         ALOGW("failed to ioctl: VIDIOC_DQBUF (%d - %s)", errno, strerror(errno));
         return ret;
     }