Pipeline

A #GstPipeline is a special #GstBin used as the toplevel container for the filter graph. The #GstPipeline will manage the selection and distribution of a global #GstClock as well as provide a #GstBus to the application.

gst.pipeline.Pipeline.new_ is used to create a pipeline. when you are done with the pipeline, use gst.object.ObjectGst.unref to free its resources including all added #GstElement objects (if not otherwise referenced).

Elements are added and removed from the pipeline using the #GstBin methods like gst.bin.Bin.add and gst.bin.Bin.remove (see #GstBin).

Before changing the state of the #GstPipeline (see #GstElement) a #GstBus should be retrieved with gst.pipeline.Pipeline.getBus. This #GstBus should then be used to receive #GstMessage from the elements in the pipeline. Listening to the #GstBus is necessary for retrieving error messages from the #GstPipeline and otherwise the #GstPipeline might stop without any indication, why. Furthermore, the #GstPipeline posts messages even if nobody listens on the #GstBus, which will pile up and use up memory.

By default, a #GstPipeline will automatically flush the pending #GstBus messages when going to the NULL state to ensure that no circular references exist when no messages are read from the #GstBus. This behaviour can be changed with gst.pipeline.Pipeline.setAutoFlushBus.

When the #GstPipeline 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 return #GST_STATE_CHANGE_NO_PREROLL from the gst.element.Element.setState 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 default #GstSystemClock is used.

The clock selection can be controlled with the gst.pipeline.Pipeline.useClock method, which will enforce a given clock on the pipeline. With gst.pipeline.Pipeline.autoClock the default clock selection algorithm can be restored.

A #GstPipeline 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 the gst.element.Element.setStartTime method.

Constructors

this
this(string name)

Create a new pipeline with the given name.

Members

Functions

autoClock
void autoClock()

Let pipeline select a clock automatically. This is the default behaviour.

getAutoFlushBus
bool getAutoFlushBus()

Check if pipeline will automatically flush messages when going to the NULL state.

getBus
gst.bus.Bus getBus()

Gets the #GstBus of pipeline. The bus allows applications to receive #GstMessage packets.

getConfiguredLatency
gst.types.ClockTime getConfiguredLatency()

Return the configured latency on pipeline.

getDelay
gst.types.ClockTime getDelay()

Get the configured delay (see gst.pipeline.Pipeline.setDelay).

getLatency
gst.types.ClockTime getLatency()

Gets the latency that should be configured on the pipeline. See gst.pipeline.Pipeline.setLatency.

getPipelineClock
gst.clock.Clock getPipelineClock()

Gets the current clock used by pipeline.

isLive
bool isLive()

Check if pipeline is live.

setAutoFlushBus
void setAutoFlushBus(bool autoFlush)

Usually, when a pipeline goes from READY to NULL state, it automatically flushes all pending messages on the bus, which is done for refcounting purposes, to break circular references.

setDelay
void setDelay(gst.types.ClockTime 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.

setLatency
void setLatency(gst.types.ClockTime latency)

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.

useClock
void useClock(gst.clock.Clock clock)

Force pipeline to use the given clock. The pipeline will always use the given clock even if new clock providers are added to this pipeline.

Inherited Members

From Bin

add
bool add(gst.element.Element element)

Adds the given element to the bin. Sets the element's parent, and thus takes ownership of the element. An element can only be added to one bin.

findUnlinkedPad
gst.pad.Pad findUnlinkedPad(gst.types.PadDirection direction)

Recursively looks for elements with an unlinked pad of the given direction within the specified bin and returns an unlinked pad if one is found, or null otherwise. If a pad is found, the caller owns a reference to it and should use gst.object.ObjectGst.unref on the pad when it is not needed any longer.

getByInterface
gst.element.Element getByInterface(gobject.types.GType iface)

Looks for an element inside the bin that implements the given interface. If such an element is found, it returns the element. You can cast this element to the given interface afterwards. If you want all elements that implement the interface, use gst.bin.Bin.iterateAllByInterface. This function recurses into child bins.

getByName
gst.element.Element getByName(string name)

Gets the element with the given name from a bin. This function recurses into child bins.

getByNameRecurseUp
gst.element.Element getByNameRecurseUp(string name)

Gets the element with the given name from this bin. If the element is not found, a recursion is performed on the parent bin.

getSuppressedFlags
gst.types.ElementFlags getSuppressedFlags()
iterateAllByElementFactoryName
gst.iterator.Iterator iterateAllByElementFactoryName(string factoryName)

Looks for all elements inside the bin with the given element factory name. The function recurses inside child bins. The iterator will yield a series of #GstElement.

iterateAllByInterface
gst.iterator.Iterator iterateAllByInterface(gobject.types.GType iface)

Looks for all elements inside the bin that implements the given interface. You can safely cast all returned elements to the given interface. The function recurses inside child bins. The iterator will yield a series of #GstElement.

iterateElements
gst.iterator.Iterator iterateElements()

Gets an iterator for the elements in this bin.

iterateRecurse
gst.iterator.Iterator iterateRecurse()

Gets an iterator for the elements in this bin. This iterator recurses into GstBin children.

iterateSinks
gst.iterator.Iterator iterateSinks()

Gets an iterator for all elements in the bin that have the #GST_ELEMENT_FLAG_SINK flag set.

iterateSorted
gst.iterator.Iterator iterateSorted()

Gets an iterator for the elements in this bin in topologically sorted order. This means that the elements are returned from the most downstream elements (sinks) to the sources.

iterateSources
gst.iterator.Iterator iterateSources()

Gets an iterator for all elements in the bin that have the #GST_ELEMENT_FLAG_SOURCE flag set.

recalculateLatency
bool recalculateLatency()

Queries bin for the current latency and reconfigures this latency on all the elements using a LATENCY event.

remove
bool remove(gst.element.Element element)

Removes the element from the bin, unparenting it as well. Unparenting the element means that the element will be dereferenced, so if the bin holds the only reference to the element, the element will be freed in the process of removing it from the bin. If you want the element to still exist after removing, you need to call gst.object.ObjectGst.ref_ before removing it from the bin.

setSuppressedFlags
void setSuppressedFlags(gst.types.ElementFlags flags)

Suppresses the given flags on the bin. #GstElementFlags of a child element are propagated when it is added to the bin. When suppressed flags are set, those specified flags will not be propagated to the bin.

syncChildrenStates
bool syncChildrenStates()

Synchronizes the state of every child of bin with the state of bin. See also gst.element.Element.syncStateWithParent.

connectDeepElementAdded
ulong connectDeepElementAdded(T callback, Flag!"After" after)

Connect to DeepElementAdded signal.

connectDeepElementRemoved
ulong connectDeepElementRemoved(T callback, Flag!"After" after)

Connect to DeepElementRemoved signal.

connectDoLatency
ulong connectDoLatency(T callback, Flag!"After" after)

Connect to DoLatency signal.

connectElementAdded
ulong connectElementAdded(T callback, Flag!"After" after)

Connect to ElementAdded signal.

connectElementRemoved
ulong connectElementRemoved(T callback, Flag!"After" after)

Connect to ElementRemoved signal.