summaryrefslogtreecommitdiffstats
path: root/sys/v4l2/v4l2_calls.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/v4l2/v4l2_calls.c')
-rw-r--r--sys/v4l2/v4l2_calls.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c
index a6b4b7dc..b1875a88 100644
--- a/sys/v4l2/v4l2_calls.c
+++ b/sys/v4l2/v4l2_calls.c
@@ -400,6 +400,7 @@ gst_v4l2_open (GstV4l2Object * v4l2object)
{
struct stat st;
int libv4l2_fd;
+ GstPollFD pollfd = GST_POLL_FD_INIT;
GST_DEBUG_OBJECT (v4l2object->element, "Trying to open device %s",
v4l2object->videodev);
@@ -453,6 +454,10 @@ gst_v4l2_open (GstV4l2Object * v4l2object)
"Opened device '%s' (%s) successfully",
v4l2object->vcap.card, v4l2object->videodev);
+ pollfd.fd = v4l2object->video_fd;
+ gst_poll_add_fd (v4l2object->poll, &pollfd);
+ gst_poll_fd_ctl_read (v4l2object->poll, &pollfd, TRUE);
+
return TRUE;
/* ERRORS */
@@ -508,6 +513,7 @@ error:
gboolean
gst_v4l2_close (GstV4l2Object * v4l2object)
{
+ GstPollFD pollfd = GST_POLL_FD_INIT;
GST_DEBUG_OBJECT (v4l2object->element, "Trying to close %s",
v4l2object->videodev);
@@ -516,6 +522,8 @@ gst_v4l2_close (GstV4l2Object * v4l2object)
/* close device */
v4l2_close (v4l2object->video_fd);
+ pollfd.fd = v4l2object->video_fd;
+ gst_poll_remove_fd (v4l2object->poll, &pollfd);
v4l2object->video_fd = -1;
/* empty lists */