diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-03-01 19:55:26 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-03-01 19:55:26 +0100 |
commit | b6755a70004a445a475e6c4b1c2d289e908cf2a9 (patch) | |
tree | d6e4111b21d477cdfdbc4e3f84af1ead54ec2550 /sys/v4l2/gstv4l2object.c | |
parent | 7087da96dc850a931f7fca4c036fb0a2c58f04ac (diff) |
Wait for a frame to become available before capturing it
Use GstPoll to wait for the fd of the video device to become readable before
trying to capture a frame. This speeds up stopping v4l2src a lot as it no
longer has to wait for the next frame, especially when capturing with low
framerates or when the video device just never generates a frame (which seems a
common issue for uvcvideo devices)
Fixes bug #563574.
Diffstat (limited to 'sys/v4l2/gstv4l2object.c')
-rw-r--r-- | sys/v4l2/gstv4l2object.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index ffc1046d..d848ccf3 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -270,6 +270,7 @@ gst_v4l2_object_new (GstElement * element, v4l2object->update_fps_func = update_fps_func; v4l2object->video_fd = -1; + v4l2object->poll = gst_poll_new (TRUE); v4l2object->buffer = NULL; v4l2object->videodev = g_strdup (DEFAULT_PROP_DEVICE); @@ -290,6 +291,9 @@ gst_v4l2_object_destroy (GstV4l2Object * v4l2object) if (v4l2object->videodev) g_free (v4l2object->videodev); + if (v4l2object->poll) + gst_poll_free (v4l2object->poll); + if (v4l2object->channel) g_free (v4l2object->channel); |