Clarification sought over GStreamer Documentation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Clarification sought over GStreamer Documentation

Ian Davidson
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.

       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

--
--
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
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

RE: Clarification sought over GStreamer Documentation

Muzzu Daniela
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:
http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/GstElementFactory.html#gst-element-factory-make

Regards,
Daniela


-----Original Message-----
From: gstreamer-devel-bounces+daniela.muzzu=[hidden email] [mailto:gstreamer-devel-bounces+daniela.muzzu=[hidden email]] 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>

     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.

       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

--
--
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
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Clarification sought over GStreamer Documentation

Tiago Katcipis
In reply to this post by Ian Davidson
Ian,

On Sun, Dec 16, 2012 at 12:41 PM, Ian Davidson <[hidden email]> 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.

      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?

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
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel