mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 16:21:17 +00:00
e256a61106
0.7.9.3 is needed, but it's pushed on pip so it shouldn't be too complicated. Need the C extension as well, README updated to reflect that. This allowed noticing and fixing two errors in the link_to_multiplexer snippet, as clang complained, check the differences between the previous version and the new one :)
38 lines
878 B
C
38 lines
878 B
C
#include <gst/gst.h>
|
|
|
|
static void
|
|
link_to_multiplexer (GstPad *tolink_pad,
|
|
GstElement *mux)
|
|
{
|
|
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
|
|
some_function (GstElement *tee)
|
|
{
|
|
GstPad * pad;
|
|
gchar *name;
|
|
|
|
pad = gst_element_get_request_pad (tee, "src%d");
|
|
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));
|
|
}
|