Clarification sought over GStreamer Documentation

Muzzu Daniela Daniela.Muzzu at
Mon Dec 17 02:36:30 PST 2012

The second parameter of gst_element_factory_make is actually the name to be given to the new element. If you pass NULL as parameter, a unique name will be given:


-----Original Message-----
From: at [ at] On Behalf Of Ian Davidson
Sent: Sunday, December 16, 2012 3:41 PM
To: Discussion of the development of and with GStreamer
Subject: Clarification sought over GStreamer Documentation

I have studied section "8.4. Ghost pads" of "GStreamer Application Development Manual (1.0.3)" - but I am not sure about the 'mechanics' of the code snippet (below)

     #include <gst/gst.h>

     main (int   argc,
           char *argv[])
       GstElement *bin, *sink;
       GstPad *pad;

       /* init */
       gst_init (&argc, &argv);

       /* create element, add to bin */

Absolutely no problems with the code above.

       sink = gst_element_factory_make ("fakesink", "sink");

I understand that the above line is creating a new element of type 'fakesink', but I am not sure about the quoted "sink" in the parameters.  Is that a key word (sink or src)?  Is it the name that is to be given to something?  I am reasonably sure that it is not the name of the object.

       bin = gst_bin_new ("mybin");
       gst_bin_add (GST_BIN (bin), sink);

       /* add ghostpad */
       pad = gst_element_get_static_pad (sink, "sink");

Again, I assume that the unquoted sink is a reference to 'our GstElement called sink.  But again, the quoted "sink" - what is the purpose of that parameter?  Is it referring to its relationship to the bin? or to where it wants to link on to in "Element1" (in Figure 8.2)?

       gst_element_add_pad (bin, gst_ghost_pad_new ("sink", pad));

I get the feeling that this "sink" is the leftmost sink in the bin of Figure 8.2.

       gst_object_unref (GST_OBJECT (pad));

Finally, I assume that once the pad has been used to link the bin's Pad to Element1's Pad, it is no longer required and can be freed. Correct?

Is there something I should have read to understand this?

Thank you for reading this far.


Ian Davidson
Facts used in this message may or may not reflect an underlying objective reality. Facts are supplied for personal use only.
Recipients quoting supplied information do so at their own risk. Facts supplied may vary in whole or part from widely accepted standards.
While painstakingly researched, facts may or may not be indicative of actually occurring events or natural phenomena.
The author accepts no responsibility for personal loss or injury resulting from memorisation and subsequent use.
gstreamer-devel mailing list
gstreamer-devel at

More information about the gstreamer-devel mailing list