summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2012-09-05 16:39:31 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2013-09-13 16:29:46 +0200
commit438b53e7f2152bde8e3a5b90d627af3c77d143d1 (patch)
tree86222cc21ddcef77c662798fac6c5d9787c1e6d5
parent9af04d80a5238b529f03724d884ed594da9077dd (diff)
downloadgst-plugins-good-438b53e7f2152bde8e3a5b90d627af3c77d143d1.tar.gz
gst-plugins-good-438b53e7f2152bde8e3a5b90d627af3c77d143d1.tar.xz
v4l2: also poll for output devices
Note that the V4L2 API defines that for output devices POLLOUT indicates that a buffer is ready to be dequeued. https://bugzilla.gnome.org/show_bug.cgi?id=698992
-rw-r--r--sys/v4l2/gstv4l2bufferpool.c9
-rw-r--r--sys/v4l2/v4l2_calls.c5
2 files changed, 6 insertions, 8 deletions
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
index 9abcbd179..274b44e39 100644
--- a/sys/v4l2/gstv4l2bufferpool.c
+++ b/sys/v4l2/gstv4l2bufferpool.c
@@ -634,13 +634,8 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer)
GstV4l2Object *obj = pool->obj;
GstClockTime timestamp;
- if (obj->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
- /* select works for input devices when data is available. According to the
- * specs we can also poll to find out when a frame has been displayed but
- * that just seems to lock up here */
- if ((res = gst_v4l2_object_poll (obj)) != GST_FLOW_OK)
- goto poll_error;
- }
+ if ((res = gst_v4l2_object_poll (obj)) != GST_FLOW_OK)
+ goto poll_error;
memset (&vbuffer, 0x00, sizeof (vbuffer));
vbuffer.type = obj->type;
diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c
index 2fcb53219..6946e1b88 100644
--- a/sys/v4l2/v4l2_calls.c
+++ b/sys/v4l2/v4l2_calls.c
@@ -480,7 +480,10 @@ gst_v4l2_open (GstV4l2Object * v4l2object)
pollfd.fd = v4l2object->video_fd;
gst_poll_add_fd (v4l2object->poll, &pollfd);
- gst_poll_fd_ctl_read (v4l2object->poll, &pollfd, TRUE);
+ if (v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ gst_poll_fd_ctl_read (v4l2object->poll, &pollfd, TRUE);
+ else
+ gst_poll_fd_ctl_write (v4l2object->poll, &pollfd, TRUE);
return TRUE;