aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-24 19:51:53 (GMT)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-28 11:21:21 (GMT)
commitc42bfe9d70c708aecc7bd5dc045383284e4b039b (patch)
treea89d15973d370a789150bea818a4762aba334962
parent3642cf01c7c221723d5f6c779664e1be9abf179e (diff)
main: Wait for filled buffers in read mode
When the driver is on read mode, the driver will return immediately from read() callback even when the buffer is not filled. That causes flicker while on read mode. Also, it displays a non-realistic frame rate. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--src/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 066cb81..36da14a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -185,7 +185,10 @@ main(int argc, char *argv[]) {
gdk_pixbuf_xlib_init (display, 0);
cam->desk_depth = xlib_rgb_get_depth ();
- cam->dev = v4l2_open (cam->video_dev, O_RDWR | O_NONBLOCK);
+ if (use_read)
+ cam->dev = v4l2_open (cam->video_dev, O_RDWR);
+ else
+ cam->dev = v4l2_open (cam->video_dev, O_RDWR | O_NONBLOCK);
camera_cap (cam);
get_win_info (cam);

Privacy Policy