Branch data Line data Source code
1 : :
2 : : /*** block a from ../../../docs/manual/basics-elements.xml ***/
3 : : #include <gst/gst.h>
4 : :
5 : : int
6 : 1 : main (int argc,
7 : : char *argv[])
8 : : {
9 : : GstElement *pipeline;
10 : : GstElement *source, *filter, *sink;
11 : :
12 : : /* init */
13 : 1 : gst_init (&argc, &argv);
14 : :
15 : : /* create pipeline */
16 : 1 : pipeline = gst_pipeline_new ("my-pipeline");
17 : :
18 : : /* create elements */
19 : 1 : source = gst_element_factory_make ("fakesrc", "source");
20 : 1 : filter = gst_element_factory_make ("identity", "filter");
21 : 1 : sink = gst_element_factory_make ("fakesink", "sink");
22 : :
23 : : /* must add elements to pipeline before linking them */
24 : 1 : gst_bin_add_many (GST_BIN (pipeline), source, filter, sink, NULL);
25 : :
26 : : /* link */
27 [ - + ]: 1 : if (!gst_element_link_many (source, filter, sink, NULL)) {
28 : 0 : g_warning ("Failed to link elements!");
29 : : }
30 : :
31 : : /*** block b from ../../../docs/manual/basics-elements.xml ***/
32 : 1 : return 0;
33 : :
34 : : /*** block c from ../../../docs/manual/basics-elements.xml ***/
35 : : }
|