GstPipeline

GstPipeline —

Synopsis


#include <gst/gst.h>


            GstPipeline;
enum        GstPipelineFlags;
GstElement* gst_pipeline_new                (const gchar *name);
GstBus*     gst_pipeline_get_bus            (GstPipeline *pipeline);
gboolean    gst_pipeline_set_clock          (GstPipeline *pipeline,
                                             GstClock *clock);
GstClock*   gst_pipeline_get_clock          (GstPipeline *pipeline);
void        gst_pipeline_use_clock          (GstPipeline *pipeline,
                                             GstClock *clock);
void        gst_pipeline_auto_clock         (GstPipeline *pipeline);
void        gst_pipeline_set_new_stream_time
                                            (GstPipeline *pipeline,
                                             GstClockTime time);
GstClockTime gst_pipeline_get_last_stream_time
                                            (GstPipeline *pipeline);
void        gst_pipeline_set_auto_flush_bus (GstPipeline *pipeline,
                                             gboolean auto_flush);
gboolean    gst_pipeline_get_auto_flush_bus (GstPipeline *pipeline);
void        gst_pipeline_set_delay          (GstPipeline *pipeline,
                                             GstClockTime delay);
GstClockTime gst_pipeline_get_delay         (GstPipeline *pipeline);


Object Hierarchy


  GObject
   +----GstObject
         +----GstElement
               +----GstBin
                     +----GstPipeline

Implemented Interfaces

GstPipeline implements

Properties


  "auto-flush-bus"       gboolean              : Read / Write
  "delay"                guint64               : Read / Write

Description

Details

GstPipeline

typedef struct {
  GstClock      *fixed_clock;	/* fixed clock if any */
  GstClockTime   stream_time;
  GstClockTime   delay;
} GstPipeline;

The GstPipeline structure.

GstClock *fixed_clock; The fixed clock of the pipeline, used when GST_PIPELINE_FLAG_FIXED_CLOCK is set.
GstClockTime stream_time; The stream time of the pipeline.
GstClockTime delay; Extra delay added to base time to compensate for delay when setting elements to PLAYING.

enum GstPipelineFlags

typedef enum {
  GST_PIPELINE_FLAG_FIXED_CLOCK        = (GST_BIN_FLAG_LAST << 0),
  /* padding */
  GST_PIPELINE_FLAG_LAST               = (GST_BIN_FLAG_LAST << 4)
} GstPipelineFlags;

Pipeline flags

GST_PIPELINE_FLAG_FIXED_CLOCK this pipeline works with a fixed clock
GST_PIPELINE_FLAG_LAST offset to define more flags

gst_pipeline_new ()

GstElement* gst_pipeline_new                (const gchar *name);

Create a new pipeline with the given name.

name : name of new pipeline
Returns : newly created GstPipeline MT safe.

gst_pipeline_get_bus ()

GstBus*     gst_pipeline_get_bus            (GstPipeline *pipeline);

Gets the GstBus of pipeline.

pipeline : a GstPipeline
Returns : a GstBus, unref after usage. MT safe.

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.

pipeline : a GstPipeline
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.

gst_pipeline_get_clock ()

GstClock*   gst_pipeline_get_clock          (GstPipeline *pipeline);

Gets the current clock used by pipeline.

pipeline : a GstPipeline
Returns : a GstClock, unref after usage.

gst_pipeline_use_clock ()

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

pipeline : a GstPipeline
clock : the clock to use

gst_pipeline_auto_clock ()

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

pipeline : a GstPipeline

gst_pipeline_set_new_stream_time ()

void        gst_pipeline_set_new_stream_time
                                            (GstPipeline *pipeline,
                                             GstClockTime time);

Set the new stream time of pipeline to time. The stream 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.

pipeline : a GstPipeline
time : the new stream time to set

gst_pipeline_get_last_stream_time ()

GstClockTime gst_pipeline_get_last_stream_time
                                            (GstPipeline *pipeline);

Gets the last stream time of pipeline. If the pipeline is PLAYING, the returned time is the stream time used to configure the element's base time in the PAUSED->PLAYING state. If the pipeline is PAUSED, the returned time is the stream 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 gst_pipeline_set_new_stream_time()).

pipeline : a GstPipeline
Returns : a GstClockTime. MT safe.

gst_pipeline_set_auto_flush_bus ()

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

pipeline : a GstPipeline
auto_flush : whether or not to automatically flush the bus when the pipeline goes from READY to NULL state

Since 0.10.4


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.

pipeline : a GstPipeline
Returns : whether the pipeline will automatically flush its bus when going from READY to NULL state or not. MT safe.

Since 0.10.4


gst_pipeline_set_delay ()

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

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

MT safe.

pipeline : a GstPipeline
delay : the delay

Since 0.10.5


gst_pipeline_get_delay ()

GstClockTime gst_pipeline_get_delay         (GstPipeline *pipeline);

Get the configured delay (see gst_pipeline_set_delay()).

pipeline : a GstPipeline
Returns : The configured delay. MT safe.

Since 0.10.5

Properties

The "auto-flush-bus" property

  "auto-flush-bus"       gboolean              : Read / Write

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.

Default value: TRUE

Since 0.10.4


The "delay" property

  "delay"                guint64               : Read / Write

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.

Default value: 0

Since 0.10.5