summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@embedded.ufcg.edu.br>2009-10-14 07:38:26 -0300
committerThiago Santos <thiagoss@embedded.ufcg.edu.br>2009-10-14 08:00:49 -0300
commit72af90ae31907964b31c368164ec17d0f72aa7bf (patch)
tree6e8ef74352414cbc00b86a2804a0c817d0a2f206
parent58b9de4cca8b0f9da0742202e190457801118d33 (diff)
v4l2src: Set duration on buffers
Use framerate to estimate duration of buffers. Fixes #590362
-rw-r--r--sys/v4l2/gstv4l2src.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index 1178f5a8..581ef5ca 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;
}