[gst-cvs] gst-plugins-good: v4l2src: Set duration on buffers

Thiago Sousa Santos thiagoss at kemper.freedesktop.org
Wed Oct 14 04:02:02 PDT 2009


Module: gst-plugins-good
Branch: master
Commit: 72af90ae31907964b31c368164ec17d0f72aa7bf
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=72af90ae31907964b31c368164ec17d0f72aa7bf

Author: Thiago Santos <thiagoss at embedded.ufcg.edu.br>
Date:   Wed Oct 14 07:38:26 2009 -0300

v4l2src: Set duration on buffers

Use framerate to estimate duration of buffers.

Fixes #590362

---

 sys/v4l2/gstv4l2src.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index 1178f5a..581ef5c 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;
 }





More information about the Gstreamer-commits mailing list