[gst-devel] get element type name
Michael Smith
msmith at xiph.org
Wed Dec 1 20:49:19 CET 2010
On Wed, Dec 1, 2010 at 11:25 AM, Wes Miller <wmiller at sdr.com> 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
More information about the gstreamer-devel
mailing list