+2005-07-19 Wim Taymans <wim@fluendo.com>
+
+ * docs/design/part-clocks.txt:
+ * docs/design/part-events.txt:
+ * gst/base/gstbasesrc.c: (gst_base_src_do_seek):
+ Small docs updates.
+ Only update the seeking values when we are not
+ busy streaming.
+
2005-07-19 Jan Schmidt <thaytan@mad.scientist.com>
* gst/base/gstbasesrc.c: (gst_base_src_loop):
to PLAYING state change. All elements are therefore able to convert the
stream time to the absolute time. It is possible to specify an aditional
delay to the base time to compensate for the delay it takes to perform
-the state change.
+the state change using the GstPipeline "delay" property.
Clock features
point for all next buffer's timestamps has to be propagated through the
pipeline using the DISCONT event.
+Before sending buffers, an element must send a DISCONT event. An element is
+free to refuse buffers if they were not preceeded by a DISCONT event.
+
Elements that sync to the clock should store the DISCONT start and end values
and substract the start value from the buffer timestamp before comparing
it against the stream time (see part-clocks.txt).
DISCONT downstream, ie, one with start time 0.
A DISCONT event should be generated as soon as possible in the pipeline and
-is usually generated by a demuxer. The event is generated before pushing the
-first buffer and after a seek, right before pushing the new buffer.
+is usually generated by a demuxer or source. The event is generated before
+pushing the first buffer and after a seek, right before pushing the new buffer.
The DISCONT event can be send from both the application and the streaming
thread and should be serialized with the buffers.
-
SEEK
----
offset = GST_EVENT_SEEK_OFFSET (event);
src->segment_loop = GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_SEGMENT_LOOP;
+ /* send flush start */
+ gst_pad_push_event (src->srcpad, gst_event_new_flush (FALSE));
+
+ /* unblock streaming thread */
+ gst_base_src_unlock (src);
+
+ /* grab streaming lock */
+ GST_STREAM_LOCK (src->srcpad);
+
+ /* send flush end */
+ gst_pad_push_event (src->srcpad, gst_event_new_flush (TRUE));
+
+ /* perform the seek */
switch (GST_EVENT_SEEK_METHOD (event)) {
case GST_SEEK_METHOD_SET:
if (offset < 0)
goto error;
}
- /* send flush start */
- gst_pad_push_event (src->srcpad, gst_event_new_flush (FALSE));
-
- /* unblock streaming thread */
- gst_base_src_unlock (src);
-
- /* grab streaming lock */
- GST_STREAM_LOCK (src->srcpad);
-
- /* send flush end */
- gst_pad_push_event (src->srcpad, gst_event_new_flush (TRUE));
-
/* now send discont */
gst_base_src_send_discont (src);
error:
{
GST_DEBUG_OBJECT (src, "seek error");
+ GST_STREAM_UNLOCK (src->srcpad);
gst_event_unref (event);
return FALSE;
}
offset = GST_EVENT_SEEK_OFFSET (event);
src->segment_loop = GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_SEGMENT_LOOP;
+ /* send flush start */
+ gst_pad_push_event (src->srcpad, gst_event_new_flush (FALSE));
+
+ /* unblock streaming thread */
+ gst_base_src_unlock (src);
+
+ /* grab streaming lock */
+ GST_STREAM_LOCK (src->srcpad);
+
+ /* send flush end */
+ gst_pad_push_event (src->srcpad, gst_event_new_flush (TRUE));
+
+ /* perform the seek */
switch (GST_EVENT_SEEK_METHOD (event)) {
case GST_SEEK_METHOD_SET:
if (offset < 0)
goto error;
}
- /* send flush start */
- gst_pad_push_event (src->srcpad, gst_event_new_flush (FALSE));
-
- /* unblock streaming thread */
- gst_base_src_unlock (src);
-
- /* grab streaming lock */
- GST_STREAM_LOCK (src->srcpad);
-
- /* send flush end */
- gst_pad_push_event (src->srcpad, gst_event_new_flush (TRUE));
-
/* now send discont */
gst_base_src_send_discont (src);
error:
{
GST_DEBUG_OBJECT (src, "seek error");
+ GST_STREAM_UNLOCK (src->srcpad);
gst_event_unref (event);
return FALSE;
}