Ian,<br><br><div class="gmail_quote">On Sun, Dec 16, 2012 at 12:41 PM, Ian Davidson <span dir="ltr"><<a href="mailto:id012c3076@blueyonder.co.uk" target="_blank">id012c3076@blueyonder.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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)<br>
<br>
    #include <gst/gst.h><br>
<br>
    int<br>
    main (int   argc,<br>
          char *argv[])<br>
    {<br>
      GstElement *bin, *sink;<br>
      GstPad *pad;<br>
<br>
      /* init */<br>
      gst_init (&argc, &argv);<br>
<br>
      /* create element, add to bin */<br>
<br>
Absolutely no problems with the code above.<br>
<br>
      sink = gst_element_factory_make ("fakesink", "sink");<br>
<br>
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.<br>
</blockquote><div><br>Actually, it is the name of the object:<br><br><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElementFactory.html#gst-element-factory-make">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElementFactory.html#gst-element-factory-make</a><br>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
      bin = gst_bin_new ("mybin");<br>
      gst_bin_add (GST_BIN (bin), sink);<br>
<br>
      /* add ghostpad */<br>
      pad = gst_element_get_static_pad (sink, "sink");<br>
<br>
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)?<br>
</blockquote><div><br>Again, the reference documentation is your friend ;-)<br><br><a href="http://developer.gnome.org/gstreamer/stable/GstElement.html#gst-element-get-static-pad">http://developer.gnome.org/gstreamer/stable/GstElement.html#gst-element-get-static-pad</a><br>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
      gst_element_add_pad (bin, gst_ghost_pad_new ("sink", pad));<br>
<br>
I get the feeling that this "sink" is the leftmost sink in the bin of Figure 8.2.<br>
<br>
      gst_object_unref (GST_OBJECT (pad));<br>
<br>
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?<br>
<br>
Is there something I should have read to understand this?<br></blockquote><div><br>The reference documentation:<br><br><a href="http://developer.gnome.org/gstreamer/stable/index.html">http://developer.gnome.org/gstreamer/stable/index.html</a><br>
<br>Best regards,<br>Tiago Katcipis<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thank you for reading this far.<span class="HOEnZb"><font color="#888888"><br>
<br>
Ian<br>
<br>
-- <br>
--<br>
Ian Davidson<br>
--<br>
Facts used in this message may or may not reflect an underlying objective reality. Facts are supplied for personal use only.<br>
Recipients quoting supplied information do so at their own risk. Facts supplied may vary in whole or part from widely accepted standards.<br>
While painstakingly researched, facts may or may not be indicative of actually occurring events or natural phenomena.<br>
The author accepts no responsibility for personal loss or injury resulting from memorisation and subsequent use.<br>
______________________________<u></u>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.<u></u>freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/<u></u>mailman/listinfo/gstreamer-<u></u>devel</a><br>
</font></span></blockquote></div><br>