Gst.Pipeline

const Gst = imports.gi.Gst;

let pipeline = new Gst.Pipeline({
    auto_flush_bus: value,
    delay: value,
});
  

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.

Gst.new is used to create a pipeline. when you are done with the pipeline, use Gst.Object.prototype.unref to free its resources including all added Gst.Element objects (if not otherwise referenced).

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

Before changing the state of the Gst.Pipeline (see Gst.Element) a Gst.Bus can be retrieved with Gst.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 Gst.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.prototype.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 Gst.use_clock method, which will enforce a given clock on the pipeline. With Gst.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 the Gst.Element.prototype.set_start_time method.

Last reviewed on 2012-03-29 (0.11.3)

Hierarchy

  • GObject.Object
    • GObject.InitiallyUnowned
      • Gst.Object
        • Gst.Element
          • Gst.Bin
            • Gst.Pipeline