diff options
author | Elaine Xiong <Elaine.Xiong@Sun.COM> | 2009-07-17 13:22:57 +0100 |
---|---|---|
committer | Jan Schmidt <thaytan@noraisin.net> | 2009-07-19 11:42:13 +0100 |
commit | 085f87d85f83659b86e4ab880e389fa934f03962 (patch) | |
tree | ccd38005283a8da6d2a827cacd50ba7c8c59ca41 /sys/v4l2/v4l2src_calls.c | |
parent | 988123b1869393f0b7eab72d16c28abe141228d3 (diff) |
v4l2: Fix v4l2src on OpenSolaris
The v4l2 driver for USB webcams on OpenSolaris does not support select()
calls. Detect when select() fails, and skip polling the device afterward,
which restores the pre 0.10.14 behaviour on OpenSolaris.
Signed-off-by: Jan Schmidt <thaytan@noraisin.net>
Diffstat (limited to 'sys/v4l2/v4l2src_calls.c')
-rw-r--r-- | sys/v4l2/v4l2src_calls.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/v4l2/v4l2src_calls.c b/sys/v4l2/v4l2src_calls.c index 30556af4..3dd6e0e6 100644 --- a/sys/v4l2/v4l2src_calls.c +++ b/sys/v4l2/v4l2src_calls.c @@ -999,12 +999,20 @@ gst_v4l2src_grab_frame (GstV4l2Src * v4l2src, GstBuffer ** buf) buffer.memory = V4L2_MEMORY_MMAP; for (;;) { - ret = gst_poll_wait (v4l2src->v4l2object->poll, GST_CLOCK_TIME_NONE); - if (G_UNLIKELY (ret < 0)) { - if (errno == EBUSY) - goto stopped; - if (errno != EAGAIN && errno != EINTR) - goto select_error; + if (v4l2src->v4l2object->can_poll_device) { + ret = gst_poll_wait (v4l2src->v4l2object->poll, GST_CLOCK_TIME_NONE); + if (G_UNLIKELY (ret < 0)) { + if (errno == EBUSY) + goto stopped; + if (errno == ENXIO) { + GST_DEBUG_OBJECT (v4l2src, + "v4l2 device doesn't support polling. Disabling"); + v4l2src->v4l2object->can_poll_device = FALSE; + } else { + if (errno != EAGAIN && errno != EINTR) + goto select_error; + } + } } if (v4l2_ioctl (v4l2src->v4l2object->video_fd, VIDIOC_DQBUF, &buffer) >= 0) |