v4l2sink: Improve behavior for shared buffers.

When the decoder is using pad_alloc(), v4l2sink would behave badly if
the number of buffers ('queue-size' property) was not high enough to
account for all the buffers needed by the decoder, and other elements
(such as queues) between the decoder and v4l2sink.  This patch
slightly increases the default number of buffers, and changes v4l2sink
to drop frames rather than return an error in case the number of
buffers is not high enough.
This commit is contained in:
Rob Clark 2010-04-04 06:22:43 -05:00
parent 82ee35372b
commit 48a8b53bdd

View file

@ -56,7 +56,7 @@
GST_DEBUG_CATEGORY (v4l2sink_debug);
#define GST_CAT_DEFAULT v4l2sink_debug
#define PROP_DEF_QUEUE_SIZE 8
#define PROP_DEF_QUEUE_SIZE 12
#define DEFAULT_PROP_DEVICE "/dev/video1"
enum
@ -670,7 +670,9 @@ gst_v4l2sink_show_frame (GstBaseSink * bsink, GstBuffer * buf)
&newbuf);
if (GST_FLOW_OK != ret) {
return ret;
GST_DEBUG_OBJECT (v4l2sink,
"dropping frame! Consider increasing 'queue-size' property!");
return GST_FLOW_OK;
}
memcpy (GST_BUFFER_DATA (newbuf),