blob: 405c6beda3421e4fa0a541b191e1d5cf951e4ce2 [file] [log] [blame]
/*** block a from ../../../docs/manual/basics-elements.xml ***/
#include <gst/gst.h>
int
main (int argc,
char *argv[])
{
GstElement *pipeline;
GstElement *source, *filter, *sink;
/* init */
gst_init (&argc, &argv);
/* create pipeline */
pipeline = gst_pipeline_new ("my-pipeline");
/* create elements */
source = gst_element_factory_make ("fakesrc", "source");
filter = gst_element_factory_make ("identity", "filter");
sink = gst_element_factory_make ("fakesink", "sink");
/* must add elements to pipeline before linking them */
gst_bin_add_many (GST_BIN (pipeline), source, filter, sink, NULL);
/* link */
if (!gst_element_link_many (source, filter, sink, NULL)) {
g_warning ("Failed to link elements!");
}
/*** block b from ../../../docs/manual/basics-elements.xml ***/
return 0;
/*** block c from ../../../docs/manual/basics-elements.xml ***/
}