From 72af90ae31907964b31c368164ec17d0f72aa7bf Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 14 Oct 2009 07:38:26 -0300 Subject: [PATCH] v4l2src: Set duration on buffers Use framerate to estimate duration of buffers. Fixes #590362 --- sys/v4l2/gstv4l2src.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index 1178f5a811..581ef5ca3b 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -906,6 +906,7 @@ gst_v4l2src_create (GstPushSrc * src, GstBuffer ** buf) if (G_LIKELY (ret == GST_FLOW_OK && *buf)) { GstClock *clock; GstClockTime timestamp; + GstClockTime duration = GST_CLOCK_TIME_NONE; GST_BUFFER_OFFSET (*buf) = v4l2src->offset++; GST_BUFFER_OFFSET_END (*buf) = v4l2src->offset; @@ -938,11 +939,14 @@ gst_v4l2src_create (GstPushSrc * src, GstBuffer ** buf) timestamp -= latency; else timestamp = 0; + + duration = latency; } } /* FIXME: use the timestamp from the buffer itself! */ GST_BUFFER_TIMESTAMP (*buf) = timestamp; + GST_BUFFER_DURATION (*buf) = duration; } return ret; }