# GstPipeline

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_new is used to create a pipeline. when you are done with the pipeline, use gst_object_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_add and gst_bin_remove (see GstBin).

Before changing the state of the GstPipeline (see GstElement) a GstBus should be retrieved with gst_pipeline_get_bus. 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_set_auto_flush_bus.

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_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 default GstSystemClock is used.

The clock selection can be controlled with the gst_pipeline_use_clock method, which will enforce a given clock on the pipeline. With gst_pipeline_auto_clock 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_set_start_time method.

## GstPipeline

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBin
                        ╰──GstPipeline

The GstPipeline structure.

### Members

`bin` (GstBin) –
No description available
`fixed_clock` (GstClock *) –

The fixed clock of the pipeline, used when GST_PIPELINE_FLAG_FIXED_CLOCK is set.

`stream_time` (GstClockTime) –

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 GstElement).

`delay` (GstClockTime) –

Extra delay added to base_time to compensate for computing delays when setting elements to PLAYING.

### Class structure

#### GstPipelineClass

##### Fields

`parent_class` (GstBinClass) –
No description available

### Gst.PipelineClass

##### Attributes

`parent_class` (Gst.BinClass) –
No description available

### Gst.PipelineClass

##### Attributes

`parent_class` (Gst.BinClass) –
No description available

## Gst.Pipeline

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.Element
                    ╰──Gst.Bin
                        ╰──Gst.Pipeline

The Gst.Pipeline structure.

### Members

`bin` (Gst.Bin) –
No description available
`fixed_clock` (Gst.Clock) –

The fixed clock of the pipeline, used when GST_PIPELINE_FLAG_FIXED_CLOCK is set.

`stream_time` (Number) –

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 GstElement).

`delay` (Number) –

Extra delay added to base_time to compensate for computing delays when setting elements to PLAYING.

## Gst.Pipeline

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.Element
                    ╰──Gst.Bin
                        ╰──Gst.Pipeline

The Gst.Pipeline structure.

### Members

`bin` (Gst.Bin) –
No description available
`fixed_clock` (Gst.Clock) –

The fixed clock of the pipeline, used when GST_PIPELINE_FLAG_FIXED_CLOCK is set.

`stream_time` (int) –

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 GstElement).

`delay` (int) –

Extra delay added to base_time to compensate for computing delays when setting elements to PLAYING.

### Constructors

#### gst_pipeline_new

    GstElement *
    gst_pipeline_new (const gchar * name)

Create a new pipeline with the given name.

Parameters:

`name` ( [allow-none]) –

name of new pipeline

Returns ( [transfer: floating]) –

newly created GstPipeline

MT safe.

#### Gst.Pipeline.prototype.new

    function Gst.Pipeline.prototype.new(name: String): {
        // javascript wrapper for 'gst_pipeline_new'
    }

Create a new pipeline with the given name.

Parameters:

`name` (String) –

name of new pipeline

Returns (Gst.Element) –

newly created GstPipeline

MT safe.

#### Gst.Pipeline.new

    def Gst.Pipeline.new (name):
        #python wrapper for 'gst_pipeline_new'

Create a new pipeline with the given name.

Parameters:

`name` (str) –

name of new pipeline

Returns (Gst.Element) –

newly created GstPipeline

MT safe.

### Methods

#### gst_pipeline_auto_clock

    gst_pipeline_auto_clock (GstPipeline * pipeline)

Let pipeline 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.

Parameters:

`pipeline` –

a GstPipeline

#### Gst.Pipeline.prototype.auto_clock

    function Gst.Pipeline.prototype.auto_clock(): {
        // javascript wrapper for 'gst_pipeline_auto_clock'
    }

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

Use this function if you previous forced a fixed clock with Gst.Pipeline.prototype.use_clock and want to restore the default pipeline clock selection algorithm.

MT safe.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

#### Gst.Pipeline.auto_clock

    def Gst.Pipeline.auto_clock (self):
        #python wrapper for 'gst_pipeline_auto_clock'

Let pipeline 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.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

#### gst_pipeline_get_auto_flush_bus

    gboolean
    gst_pipeline_get_auto_flush_bus (GstPipeline * pipeline)

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

Parameters:

`pipeline` –

a GstPipeline

Returns –

whether the pipeline will automatically flush its bus when going from READY to NULL state or not.

MT safe.

#### Gst.Pipeline.prototype.get_auto_flush_bus

    function Gst.Pipeline.prototype.get_auto_flush_bus(): {
        // javascript wrapper for 'gst_pipeline_get_auto_flush_bus'
    }

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

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

Returns (Number) –

whether the pipeline will automatically flush its bus when going from READY to NULL state or not.

MT safe.

#### Gst.Pipeline.get_auto_flush_bus

    def Gst.Pipeline.get_auto_flush_bus (self):
        #python wrapper for 'gst_pipeline_get_auto_flush_bus'

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

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

Returns (bool) –

whether the pipeline will automatically flush its bus when going from READY to NULL state or not.

MT safe.

#### gst_pipeline_get_bus

    GstBus *
    gst_pipeline_get_bus (GstPipeline * pipeline)

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

Parameters:

`pipeline` –

a GstPipeline

Returns ( [transfer: full]) –

a GstBus, unref after usage.

MT safe.

#### Gst.Pipeline.prototype.get_bus

    function Gst.Pipeline.prototype.get_bus(): {
        // javascript wrapper for 'gst_pipeline_get_bus'
    }

Gets the Gst.Bus of pipeline. The bus allows applications to receive Gst.Message packets.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

Returns (Gst.Bus) –

a Gst.Bus, unref after usage.

MT safe.

#### Gst.Pipeline.get_bus

    def Gst.Pipeline.get_bus (self):
        #python wrapper for 'gst_pipeline_get_bus'

Gets the Gst.Bus of pipeline. The bus allows applications to receive Gst.Message packets.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

Returns (Gst.Bus) –

a Gst.Bus, unref after usage.

MT safe.

#### gst_pipeline_get_clock

    GstClock *
    gst_pipeline_get_clock (GstPipeline * pipeline)

Gets the current clock used by pipeline. Users of object oriented languages should use gst_pipeline_get_pipeline_clock to avoid confusion with gst_element_get_clock which has a different behavior.

Unlike gst_element_get_clock, this function will always return a clock, even if the pipeline is not in the PLAYING state.

Parameters:

`pipeline` –

a GstPipeline

Returns ( [transfer: full]) –

a GstClock, unref after usage.

#### gst_pipeline_get_delay

    GstClockTime
    gst_pipeline_get_delay (GstPipeline * pipeline)

Get the configured delay (see gst_pipeline_set_delay).

Parameters:

`pipeline` –

a GstPipeline

Returns –

The configured delay.

MT safe.

#### Gst.Pipeline.prototype.get_delay

    function Gst.Pipeline.prototype.get_delay(): {
        // javascript wrapper for 'gst_pipeline_get_delay'
    }

Get the configured delay (see Gst.Pipeline.prototype.set_delay).

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

Returns (Number) –

The configured delay.

MT safe.

#### Gst.Pipeline.get_delay

    def Gst.Pipeline.get_delay (self):
        #python wrapper for 'gst_pipeline_get_delay'

Get the configured delay (see Gst.Pipeline.set_delay).

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

Returns (int) –

The configured delay.

MT safe.

#### gst_pipeline_get_latency

    GstClockTime
    gst_pipeline_get_latency (GstPipeline * pipeline)

Gets the latency that should be configured on the pipeline. See gst_pipeline_set_latency.

Parameters:

`pipeline` –

a GstPipeline

Returns –

Latency to configure on the pipeline or GST_CLOCK_TIME_NONE

Since : 1.6

#### Gst.Pipeline.prototype.get_latency

    function Gst.Pipeline.prototype.get_latency(): {
        // javascript wrapper for 'gst_pipeline_get_latency'
    }

Gets the latency that should be configured on the pipeline. See Gst.Pipeline.prototype.set_latency.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

Returns (Number) –

Latency to configure on the pipeline or GST_CLOCK_TIME_NONE

Since : 1.6

#### Gst.Pipeline.get_latency

    def Gst.Pipeline.get_latency (self):
        #python wrapper for 'gst_pipeline_get_latency'

Gets the latency that should be configured on the pipeline. See Gst.Pipeline.set_latency.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

Returns (int) –

Latency to configure on the pipeline or GST_CLOCK_TIME_NONE

Since : 1.6

#### gst_pipeline_get_pipeline_clock

    GstClock *
    gst_pipeline_get_pipeline_clock (GstPipeline * pipeline)

Gets the current clock used by pipeline.

Unlike gst_element_get_clock, this function will always return a clock, even if the pipeline is not in the PLAYING state.

Parameters:

`pipeline` –

a GstPipeline

Returns ( [transfer: full]) –

a GstClock, unref after usage.

Since : 1.6

#### Gst.Pipeline.prototype.get_pipeline_clock

    function Gst.Pipeline.prototype.get_pipeline_clock(): {
        // javascript wrapper for 'gst_pipeline_get_pipeline_clock'
    }

Gets the current clock used by pipeline.

Unlike Gst.Element.prototype.get_clock, this function will always return a clock, even if the pipeline is not in the PLAYING state.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

Returns (Gst.Clock) –

a Gst.Clock, unref after usage.

Since : 1.6

#### Gst.Pipeline.get_pipeline_clock

    def Gst.Pipeline.get_pipeline_clock (self):
        #python wrapper for 'gst_pipeline_get_pipeline_clock'

Gets the current clock used by pipeline.

Unlike Gst.Element.get_clock, this function will always return a clock, even if the pipeline is not in the PLAYING state.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

Returns (Gst.Clock) –

a Gst.Clock, unref after usage.

Since : 1.6

#### gst_pipeline_set_auto_flush_bus

    gst_pipeline_set_auto_flush_bus (GstPipeline * pipeline,
                                     gboolean auto_flush)

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.

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.

Parameters:

`pipeline` –

a GstPipeline

`auto_flush` –

whether or not to automatically flush the bus when the pipeline goes from READY to NULL state

#### Gst.Pipeline.prototype.set_auto_flush_bus

    function Gst.Pipeline.prototype.set_auto_flush_bus(auto_flush: Number): {
        // javascript wrapper for 'gst_pipeline_set_auto_flush_bus'
    }

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.

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.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

`auto_flush` (Number) –

whether or not to automatically flush the bus when the pipeline goes from READY to NULL state

#### Gst.Pipeline.set_auto_flush_bus

    def Gst.Pipeline.set_auto_flush_bus (self, auto_flush):
        #python wrapper for 'gst_pipeline_set_auto_flush_bus'

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.

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.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

`auto_flush` (bool) –

whether or not to automatically flush the bus when the pipeline goes from READY to NULL state

#### gst_pipeline_set_clock

    gboolean
    gst_pipeline_set_clock (GstPipeline * pipeline,
                            GstClock * clock)

Set the clock for pipeline. The clock will be distributed to all the elements managed by the pipeline.

Parameters:

`pipeline` –

a GstPipeline

`clock` ( [transfer: none]) –

the clock to set

Returns –

TRUE if the clock could be set on the pipeline. FALSE if some element did not accept the clock.

MT safe.

#### gst_pipeline_set_delay

    gst_pipeline_set_delay (GstPipeline * pipeline,
                            GstClockTime 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.

Parameters:

`pipeline` –

a GstPipeline

`delay` –

the delay

#### Gst.Pipeline.prototype.set_delay

    function Gst.Pipeline.prototype.set_delay(delay: Number): {
        // javascript wrapper for 'gst_pipeline_set_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.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

`delay` (Number) –

the delay

#### Gst.Pipeline.set_delay

    def Gst.Pipeline.set_delay (self, delay):
        #python wrapper for 'gst_pipeline_set_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.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

`delay` (int) –

the delay

#### gst_pipeline_set_latency

    gst_pipeline_set_latency (GstPipeline * pipeline,
                              GstClockTime 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.

Setting a too low latency, especially lower than the minimum latency from the LATENCY query, will most likely cause the pipeline to fail.

Parameters:

`pipeline` –

a GstPipeline

`latency` –

latency to configure

Since : 1.6

#### Gst.Pipeline.prototype.set_latency

    function Gst.Pipeline.prototype.set_latency(latency: Number): {
        // javascript wrapper for 'gst_pipeline_set_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.

Setting a too low latency, especially lower than the minimum latency from the LATENCY query, will most likely cause the pipeline to fail.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

`latency` (Number) –

latency to configure

Since : 1.6

#### Gst.Pipeline.set_latency

    def Gst.Pipeline.set_latency (self, latency):
        #python wrapper for 'gst_pipeline_set_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.

Setting a too low latency, especially lower than the minimum latency from the LATENCY query, will most likely cause the pipeline to fail.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

`latency` (int) –

latency to configure

Since : 1.6

#### gst_pipeline_use_clock

    gst_pipeline_use_clock (GstPipeline * pipeline,
                            GstClock * 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.

If clock is NULL all clocking will be disabled which will make the pipeline run as fast as possible.

MT safe.

Parameters:

`pipeline` –

a GstPipeline

`clock` ( [transfer: none][allow-none]) –

the clock to use

#### Gst.Pipeline.prototype.use_clock

    function Gst.Pipeline.prototype.use_clock(clock: Gst.Clock): {
        // javascript wrapper for 'gst_pipeline_use_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.

If clock is null all clocking will be disabled which will make the pipeline run as fast as possible.

MT safe.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

`clock` (Gst.Clock) –

the clock to use

#### Gst.Pipeline.use_clock

    def Gst.Pipeline.use_clock (self, clock):
        #python wrapper for 'gst_pipeline_use_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.

If clock is None all clocking will be disabled which will make the pipeline run as fast as possible.

MT safe.

Parameters:

`pipeline` (Gst.Pipeline) –

a Gst.Pipeline

`clock` (Gst.Clock) –

the clock to use

### Properties

#### auto-flush-bus

    “auto-flush-bus” gboolean

Whether or not to automatically flush all messages on the pipeline's bus when going from READY to NULL state. Please see gst_pipeline_set_auto_flush_bus for more information on this option.

Flags : Read / Write

#### auto-flush-bus

    “auto-flush-bus” Number

Whether or not to automatically flush all messages on the pipeline's bus when going from READY to NULL state. Please see Gst.Pipeline.prototype.set_auto_flush_bus for more information on this option.

Flags : Read / Write

#### auto_flush_bus

    “self.props.auto_flush_bus” bool

Whether or not to automatically flush all messages on the pipeline's bus when going from READY to NULL state. Please see Gst.Pipeline.set_auto_flush_bus for more information on this option.

Flags : Read / Write

#### delay

    “delay” guint64

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.

Flags : Read / Write

#### delay

    “delay” Number

The expected delay needed for elements to spin up to the PLAYING state expressed in nanoseconds. see Gst.Pipeline.prototype.set_delay for more information on this option.

Flags : Read / Write

#### delay

    “self.props.delay” int

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.

Flags : Read / Write

#### latency

    “latency” guint64

Latency to configure on the pipeline. See gst_pipeline_set_latency.

Flags : Read / Write

#### latency

    “latency” Number

Latency to configure on the pipeline. See Gst.Pipeline.prototype.set_latency.

Flags : Read / Write

#### latency

    “self.props.latency” int

Latency to configure on the pipeline. See Gst.Pipeline.set_latency.

Flags : Read / Write

## Function Macros

### GST_PIPELINE_CAST

    #define GST_PIPELINE_CAST(obj)          ((GstPipeline*)(obj))

## Enumerations

### GstPipelineFlags

Pipeline flags

##### Members

`GST_PIPELINE_FLAG_FIXED_CLOCK` (524288) –

this pipeline works with a fixed clock

`GST_PIPELINE_FLAG_LAST` (8388608) –

offset to define more flags

### Gst.PipelineFlags

Pipeline flags

##### Members

`Gst.PipelineFlags.FIXED_CLOCK` (524288) –

this pipeline works with a fixed clock

`Gst.PipelineFlags.LAST` (8388608) –

offset to define more flags

### Gst.PipelineFlags

Pipeline flags

##### Members

`Gst.PipelineFlags.FIXED_CLOCK` (524288) –

this pipeline works with a fixed clock

`Gst.PipelineFlags.LAST` (8388608) –

offset to define more flags

The results of the search are