get target / parent of a proxypad

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

get target / parent of a proxypad

ericcardmanNo3
When calling gst_pad_get_peer in upstream i come to a "proxypad2" pad. Here i can not call
gst_pad_get_parent_element on this pad. But i need to go further in the upstream. I need to find the
first element in the pipeline. (I do not have the name of the pipeline or a reference to the pipeline - all i have is the parent of my own sink (a reference to my decoder plugin)).

Can anyone tell me how to work with a proxypad (ghostpad??). How can i find the peered source to the proxypad?

Thx.
Reply | Threaded
Open this post in threaded view
|

Re: get target / parent of a proxypad

Sebastian Dröge-7
On Wed, 2010-03-17 at 06:13 -0800, ericcardmanNo3 wrote:

> When calling gst_pad_get_peer in upstream i come to a "proxypad2" pad. Here i
> can not call
> gst_pad_get_parent_element on this pad. But i need to go further in the
> upstream. I need to find the
> first element in the pipeline. (I do not have the name of the pipeline or a
> reference to the pipeline - all i have is the parent of my own sink (a
> reference to my decoder plugin)).
>
> Can anyone tell me how to work with a proxypad (ghostpad??). How can i find
> the peered source to the proxypad?
Use gst_pad_iterate_internal_links() to navigate from the proxypad to
the actual ghostpad:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#gst-pad-iterate-internal-links

There are the real links between pads when linking pads between two
elements and the "internal" links, which connect the srcpads and
sinkpads of a single element (or in this case ghostpad).

You should also use that elsewhere instead of going to the parent
element via gst_pad_get_parent_element().

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: get target / parent of a proxypad

ericcardmanNo3
Sorry, but i need help on this (comment HELP NEEDED HERE):

i do:

        GstPad *pP = gst_pad_get_peer(avi->sinkpad);
        GstElement* pDEC = (GstElement*) gst_pad_get_parent_element (avi->sinkpad);
        GstElement *pEE = gst_bin_get_by_name(GST_ELEMENT_PARENT(pDEC),"filesrc");
        g_print("§§§§ GST_ELEMENT_PARENT is 0x%x pEE is 0x%x \n",GST_ELEMENT_PARENT(pDEC),pEE);
        g_object_get(pDEC,"name",&fb_fd,NULL);
        g_print("### pP is 0x%x (pDEC is 0x%x [%s])\n",pP,pDEC,fb_fd);

        const char *pName;
        pElement = (GstElement*) gst_pad_get_parent_element (pP);
        g_object_get(pElement,"name",&fb_fd,NULL);
        g_print("### name is %s\n",fb_fd);

        GstPad *pPp = gst_element_get_pad (pElement,"sink");
        pElement1 = (GstElement*) gst_pad_get_parent_element (pPp);
        fb_fd = 0;
        g_object_get(pElement1,"name",&fb_fd,NULL);
        g_print("### name is %s\n",fb_fd);

        GstPad *pProxyPad = gst_pad_get_peer(pPp);
        g_print("### pProxyPad is 0x%x (%s)\n",pProxyPad,gst_pad_get_name(GST_PAD(pProxyPad)));

/* HELP NEEDED HERE */
        GstIterator *pI = gst_pad_iterate_internal_links(pProxyPad);
        gpointer pElem;
        GstIteratorResult res;
        do
        {
                res = gst_iterator_next (pI,&pElem);
                g_print("§§§§ res is %u (pElem = 0x%x) \n",res,pElem);
        }while(res != GST_ITERATOR_DONE || res == GST_ITERATOR_ERROR);

        fb_fd=0;
        g_object_get(pElem,"name",&fb_fd,NULL);
        g_print("### pElem(name) is %s\n",fb_fd);

OUTPUT IS:

???? GST_ELEMENT_PARENT is 0xf4040 pEE is 0x0
### pP is 0xaad80 (pDEC is 0x1652d0 [pm6h264decoder0])
### name is typefind
### name is typefind
### pProxyPad is 0x931e0 (proxypad2)
???? res is 0 (pElem = 0x697a8)

(<unknown>:1473): GLib-GObject-CRITICAL **: g_object_get: assertion `G_IS_OBJECT (object)' failed
### pElem(name) is (null)


Thx.
Reply | Threaded
Open this post in threaded view
|

Re: get target / parent of a proxypad

Sebastian Dröge-7
On Wed, 2010-03-17 at 07:18 -0800, ericcardmanNo3 wrote:

> /* HELP NEEDED HERE */
> GstIterator *pI = gst_pad_iterate_internal_links(pProxyPad);
> gpointer pElem;
> GstIteratorResult res;
> do
> {
> res = gst_iterator_next (pI,&pElem);
> g_print("§§§§ res is %u (pElem = 0x%x) \n",res,pElem);
> }while(res != GST_ITERATOR_DONE || res == GST_ITERATOR_ERROR);
>
> fb_fd=0;
> g_object_get(pElem,"name",&fb_fd,NULL);
> g_print("### pElem(name) is %s\n",fb_fd);
The iterator is iterating over GstPads and you get a new GstPad instance
after every successful gst_iterator_next() call. If _next() returns
something else than GST_ITERATOR_OK pElem will be NULL.

Please take a look at the GstIterator documentation on how to use it,
there's some sample code.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

signature.asc (205 bytes) Download Attachment