docs: remove mention of mms from docs and mmssrc from tutorials
[platform/upstream/gstreamer.git] / subprojects / gst-docs / examples / snippets.c
1 #include <gst/gst.h>
2
3 static void
4 link_to_multiplexer (GstPad * tolink_pad, GstElement * mux)
5 {
6   GstPad *pad;
7   gchar *srcname, *sinkname;
8
9   srcname = gst_pad_get_name (tolink_pad);
10   pad = gst_element_get_compatible_pad (mux, tolink_pad, NULL);
11   gst_pad_link (tolink_pad, pad);
12   sinkname = gst_pad_get_name (pad);
13   gst_object_unref (GST_OBJECT (pad));
14
15   g_print ("A new pad %s was created and linked to %s\n", sinkname, srcname);
16   g_free (sinkname);
17   g_free (srcname);
18 }
19
20 static void
21 some_function (GstElement * tee)
22 {
23   GstPad *pad;
24   gchar *name;
25
26   pad = gst_element_request_pad_simple (tee, "src%d");
27   name = gst_pad_get_name (pad);
28   g_print ("A new pad %s was created\n", name);
29   g_free (name);
30
31   /* here, you would link the pad */
32
33   /* [..] */
34
35   /* and, after doing that, free our reference */
36   gst_object_unref (GST_OBJECT (pad));
37 }