Clarification sought over GStreamer Documentation

Tiago Katcipis katcipis at inf.ufsc.br
Mon Dec 17 03:57:59 PST 2012


Ian,

On Sun, Dec 16, 2012 at 12:41 PM, Ian Davidson
<id012c3076 at blueyonder.co.uk>wrote:

> 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>
>
>     int
>     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.
>

Actually, it is the name of the object:

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElementFactory.html#gst-element-factory-make


>
>       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)?
>

Again, the reference documentation is your friend ;-)

http://developer.gnome.org/gstreamer/stable/GstElement.html#gst-element-get-static-pad


>
>       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?
>

The reference documentation:

http://developer.gnome.org/gstreamer/stable/index.html

Best regards,
Tiago Katcipis


>
> Thank you for reading this far.
>
> Ian
>
> --
> --
> 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 lists.**freedesktop.org<gstreamer-devel at lists.freedesktop.org>
> http://lists.freedesktop.org/**mailman/listinfo/gstreamer-**devel<http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20121217/9ae50a1f/attachment.html>


More information about the gstreamer-devel mailing list