From 48a8b53bdde342b3536143a84175a21a12ea1aea Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 4 Apr 2010 06:22:43 -0500 Subject: [PATCH] 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. --- sys/v4l2/gstv4l2sink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c index 1fde82c292..9bef34fb04 100644 --- a/sys/v4l2/gstv4l2sink.c +++ b/sys/v4l2/gstv4l2sink.c @@ -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),