[gst-devel] get element type name

Stefan Kost ensonic at hora-obscura.de
Wed Dec 1 22:42:06 CET 2010


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
> 
> 
> 
> 





More information about the gstreamer-devel mailing list