GstPipeline

GstPipeline — Top-level bin with clocking and bus management functionality.

Synopsis


#include <gst/gst.h>


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


Object Hierarchy


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

Implemented Interfaces

GstPipeline implements

Properties


  "delay"                guint64               : Read / Write

Description

In almost all cases, you'll want to use a GstPipeline when creating a filter graph. The GstPipeline will manage the selection and distribution of a global clock as well as provide a GstBus to the application.

The pipeline will also use the selected clock to calculate the stream time of the pipeline.

When sending a seek event to a GstPipeline, it will make sure that the pipeline is properly PAUSED and resumed as well as update the new stream time after the seek.

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

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_auto_clock ()

void        gst_pipeline_auto_clock         (GstPipeline *pipeline);

Let the pipeline select a clock automatically.

MT safe.

pipeline : the pipeline

gst_pipeline_get_bus ()

GstBus*     gst_pipeline_get_bus            (GstPipeline *pipeline);

Gets the GstBus of this pipeline.

pipeline : the pipeline
Returns : a GstBus MT safe.

gst_pipeline_get_clock ()

GstClock*   gst_pipeline_get_clock          (GstPipeline *pipeline);

Gets the current clock used by the pipeline.

pipeline : the pipeline
Returns : a GstClock

gst_pipeline_get_last_stream_time ()

GstClockTime gst_pipeline_get_last_stream_time
                                            (GstPipeline *pipeline);

Gets the last stream time of the pipeline. If the pipeline is PLAYING, the returned time is the stream time used to configure the elements in the PAUSED->PLAYING state. If the pipeline is PAUSED, the returned time is the stream time when the pipeline was paused.

pipeline : the pipeline
Returns : a GstClockTime MT safe.

gst_pipeline_set_clock ()

gboolean    gst_pipeline_set_clock          (GstPipeline *pipeline,
                                             GstClock *clock);

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

pipeline : the pipeline
clock : the clock to set
Returns : TRUE if the clock could be set on the pipeline. MT safe.

gst_pipeline_set_new_stream_time ()

void        gst_pipeline_set_new_stream_time
                                            (GstPipeline *pipeline,
                                             GstClockTime time);

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

gst_pipeline_use_clock ()

void        gst_pipeline_use_clock          (GstPipeline *pipeline,
                                             GstClock *clock);

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

MT safe.

pipeline : the pipeline
clock : the clock to use

Properties

The "delay" property

  "delay"                guint64               : Read / Write

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

Default value: 0

See Also

GstBin