![]() |
![]() |
![]() |
GStreamer 0.9 Core Reference Manual | ![]() |
---|
GstPipelineGstPipeline — Top-level bin with clocking and bus management functionality. |
#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); void 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);
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 otherwiese referenced).
typedef struct { GstClock *fixed_clock; /* fixed clock if any */ GstClockTime stream_time; GstClockTime delay; } GstPipeline;
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 |
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. |
void gst_pipeline_auto_clock (GstPipeline *pipeline);
Let the pipeline select a clock automatically.
MT safe.
pipeline : |
the pipeline |
GstBus* gst_pipeline_get_bus (GstPipeline *pipeline);
Gets the GstBus of this pipeline.
pipeline : |
the pipeline |
Returns : | a GstBus MT safe. |
GstClock* gst_pipeline_get_clock (GstPipeline *pipeline);
Gets the current clock used by the pipeline.
pipeline : |
the pipeline |
Returns : | a GstClock |
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. |
void 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.
MT safe.
pipeline : |
the pipeline |
clock : |
the clock to set |
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.
MT safe.
pipeline : |
the pipeline |
time : |
the new stream time to set |
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 |
delay
" property"delay" guint64 : Read / Write
Expected delay needed for elements to spin up to PLAYING in nanoseconds.
Default value: 0
<< GstParse | GstPlugin >> |