Administrator
|
Hi All,
Let's say I have a udpsrc element named "my_src" created thus: recvSrc = gst_element_factory_make( "udpsrc" , "my_src" )); If I use this construct, I get "GstUdpSrc": g_print( "%s\n", g_type_name( G_OBJECT_TYPE( recvSrc )) ); What I'd like to get, instead, is "udpsrc". Is there a function to do that? And what are the proper things to call these two items. Thanks, Wes |
On Wed, Dec 1, 2010 at 11:25 AM, Wes Miller <[hidden email]> wrote:
> > Hi All, > > Let's say I have a udpsrc element named "my_src" created thus: > > recvSrc = gst_element_factory_make( "udpsrc" , "my_src" )); > > If I use this construct, I get "GstUdpSrc": > > g_print( "%s\n", g_type_name( G_OBJECT_TYPE( recvSrc )) ); > > What U'd like to get, instead, is "udpsrc". Is there a function to do that? > > And what are the proper things to call these two items. You have three items, actually: "my_src" - this is your element name "udpsrc" - this is the element factory name "GstUdpSrc" - this the element class name gst_plugin_feature_get_name() to get the name from the element factory. You can get the element factory from the element via its class object. Something like this might work: gst_plugin_feature_get_name(GST_ELEMENT_GET_CLASS(recvSrc)->elementFactory) - though it probably needs some extra casts in there too. Mike ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Administrator
|
In reply to this post by Wes Miller
On Wed, 2010-12-01 at 11:25 -0800, Wes Miller wrote:
> Hi All, > > Let's say I have a udpsrc element named "my_src" created thus: > > recvSrc = gst_element_factory_make( "udpsrc" , "my_src" )); > > If I use this construct, I get "GstUdpSrc": > > g_print( "%s\n", g_type_name( G_OBJECT_TYPE( recvSrc )) ); > > What U'd like to get, instead, is "udpsrc". Is there a function to do that? > > And what are the proper things to call these two items. So you want the factory name ? maybe there's a function to get the factory from an element and maybe there's a function to get the name of a factory hint : gst_<something>_get_<somethingelse> Edward > > Thanks, > > Wes > > > ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Administrator
|
Edward and Michael,
Between you I got the answer I needed. Knowing what to call "something" sure help trying to find the gst_something_get_somethingelse(). g_print( " | %-*s", c3w, gst_plugin_feature_get_name( gst_element_get_factory( element )) ); However, when I check the warnings from my compiler I see that the pointer type from gst_element_get_factory() isn't what gst_plugin_feature_get_name() is looking for. Well, of course not, a factory is not a pugin feature. Well, then what about gst_element_factory_get_longname() instead. Nope, that returns "UDP packet receiver". OK, what about gst_element_factory_get_name(). Guess what doesn't exist. And, gst_element_factory_get_icon_name() seems not to exist in my gstreamer. Says it's declared in gst/gst.h. Is that right? So, I guess the question is, if I just cast the factory pointer to a plugin feature pointer and forget about it will that always work as I expect it will since I suspect that gst_plugin_feature_get_name() just wraps some g-object_get_name() with proper pointer typing. Wes |
Am 01.12.2010 23:19, schrieb Wes Miller:
> > Edward and Michael, > > Between you I got the answer I needed. Knowing what to call "something" > sure help trying to find the gst_something_get_somethingelse(). > > g_print( " | %-*s", c3w, gst_plugin_feature_get_name( > gst_element_get_factory( element )) ); > > However, when I check the warnings from my compiler I see that the pointer > type from gst_element_get_factory() isn't what gst_plugin_feature_get_name() > is looking for. Well, of course not, a factory is not a pugin feature. Its is as you can see nicely in the "Object Hierarchy" section of GstElementFactory API docs (consult devhelp or various online locations of the API docs). To solve your problem use a cast: gst_plugin_feature_get_name(GST_PLUGIN_FEATURE(gst_element_get_factory(element))); > > Well, then what about gst_element_factory_get_longname() instead. Nope, > that returns "UDP packet receiver". > OK, what about gst_element_factory_get_name(). Guess what doesn't exist. > And, gst_element_factory_get_icon_name() seems not to exist in my gstreamer. > Says it's declared in gst/gst.h. Is that right? If you are looking at the header that matches your binaries everything is going to be fine. Note sure how you get the idea that those are declared in that partiual header and not in some header that gets included by gst/gst.h. Stefan > > So, I guess the question is, if I just cast the factory pointer to a plugin > feature pointer and forget about it will that always work as I expect it > will since I suspect that gst_plugin_feature_get_name() just wraps some > g-object_get_name() with proper pointer typing. > > Wes > > > > ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by Wes Miller
On Wed, Dec 1, 2010 at 1:19 PM, Wes Miller <[hidden email]> wrote:
> > Edward and Michael, > > Between you I got the answer I needed. Knowing what to call "something" > sure help trying to find the gst_something_get_somethingelse(). > > g_print( " | %-*s", c3w, gst_plugin_feature_get_name( > gst_element_get_factory( element )) ); > > However, when I check the warnings from my compiler I see that the pointer > type from gst_element_get_factory() isn't what gst_plugin_feature_get_name() > is looking for. Well, of course not, a factory is not a pugin feature. A factory _is_ a plugin feature. It's a subclass, as the documentation says. You can cast it; there's a macro for that. Mike ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Administrator
|
In reply to this post by Stefan Sauer
Stefan,
> If you are looking at the header that matches your binaries everything is going > to be fine. Note sure how you get the idea that those are declared in that > partiual header and not in some header that gets included by gst/gst.h. By being silly enough to quote the doc that said "include <gst/gst.h" and not being bright enough to remember that gst.h is pretty much an includer of include files. Anyway, thanks and also to Edward and Michael. Happy Christmas, Wes |
Administrator
|
On Wed, 2010-12-01 at 14:06 -0800, Wes Miller wrote:
> Stefan, > > > If you are looking at the header that matches your binaries everything is > > going > > to be fine. Note sure how you get the idea that those are declared in that > > partiual header and not in some header that gets included by gst/gst.h. > > By being silly enough to quote the doc that said "include <gst/gst.h" and > not being bright enough to remember that gst.h is pretty much an includer of > include files. And don't forget to read the docs of those functions you're using. Maybe they return something whose reference count you need to decrement after you've used it :) > > Anyway, thanks and also to Edward and Michael. You're welcome > > Happy Christmas, > > Wes ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Administrator
|
Edwward,
> And don't forget to read the docs of those functions you're using. > Maybe they return something whose reference count you need to decrement > 4after you've used it :) Hint, hint, hint..... Checking.... Wes |
Administrator
|
Edward,
No, no, and no. No refs to release. gst_plugin_feature_get_name() gst_element_get_factory() gst_element_factory_get_longname() Just redoing my homework. I had already checked yesterday but thought I'd better recheck. Wes |
Administrator
|
On Thu, 2010-12-02 at 05:39 -0800, Wes Miller wrote:
> Edward, > > No, no, and no. No refs to release. > gst_plugin_feature_get_name() > gst_element_get_factory() > gst_element_factory_get_longname() > > Just redoing my homework. I had already checked yesterday but thought I'd > better recheck. Interesting... I would have thought _get_factory would have incremented it. Oh well, better safe than sorry :) Edward > > Wes ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |