Gst.Pipeline¶
- Subclasses:
None
Methods¶
- Inherited:
Gst.Bin (18), Gst.Element (82), Gst.Object (27), GObject.Object (37), Gst.ChildProxy (9)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Whether to automatically flush the pipeline’s bus when going from READY into |
||
r/w |
Expected delay needed for elements to spin up to PLAYING in nanoseconds |
||
r/w |
Latency to configure on the pipeline |
Signals¶
- Inherited:
Gst.Bin (5), Gst.Element (3), Gst.Object (1), GObject.Object (1), Gst.ChildProxy (2)
Fields¶
- Inherited:
Gst.Bin (5), Gst.Element (3), Gst.Object (1), GObject.Object (1), Gst.ChildProxy (2)
Name |
Type |
Access |
Description |
---|---|---|---|
bin |
r |
||
delay |
r |
Extra delay added to base_time to compensate for computing delays when setting elements to PLAYING. |
|
fixed_clock |
r |
The fixed clock of the pipeline, used when |
|
stream_time |
r |
The stream time of the pipeline. A better name for this property would be the running_time, the total time spent in the PLAYING state without being flushed. (deprecated, use the start_time on |
Class Details¶
- class Gst.Pipeline(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A
Gst.Pipeline
is a specialGst.Bin
used as the toplevel container for the filter graph. TheGst.Pipeline
will manage the selection and distribution of a globalGst.Clock
as well as provide aGst.Bus
to the application.Gst.Pipeline.new
() is used to create a pipeline. when you are done with the pipeline, useGst.Object.unref
() to free its resources including all addedGst.Element
objects (if not otherwise referenced).Elements are added and removed from the pipeline using the
Gst.Bin
methods likeGst.Bin.add
() andGst.Bin.remove
() (seeGst.Bin
).Before changing the state of the
Gst.Pipeline
(seeGst.Element
) aGst.Bus
should be retrieved withGst.Pipeline.get_bus
(). ThisGst.Bus
should then be used to receiveGst.Message
from the elements in the pipeline. Listening to theGst.Bus
is necessary for retrieving error messages from theGst.Pipeline
and otherwise theGst.Pipeline
might stop without any indication, why. Furthermore, theGst.Pipeline
posts messages even if nobody listens on theGst.Bus
, which will pile up and use up memory.By default, a
Gst.Pipeline
will automatically flush the pendingGst.Bus
messages when going to theNone
state to ensure that no circular references exist when no messages are read from theGst.Bus
. This behaviour can be changed withGst.Pipeline.set_auto_flush_bus
().When the
Gst.Pipeline
performs the PAUSED to PLAYING state change it will select a clock for the elements. The clock selection algorithm will by default select a clock provided by an element that is most upstream (closest to the source). For live pipelines (ones that returnGst.StateChangeReturn.NO_PREROLL
from theGst.Element.set_state
() call) this will select the clock provided by the live source. For normal pipelines this will select a clock provided by the sinks (most likely the audio sink). If no element provides a clock, a defaultGst.SystemClock
is used.The clock selection can be controlled with the
Gst.Pipeline.use_clock
() method, which will enforce a given clock on the pipeline. WithGst.Pipeline.auto_clock
() the default clock selection algorithm can be restored.A
Gst.Pipeline
maintains a running time for the elements. The running time is defined as the difference between the current clock time and the base time. When the pipeline goes to READY or a flushing seek is performed on it, the running time is reset to 0. When the pipeline is set from PLAYING to PAUSED, the current clock time is sampled and used to configure the base time for the elements when the pipeline is set to PLAYING again. The effect is that the running time (as the difference between the clock time and the base time) will count how much time was spent in the PLAYING state. This default behaviour can be changed with theGst.Element.set_start_time
() method.- classmethod new(name)[source]¶
- Parameters:
- Returns:
newly created
Gst.Pipeline
MT safe.
- Return type:
Create a new pipeline with the given name.
- auto_clock()[source]¶
Let self select a clock automatically. This is the default behaviour.
Use this function if you previous forced a fixed clock with
Gst.Pipeline.use_clock
() and want to restore the default pipeline clock selection algorithm.MT safe.
- get_auto_flush_bus()[source]¶
- Returns:
whether the pipeline will automatically flush its bus when going from READY to
None
state or not.MT safe.
- Return type:
Check if self will automatically flush messages when going to the
None
state.
- get_bus()[source]¶
-
Gets the
Gst.Bus
of self. The bus allows applications to receiveGst.Message
packets.
- get_configured_latency()[source]¶
- Returns:
self configured latency, or
Gst.CLOCK_TIME_NONE
if none has been configured because self did not reach the PLAYING state yet.MT safe.
- Return type:
Return the configured latency on self.
New in version 1.24.
- get_delay()[source]¶
- Returns:
The configured delay.
MT safe.
- Return type:
Get the configured delay (see
Gst.Pipeline.set_delay
()).
- get_latency()[source]¶
- Returns:
Latency to configure on the pipeline or
Gst.CLOCK_TIME_NONE
- Return type:
Gets the latency that should be configured on the pipeline. See
Gst.Pipeline.set_latency
().New in version 1.6.
- get_pipeline_clock()[source]¶
-
Gets the current clock used by self.
Unlike
Gst.Element.get_clock
(), this function will always return a clock, even if the pipeline is not in the PLAYING state.New in version 1.6.
- is_live()[source]¶
- Returns:
True
if self is live,False
if not or if it did not reach the PAUSED state yet.MT safe.
- Return type:
Check if self is live.
New in version 1.24.
- set_auto_flush_bus(auto_flush)[source]¶
- Parameters:
auto_flush (
bool
) – whether or not to automatically flush the bus when the pipeline goes from READY toNone
state
Usually, when a pipeline goes from READY to
None
state, it automatically flushes all pending messages on the bus, which is done for refcounting purposes, to break circular references.This means that applications that update state using (async) bus messages (e.g. do certain things when a pipeline goes from PAUSED to READY) might not get to see messages when the pipeline is shut down, because they might be flushed before they can be dispatched in the main thread. This behaviour can be disabled using this function.
It is important that all messages on the bus are handled when the automatic flushing is disabled else memory leaks will be introduced.
MT safe.
- set_delay(delay)[source]¶
- Parameters:
delay (
int
) – the delay
Set the expected delay needed for all elements to perform the PAUSED to PLAYING state change. delay will be added to the base time of the elements so that they wait an additional delay amount of time before starting to process buffers and cannot be
Gst.CLOCK_TIME_NONE
.This option is used for tuning purposes and should normally not be used.
MT safe.
- set_latency(latency)[source]¶
- Parameters:
latency (
int
) – latency to configure
Sets the latency that should be configured on the pipeline. Setting
Gst.CLOCK_TIME_NONE
will restore the default behaviour of using the minimum latency from the LATENCY query. Setting this is usually not required and the pipeline will figure out an appropriate latency automatically.Setting a too low latency, especially lower than the minimum latency from the LATENCY query, will most likely cause the pipeline to fail.
New in version 1.6.
Property Details¶
- Gst.Pipeline.props.auto_flush_bus¶
-
Whether or not to automatically flush all messages on the pipeline’s bus when going from READY to
None
state. Please seeGst.Pipeline.set_auto_flush_bus
() for more information on this option.
- Gst.Pipeline.props.delay¶
-
The expected delay needed for elements to spin up to the PLAYING state expressed in nanoseconds. see
Gst.Pipeline.set_delay
() for more information on this option.
- Gst.Pipeline.props.latency¶
-
Latency to configure on the pipeline. See
Gst.Pipeline.set_latency
().New in version 1.6.