GNOME Bugzilla – Bug 456040
v4l2src init bug
Last modified: 2007-07-12 16:50:08 UTC
The v4l2src queue-size property is initialized to 0 causing: Pipeline is live and does not need PREROLL ... ERROR: from element /pipeline0/v4l2src0: Could not get buffers from device '/dev/video0'. Additional debug info: v4l2src_calls.c(1025): gst_v4l2src_capture_init (): /pipeline0/v4l2src0: error requesting 0 buffers: Cannot allocate memory ERROR: pipeline doesn't want to preroll. Setting pipeline to PAUSED ... The fix is: Index: sys/v4l2/gstv4l2src.c =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/sys/v4l2/gstv4l2src.c,v retrieving revision 1.83 diff -u -r1.83 gstv4l2src.c --- sys/v4l2/gstv4l2src.c 12 Jun 2007 11:23:00 -0000 1.83 +++ sys/v4l2/gstv4l2src.c 11 Jul 2007 21:33:16 -0000 @@ -298,7 +298,7 @@ gst_v4l2_get_input, gst_v4l2_set_input, NULL); /* number of buffers requested */ - v4l2src->num_buffers = 0; + v4l2src->num_buffers = GST_V4L2_MIN_BUFFERS; v4l2src->formats = NULL;
This is addressed in the patch attached to bug #451388. That patch hasn't been applied yet afaik because noone has had time to test it. If you could verify the patch there, that would be very useful. *** This bug has been marked as a duplicate of 451388 ***
Bug #451388 is a different bug unique to the submitter's video device. His patch covers more than one bug, including this one. His fix #1 does exactly the same as the fix I provided above. So as far as fix #1 goes, I can verify it works. Without the fix the user needs to set the queue-size (since queue-size of zero leads to the above error): gst-launch-0.10 v4l2src queue-size=2 ! xvimagesink with the fix its no longer necessary: gst-launch-0.10 v4l2src ! xvimagesink
True - it does more than your patch. Before I think about committing it, it'd be nice if someone else (you) told me it doesn't break *their* device :)
This is device independant.. The valid range for the 'queue-size' property is 2 - 16, yet it is initialized to 0. So *anyone* using v4l2src should experience this bug unless they set queue-size to a valid value. $ gst-inspect v4l2src . . . queue-size : Number of buffers to be enqueud in the driver flags: readable, writable Unsigned Integer. Range: 2 - 16 Default: 2 Current: 0