<div dir="ltr"><div>Thanks Sebastian. In your response you talked about "running time" and used the word "timestamp" but we still have the question: </div><div> </div><div>For live sources: does this mean that if a buffer was captured live at time 1934234.34, the timestamp is also 1934234.34?</div>
<div> </div><div> </div><div>Asked another way: With a live source, what is the timestamp of the first buffer? Zero. Or is it something else? If so, what? From reading the documentation it sounds like it may be zero but we're not clear.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 17, 2013 at 11:50 AM, Sebastian Dröge <span dir="ltr"><<a href="mailto:slomo@coaxion.net" target="_blank">slomo@coaxion.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Do, 2013-10-17 at 09:31 -0700, Bob Barker wrote:<br>
> Hi All,<br>
><br>
> We’re new to GStreamer, writing our own elements and trying to understand<br>
> the implications of these excerpts from the GStreamer Plugin Writers Guide:<br>
><br>
> Sec 18.4.1 Non-live source elements<br>
><br>
> “They must choose the timestamps and the values of the SEGMENT event in<br>
> such a way that the<br>
><br>
</div>> *running-time of the buffer starts from 0.” *<br>
<div class="im">><br>
> Sec 18.4.2 Live Source Elements<br>
><br>
> They must choose the timestamps and the values of the SEGMENT event in such<br>
</div>> a way that the *running-time of the buffer* *matches exactly the<br>
<div class="im">> running-time of the pipeline clock when the first byte in the buffer was<br>
</div>> captured.*<br>
<div class="im">><br>
> Questions:<br>
><br>
> -For live sources: does this mean that if a buffer was captured live at<br>
> time 1934234.34, the timestamp is also 1934234.34?<br>
<br>
</div>The timestamp alone is irrelevant here. Important is the relation of the<br>
timestamp with the configured segment. The running time of every buffer<br>
should be equivalent to the running time of the clock when the buffer<br>
was captured. That means that the running time of that buffer should be<br>
the current clock time (of the current pipeline clock) minus the base<br>
time of the pipeline.<br>
<br>
The running time of the buffer is calculated from the timestamp of the<br>
buffer and the segment information as is done in the code of<br>
gst_segment_to_running_time(), basically (for positive rate):<br>
rtime = segment.base + segment.rate*(timestamp - (segment.start + segment.offset))<br>
<div class="im"><br>
> -For live sources: When is the base time snapped? When the sensor captures<br>
> the first sample? When the first element retrieves the first sample?<br>
<br>
</div>When the element reaches the PLAYING state, so very soon after it is set<br>
to PLAYING.<br>
<div class="im"><br>
> We went through the tutorial at<br>
><br>
> <a href="http://docs.gstreamer.com/display/GstSDK/Tutorials" target="_blank">http://docs.gstreamer.com/display/GstSDK/Tutorials</a><br>
><br>
> and couldn’t find anything explaining this. If there’s some documentation<br>
> clarifying all this, please point us at it.<br>
<br>
</div>That documentation is only targeted at playback use cases from the<br>
application side (and only for 0.10 anyway). The only documentation I'm<br>
aware of that contains these things is the design documentation in<br>
gstreamer/docs/design.<br>
<br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div>