2016-06-04 16:19:38 +00:00
|
|
|
#include <gst/gst.h>
|
2019-02-07 19:32:58 +00:00
|
|
|
|
2016-06-04 16:19:38 +00:00
|
|
|
static void
|
2019-02-07 19:32:58 +00:00
|
|
|
link_to_multiplexer (GstPad * tolink_pad, GstElement * mux)
|
2016-06-04 16:19:38 +00:00
|
|
|
{
|
|
|
|
GstPad *pad;
|
|
|
|
gchar *srcname, *sinkname;
|
|
|
|
|
|
|
|
srcname = gst_pad_get_name (tolink_pad);
|
|
|
|
pad = gst_element_get_compatible_pad (mux, tolink_pad, NULL);
|
|
|
|
gst_pad_link (tolink_pad, pad);
|
|
|
|
sinkname = gst_pad_get_name (pad);
|
|
|
|
gst_object_unref (GST_OBJECT (pad));
|
|
|
|
|
|
|
|
g_print ("A new pad %s was created and linked to %s\n", sinkname, srcname);
|
|
|
|
g_free (sinkname);
|
|
|
|
g_free (srcname);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2019-02-07 19:32:58 +00:00
|
|
|
some_function (GstElement * tee)
|
2016-06-04 16:19:38 +00:00
|
|
|
{
|
2019-02-07 19:32:58 +00:00
|
|
|
GstPad *pad;
|
2016-06-04 16:19:38 +00:00
|
|
|
gchar *name;
|
|
|
|
|
2021-04-22 15:26:33 +00:00
|
|
|
pad = gst_element_request_pad_simple (tee, "src%d");
|
2016-06-04 16:19:38 +00:00
|
|
|
name = gst_pad_get_name (pad);
|
|
|
|
g_print ("A new pad %s was created\n", name);
|
|
|
|
g_free (name);
|
|
|
|
|
|
|
|
/* here, you would link the pad */
|
|
|
|
|
|
|
|
/* [..] */
|
|
|
|
|
|
|
|
/* and, after doing that, free our reference */
|
|
|
|
gst_object_unref (GST_OBJECT (pad));
|
|
|
|
}
|