Branch data Line data Source code
1 : :
2 : : /*** block from ../../../docs/manual/basics-elements.xml ***/
3 : : #include <gst/gst.h>
4 : :
5 : : int
6 : 1 : main (int argc,
7 : : char *argv[])
8 : : {
9 : : GstElementFactory *factory;
10 : : GstElement * element;
11 : :
12 : : /* init GStreamer */
13 : 1 : gst_init (&argc, &argv);
14 : :
15 : : /* create element, method #2 */
16 : 1 : factory = gst_element_factory_find ("fakesrc");
17 [ - + ]: 1 : if (!factory) {
18 : 0 : g_print ("Failed to find factory of type 'fakesrc'\n");
19 : 0 : return -1;
20 : : }
21 : 1 : element = gst_element_factory_create (factory, "source");
22 [ - + ]: 1 : if (!element) {
23 : 0 : g_print ("Failed to create element, even though its factory exists!\n");
24 : 0 : return -1;
25 : : }
26 : :
27 : 1 : gst_object_unref (GST_OBJECT (element));
28 : :
29 : 1 : return 0;
30 : : }
|