+2005-11-03 Wim Taymans <wim@fluendo.com>
+
+ * docs/design/part-events.txt:
+ * docs/design/part-gstpipeline.txt:
+ * docs/design/part-messages.txt:
+ * docs/design/part-overview.txt:
+ * docs/design/part-seeking.txt:
+ * docs/design/part-states.txt:
+ * docs/design/part-trickmodes.txt:
+ * docs/manual/advanced-position.xml:
+ Small docs updates.
+
+ * gst/gstobject.h:
+ People think !! is ugly, this looks better.
+
+ * gst/gstpad.c: (gst_pad_set_blocked_async):
+ Remove !! since it's fixed elsewhere now.
+
2005-11-03 Tim-Philipp Müller <tim at centricular dot net>
* gst/gstminiobject.h:
If a newsegment arrives at an element not preceeded by a flush event, the
streamtime of the pipeline will not be reset to 0 so any element that syncs
to the clock must use the stop times of the previous newsegment events to
-make the buffer timestamps increasing.
+make the buffer timestamps increasing (part-segments.txt).
TAG
---
also contains the new playback rate of the stream, 1.0 is normal playback,
2.0 double speed and negative values mean backwards playback.
-A seek usually flushes the graph to minimize latency after the seek this
+A seek usually flushes the graph to minimize latency after the seek. This
behaviour is triggered by using the SEEK_FLUSH flag.
The seek event is passed along from element to element until it reaches
4) send a FLUSH_STOP event to all peer elements to allow streaming again.
5) send a NEWSEGMENT event to signal the new buffer timestamp base time.
+ This can also be done from the streaming thread.
6) start stopped tasks and unlock the STREAM_LOCK, dataflow will continue
now from the new position.
GstPipeline
-----------
-A GstPipeline is usually a toplevel bin an provides all of its
+A GstPipeline is usually a toplevel bin and provides all of its
children with a clock.
A GstPipeline also provides a toplevel GstBus (see part-gstbus.txt)
GST_MESSAGE_EOS:
- The pipeline went to EOS. This means that all the sink elements in the
- pipeline posted the EOS message to the bus.
+ Posted by sink elements. This message is posted to the application when
+ all the sinks in a pipeline posted an EOS message. When performing a seek,
+ the EOS state of the pipeline and sinks is undone.
GST_MESSAGE_ERROR:
GST_MESSAGE_STREAM_STATUS:
- An element posted information about the stream it is handling. This could include
- information about the length of the stream.
+ An element posted information about the stream it is handling. This could include
+ information about the length of the stream.
GST_MESSAGE_APPLICATION:
to the application.
When in EOS, the pipeline remains in the playing state, if is the application
- responsability to PAUSE or READY the pipeline.
+ responsability to PAUSE or READY the pipeline. The application can also issue
+ a seek, for example.
Pipeline READY
to produce new data.
Since the pipeline is still PAUSED, this will preroll the next media sample in the
- sinks.
+ sinks. The application can wait for this preroll to complete by performing a
+ _get_state() on the pipeline.
The last step in the seek operation is then to adjust the stream time of the pipeline
to 0 and to set the pipeline back to PLAYING.
- The sequence of events in out mp3 playback example.
+ The sequence of events in our mp3 playback example.
| a) seek on pipeline
| b) PAUSE pipeline
or samples.
Seeking can be performed to an absolute position or relative to the
-current playback position.
+current configured segment.
For seeking to work reliably, all plugins in the pipeline need to follow
the well-defined rules in this document.
Non segment seeking will make the pipeline emit EOS when the configured
-playback range has been played.
+segment has been played.
Segment seeking will not emit an EOS at the end of the range but will
-post a SEGMENT_STOP message on the bus. This message is posted by the
+post a SEGMENT_DONE message on the bus. This message is posted by the
earliest element in the pipeline, typically a demuxer. After receiving
the message, the application can reconnect the pipeline or issue other
seek events in the pipeline.
State variables
---------------
-An element has a special lock to manage the state changes. This lock is called
-the STATE_LOCK.
-
-The STATE_LOCK protects 3 element variables:
+An element has 4 state variables that are protected with the object LOCK:
- STATE
- STATE_NEXT
The STATE_NEXT and STATE_PENDING can be VOID_PENDING if the element is in
the right state.
+An element has a special lock to protect against concurrent invocations of
+_set_state(), called the STATE_LOCK.
+
+
Setting state on elements
-------------------------
--- /dev/null
+Trickmodes
+==========
+
+
+forward playback
+----------------
+
+
+
+
+
+backwards playback
+------------------
seek_to_time (GstElement *pipeline,
gint64 time_nanoseconds)
{
- GstFormat format = GST_FORMAT_TIME;
-
- if (!gst_element_seek (pipeline, 1.0, &format, GST_SEEK_FLAG_FLUSH,
+ if (!gst_element_seek (pipeline, 1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, time_nanoseconds,
GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) {
g_print ("Seek failed!\n");
*
* This macro checks to see if the given flag is set.
*/
-#define GST_OBJECT_FLAG_IS_SET(obj,flag) !!(GST_OBJECT_FLAGS (obj) & (flag))
+#define GST_OBJECT_FLAG_IS_SET(obj,flag) ((GST_OBJECT_FLAGS (obj) & (flag)) == (flag))
/**
* GST_OBJECT_FLAG_SET:
* @obj: Object to set flag in.
GST_LOCK (pad);
- was_blocked = !!GST_PAD_IS_BLOCKED (pad);
+ was_blocked = GST_PAD_IS_BLOCKED (pad);
if (G_UNLIKELY (was_blocked == blocked))
goto had_right_state;