GstParse

Name

GstParse -- Parses commandline syntax into a pipeline.

Synopsis


#include <gst/gst.h>


enum        GstParseErrors;
GstPipeline* gst_parse_launch               (const gchar *pipeline_description);
GstPipeline* gst_parse_launchv              (const gchar **argv);

Description

This method allows you to create a pipeline from a command line syntax description. The following example creates a simple mp3 player.
  GstElement *pipeline;

  /* create a pipeline to hold our elements */
  pipeline = gst_pipeline_new ("launch");

  /* build a pipeline in the pipeline */
  gst_parse_launch ("filesrc location=some.mp3 ! mad ! osssink", GST_BIN (pipeline));

  /* play the thing */
  gst_element_set_state (pipeline, GST_STATE_PLAYING);

  while (gst_bin_iterate (GST_BIN (pipeline)));

  gst_element_set_state (pipeline, GST_STATE_NULL);

Elements are separated with a !, properties are set with property=value, specific pads of an element are selected by replacing the ! with padname!.

Elements can be added to a bin by embracing them with (). Threads can be made with {}.

Details

enum GstParseErrors

typedef enum {
  GST_PARSE_ERROR_SYNTAX = -1, 
  GST_PARSE_ERROR_CREATING_ELEMENT = -2,
  GST_PARSE_ERROR_NOSUCH_ELEMENT = -3,
  GST_PARSE_ERROR_INTERNAL = -4,
  GST_PARSE_ERROR_CONNECT = -5,
} GstParseErrors;


gst_parse_launch ()

GstPipeline* gst_parse_launch               (const gchar *pipeline_description);

Create a new pipeline based on command line syntax.

pipeline_description : the command line describing the pipeline
Returns : a new GstPipeline (cast to a Bin) on success, NULL on failure


gst_parse_launchv ()

GstPipeline* gst_parse_launchv              (const gchar **argv);

Create a new pipeline based on command line syntax.

argv : null-terminated array of arguments
Returns : a new pipeline on success, NULL on failure