# Gst::Pipeline Class Reference
[gstreamermm Base Classes]

A top-level bin with clocking and bus management functionality. More...

Inherits Gst::Bin.

Inherited by Gst::PlayBin, and Gst::PlayBin2.

Collaboration diagram for Gst::Pipeline:
[legend]

List of all members.

## Public Member Functions

virtual | ~Pipeline ()
GstPipeline* | gobj ()
| Provides access to the underlying C GObject.
const GstPipeline* | gobj () const
| Provides access to the underlying C GObject.
GstPipeline* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::RefPtr< Gst::Bus > | get_bus ()
| Gets the Gst::Bus of pipeline.
Glib::RefPtr< const Gst::Bus > | get_bus () const
| Gets the Gst::Bus of pipeline.
bool | set_clock (const Glib::RefPtr< Gst::Clock >& clock)
| Set the clock for pipeline.
Glib::RefPtr< Gst::Clock > | get_clock ()
| Gets the current clock used by pipeline.
Glib::RefPtr< const Gst::Clock > | get_clock () const
| Gets the current clock used by pipeline.
void | use_clock (const Glib::RefPtr< Gst::Clock >& clock)
| Force pipeline to use the given clock.
void | auto_clock ()
| Let pipeline select a clock automatically.
void | set_new_stream_time (ClockTime time)
| Set the new start time of pipeline to time.
ClockTime | get_last_stream_time () const
| Gets the last running time of pipeline.
void | set_auto_flush_bus (gboolean auto_flush=true)
| Usually, when a pipeline goes from READY to `0` state, it automatically flushes all pending messages on the bus, which is done for refcounting purposes, to break circular references.
bool | get_auto_flush_bus () const
| Check if pipeline will automatically flush messages when going to the `0` state.
void | set_delay (ClockTime delay)
| Set the expected delay needed for all elements to perform the PAUSED to PLAYING state change.
ClockTime | get_delay () const
| Get the configured delay (see set_delay()).
Glib::PropertyProxy< bool > | property_auto_flush_bus ()
| Whether to automatically flush the pipeline's bus when going from READY into NULL state.
Glib::PropertyProxy_ReadOnly < bool > | property_auto_flush_bus () const
| Whether to automatically flush the pipeline's bus when going from READY into NULL state.
Glib::PropertyProxy< ClockTime > | property_delay ()
| Expected delay needed for elements to spin up to PLAYING in nanoseconds.
Glib::PropertyProxy_ReadOnly < ClockTime > | property_delay () const
| Expected delay needed for elements to spin up to PLAYING in nanoseconds.

## Static Public Member Functions

static Glib::RefPtr< Pipeline > | create (const Glib::ustring& name)
| Create a new pipeline with the given name.
static Glib::RefPtr< Pipeline > | create ()
| Create a new pipeline with a unique generic name.

## Protected Member Functions

| Pipeline (const Glib::ustring& name)
| Pipeline ()

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gst::Pipeline > | wrap (GstPipeline* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

A top-level bin with clocking and bus management functionality.

A Gst::Pipeline is a special Gst::Bin used as the toplevel container for the filter graph. The Gst::Pipeline will manage the selection and distribution of a global Gst::Clock as well as provide a Gst::Bus to the application. It will also implement a default behavour for managing seek events (see Gst::Element::seek()).

create() is used to create a pipeline. when the pipeline is destroyed all its resources including all added Gst::Element objects are destroyed.

Elements are added and removed from the pipeline using the Gst::Bin methods like Gst::Bin::add() and Gst::Bin::remove() (see Gst::Bin).

Before changing the state of the Gst::Pipeline (see Gst::Element) a Gst::Bus can be retrieved with get_bus(). This bus can then be used to receive Gst::Message from the elements in the pipeline.

By default, a Gst::Pipeline will automatically flush the pending Gst::Bus messages when going to the NULL state to ensure that no circular references exist when no messages are read from the Gst::Bus. This behaviour can be changed with 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 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 Gst::SystemClock is used.

The clock selection can be controlled with the use_clock() method, which will enforce a given clock on the pipeline. With auto_clock() the default clock selection algorithm can be restored.

A Gst::Pipeline maintains a stream time for the elements. The stream 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 stream 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. This default behaviour can be changed with the set_new_stream_time() method.

When sending a flushing seek event to a Gst::Pipeline (see Gst::Element::seek()), it will make sure that the pipeline is properly PAUSED and resumed as well as set the new stream time to 0 when the seek succeeded.

Last reviewed on 2006-03-12 (0.10.5)

## Constructor & Destructor Documentation

virtual Gst::Pipeline::~Pipeline | ( |  | ) | `[virtual]`

Gst::Pipeline::Pipeline | ( | const Glib::ustring & | name | ) | `[explicit, protected]`

Gst::Pipeline::Pipeline | ( |  | ) | `[protected]`

## Member Function Documentation

void 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 use_clock() and want to restore the default pipeline clock selection algorithm.

MT safe.

static Glib::RefPtr<Pipeline> Gst::Pipeline::create | ( |  | ) | `[static]`

Create a new pipeline with a unique generic name.

Returns:
  Newly created Gst::Pipeline. MT safe.

Reimplemented from Gst::Bin.

Reimplemented in Gst::PlayBin2, and Gst::PlayBin.

static Glib::RefPtr<Pipeline> Gst::Pipeline::create | ( | const Glib::ustring & | name | ) | `[static]`

Create a new pipeline with the given name.

Parameters:

  | name | Name of new pipeline.

Returns:
  Newly created Gst::Pipeline. MT safe.

Reimplemented from Gst::Bin.

Reimplemented in Gst::PlayBin2, and Gst::PlayBin.

bool Gst::Pipeline::get_auto_flush_bus | ( |  | ) | const

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

Returns:
  Whether the pipeline will automatically flush its bus when going from READY to `0` state or not.

MT safe.

Since gstreamermm 0.10:
  .4.

Glib::RefPtr<const Gst::Bus> Gst::Pipeline::get_bus | ( |  | ) | const

Gets the Gst::Bus of pipeline.

The bus allows applications to receive Gst::Message packets.

Returns:
  A Gst::Bus, unref after usage.

MT safe.

Reimplemented from Gst::Element.

Glib::RefPtr<Gst::Bus> Gst::Pipeline::get_bus | ( |  | ) |

Gets the Gst::Bus of pipeline.

The bus allows applications to receive Gst::Message packets.

Returns:
  A Gst::Bus, unref after usage.

MT safe.

Reimplemented from Gst::Element.

Glib::RefPtr<const Gst::Clock> Gst::Pipeline::get_clock | ( |  | ) | const

Gets the current clock used by pipeline.

Returns:
  A Gst::Clock, unref after usage.

Reimplemented from Gst::Element.

Glib::RefPtr<Gst::Clock> Gst::Pipeline::get_clock | ( |  | ) |

Gets the current clock used by pipeline.

Returns:
  A Gst::Clock, unref after usage.

Reimplemented from Gst::Element.

ClockTime Gst::Pipeline::get_delay | ( |  | ) | const

Get the configured delay (see set_delay()).

Returns:
  The configured delay.

MT safe.

Since gstreamermm 0.10:
  .5.

ClockTime Gst::Pipeline::get_last_stream_time | ( |  | ) | const

Gets the last running time of pipeline.

If the pipeline is PLAYING, the returned time is the running time used to configure the element's base time in the PAUSED->PLAYING state. If the pipeline is PAUSED, the returned time is the running time when the pipeline was paused.

This function returns Gst::CLOCK_TIME_NONE if the pipeline was configured to not handle the management of the element's base time (see set_new_stream_time()).

MT safe.

Returns:
  A Gst::ClockTime.

Deprecated: This function has the wrong name and is equivalent to Gst::Element::get_start_time().

const GstPipeline* Gst::Pipeline::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gst::Bin.

Reimplemented in Gst::PlayBin2, and Gst::PlayBin.

GstPipeline* Gst::Pipeline::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gst::Bin.

Reimplemented in Gst::PlayBin2, and Gst::PlayBin.

GstPipeline* Gst::Pipeline::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Reimplemented from Gst::Bin.

Reimplemented in Gst::PlayBin2, and Gst::PlayBin.

Glib::PropertyProxy_ReadOnly<bool> Gst::Pipeline::property_auto_flush_bus | ( |  | ) | const

Whether to automatically flush the pipeline's bus when going from READY into NULL state.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gst::Pipeline::property_auto_flush_bus | ( |  | ) |

Whether to automatically flush the pipeline's bus when going from READY into NULL state.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<ClockTime> Gst::Pipeline::property_delay | ( |  | ) | const

Expected delay needed for elements to spin up to PLAYING in nanoseconds.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<ClockTime> Gst::Pipeline::property_delay | ( |  | ) |

Expected delay needed for elements to spin up to PLAYING in nanoseconds.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gst::Pipeline::set_auto_flush_bus | ( | gboolean | auto_flush = `true` | ) |

Usually, when a pipeline goes from READY to `0` 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.

Since gstreamermm 0.10:
  .4

Parameters:

  | auto_flush | Whether or not to automatically flush the bus when the pipeline goes from READY to `0` state.

bool Gst::Pipeline::set_clock | ( | const Glib::RefPtr< Gst::Clock >& | clock | ) |

Set the clock for pipeline.

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

Parameters:

  | clock | 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.

Reimplemented from Gst::Element.

void Gst::Pipeline::set_delay | ( | 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.

This option is used for tuning purposes and should normally not be used.

MT safe.

Since gstreamermm 0.10:
  .5

Parameters:

  | delay | The delay.

void Gst::Pipeline::set_new_stream_time | ( | ClockTime | time | ) |

Set the new start time of pipeline to time.

The start time is used to set the base time on the elements (see Gst::Element::set_base_time()) in the PAUSED->PLAYING state transition.

Setting time to Gst::CLOCK_TIME_NONE will disable the pipeline's management of element base time. The application will then be responsible for performing base time distribution. This is sometimes useful if you want to synchronize capture from multiple pipelines, and you can also ensure that the pipelines have the same clock.

MT safe.

Deprecated: This function has the wrong name and is equivalent to Gst::Element::set_start_time().

Parameters:

  | time | The new running time to set.

void Gst::Pipeline::use_clock | ( | const Glib::RefPtr< Gst::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.

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

MT safe.

Parameters:

  | clock | The clock to use.

## Friends And Related Function Documentation

Glib::RefPtr< Gst::Pipeline > wrap | ( | GstPipeline * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gstreamermm/pipeline.h