[gst-devel] Get pointer to elements in pipeline
wl2776 at gmail.com
Wed Mar 17 16:55:06 CET 2010
> i do:
> GstPad *pP = gst_pad_get_peer(dec->sinkpad);
> GstElement* pDEC = (GstElement*) gst_pad_get_parent_element
> GstElement *pEE =
> GstElement *pEE1 = gst_bin_get_by_name(dec,"filesrc");
> g_print("§§§§ GST_ELEMENT_PARENT is 0x%x pEE is 0x%x pEE1 is
> 0x%x\n",GST_ELEMENT_PARENT(pDEC),pEE, pEE1);
> g_print("### pP is 0x%x (pDEC is 0x%x [%s])\n",pP,pDEC,fb_fd);
> OUTPUT IS:
> (<unknown>:1493): GStreamer-CRITICAL **: gst_bin_get_by_name: assertion
> `GST_IS_BIN (bin)' failed
> ???? GST_ELEMENT_PARENT is 0xf4040 pEE is 0x0 pEE1 is 0x0
> ### pP is 0xaad80 (pDEC is 0x165128 [my264decoder0])
> Do you know what i am doing wrong here?
You didn't specify what dec is.
I suppose, it is your decoder element.
Then dec->sinkpad is the sink pad of it.
GstElement* pDEC = (GstElement*) gst_pad_get_parent_element
pDEC should contain the same as dec - the pointer to your decoder element.
GstElement *pEE = gst_bin_get_by_name(GST_ELEMENT_PARENT(pDEC),"filesrc");
Here you're getting a bin, containing your decoder and querying it for
element, named "filesrc".
However, this bin doesn't contain the element with such name.
How do you know that the element's name is "filesrc"? This could be
"source", "filesrc0", etc.
GstElement *pEE1 = gst_bin_get_by_name(dec,"filesrc");
Here you're querying your decoder element for an element, named "filesrc".
Your decoder is not a bin, so, you're getting error message.
I would recommend you
then go to the topmost level with calls to GST_ELEMENT_PARENT in cycle, then
This will result in the /home/you/favorive/dir/player.dot file, which you
can convert to png with the following command.
dot -Tpng -o/home/you/favorive/dir/player.png
[!!! untested ]
GstElement *el, *el1;
[!!! untested ]
The code above should give you a pointer to a topmost container.
and explore the resulting player.dot file.
It will show you all names, links and capabilites.
View this message in context: http://n4.nabble.com/Get-pointer-to-elements-in-pipeline-tp1596079p1596653.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel