2005-03-22 11:32:59 +00:00
|
|
|
GstPipeline
|
|
|
|
-----------
|
|
|
|
|
2005-11-03 14:22:44 +00:00
|
|
|
A GstPipeline is usually a toplevel bin and provides all of its
|
2005-07-06 17:17:59 +00:00
|
|
|
children with a clock.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2005-09-24 14:14:03 +00:00
|
|
|
A GstPipeline also provides a toplevel GstBus (see part-gstbus.txt)
|
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
The pipeline also calculates the running_time based on the selected
|
2007-03-07 17:13:17 +00:00
|
|
|
clock (see also clocks.txt and part-synchronisation.txt).
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2007-03-07 17:13:17 +00:00
|
|
|
The pipeline will calculate a global latency for the elements in the pipeline.
|
|
|
|
(See also part-latency.txt).
|
2005-03-22 11:32:59 +00:00
|
|
|
|
2005-04-21 09:37:34 +00:00
|
|
|
State changes
|
|
|
|
-------------
|
|
|
|
|
|
|
|
In addition to the normal state change procedure of its parent class
|
|
|
|
GstBin, the pipeline performs the following actions during a state change:
|
|
|
|
|
2005-10-08 16:49:15 +00:00
|
|
|
- NULL -> READY:
|
|
|
|
- set the bus to non-flushing
|
|
|
|
|
2005-04-21 09:37:34 +00:00
|
|
|
- READY -> PAUSED:
|
2007-02-15 11:32:02 +00:00
|
|
|
- reset the running_time to 0
|
2005-10-08 16:49:15 +00:00
|
|
|
|
|
|
|
- PAUSED -> PLAYING:
|
2006-03-13 10:32:26 +00:00
|
|
|
- Select and a clock.
|
2007-02-15 11:32:02 +00:00
|
|
|
- calculate base_time using the running_time.
|
2007-03-07 17:13:17 +00:00
|
|
|
- calculate and distribute latency.
|
2007-02-15 11:32:02 +00:00
|
|
|
- set clock and base_time on all elements before performing the
|
2006-03-13 10:32:26 +00:00
|
|
|
state change.
|
2005-04-21 09:37:34 +00:00
|
|
|
|
|
|
|
- PAUSED -> PLAYING:
|
2007-09-24 11:22:26 +00:00
|
|
|
- calculate the running_time when the pipeline was PAUSED.
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-10-08 16:49:15 +00:00
|
|
|
- READY -> NULL:
|
2006-03-13 10:32:26 +00:00
|
|
|
- set the bus to flushing (when auto-flushing is enabled)
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2007-02-15 11:32:02 +00:00
|
|
|
The running_time represents the total elapsed time, measured in clock units,
|
2007-03-07 17:13:17 +00:00
|
|
|
that the pipeline spent in the PLAYING state (see part-synchronisation.txt).
|
2007-09-24 11:22:26 +00:00
|
|
|
The running_time is set to 0 after a flushing seek.
|
2007-02-15 11:32:02 +00:00
|
|
|
|
2005-04-21 09:37:34 +00:00
|
|
|
|
2005-03-22 11:32:59 +00:00
|
|
|
Clock selection
|
|
|
|
---------------
|
|
|
|
|
|
|
|
Since all of the children of a GstPipeline must use the same clock, the
|
2007-02-15 11:32:02 +00:00
|
|
|
pipeline must select a clock. This clock selection happens when the pipeline
|
2007-03-07 17:13:17 +00:00
|
|
|
goes to the PLAYING state.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
|
|
|
The default clock selection algorithm works as follows:
|
|
|
|
|
|
|
|
- If the application selected a clock, use that clock. (see below)
|
|
|
|
|
2006-03-13 10:32:26 +00:00
|
|
|
- Use the clock of most upstream element that can provide a clock. This
|
|
|
|
selection is performed by iterating the element starting from the
|
|
|
|
sinks going upstream.
|
|
|
|
|
|
|
|
* since this selection procedure happens in the PAUSED->PLAYING
|
|
|
|
state change, all the sinks are prerolled and we can thus be sure
|
|
|
|
that each sink is linked to some upstream element.
|
2007-02-15 11:32:02 +00:00
|
|
|
* in the case of a live pipeline (NO_PREROLL), the sink will not yet
|
2006-03-13 10:32:26 +00:00
|
|
|
be prerolled and the selection process will select the clock of
|
|
|
|
a more upstream element.
|
|
|
|
|
|
|
|
- use GstSystemClock, this only happens when no element provides a
|
2007-03-07 17:13:17 +00:00
|
|
|
usable clock.
|
2005-03-22 11:32:59 +00:00
|
|
|
|
|
|
|
The application can influence this clock selection with two methods:
|
|
|
|
gst_pipeline_use_clock() and gst_pipeline_auto_clock().
|
|
|
|
|
|
|
|
The _use_clock() method forces the use of a specific clock on the pipeline
|
|
|
|
regardless of what clock providers are children of the pipeline. Setting
|
|
|
|
NULL disables the clock completely and makes the pipeline run as fast as
|
|
|
|
possible.
|
|
|
|
|
|
|
|
The _auto_clock() method removes the fixed clock and reactivates the auto-
|
|
|
|
matic clock selection algorithm described above.
|
|
|
|
|
2007-03-07 17:13:17 +00:00
|
|
|
|
|
|
|
GstBus
|
|
|
|
------
|
|
|
|
|
|
|
|
A GstPipeline provides a GstBus to the application. The bus can be retrieved
|
|
|
|
with gst_pipeline_get_bus() and can then be used to retrieve messages posted by
|
|
|
|
the elements in the pipeline (see part-gstbus.txt).
|
|
|
|
|