After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 656396 - why gst_decode_bin_get_type static?
why gst_decode_bin_get_type static?
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-12 12:32 UTC by Levente Farkas
Modified: 2011-08-12 15:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Levente Farkas 2011-08-12 12:32:55 UTC
almost all *_get_type() functions are exported (ie. not declared as static) from the gstreamer dlls, but there are a few eg:
gst_decode_bin_get_type
which is not. why?
imho it's a bug since in this case language bindings can't call these functions. eg. i like to know decodebin's type from java and currently there is no way to call it.
Comment 1 Levente Farkas 2011-08-12 12:37:19 UTC
another strange thing is gst_rtp_bin_get_type. it's declared in gstrtpbin.h but never defined (or at least i can't find it).
Comment 2 Tim-Philipp Müller 2011-08-12 12:49:24 UTC
Only get_type() functions for public API / public classes/objects that you can derive from are exported (ie. in libgst*-0.10.{so,dll,dylib}.

Plugins don't export any symbols other than a hook that allows GStreamer to find the plugin init function.

If you want to get the GType of decodebin, you need to create one and use the GObject API to get the GType from the object (or load the plugin and get the GType via GstElementFactory). I'm not sure why you would need that though.

Some _get_type() function implementations are created via the GST_BOILERPLATE + G_DEFINE_TYPE macros.
Comment 3 Levente Farkas 2011-08-12 13:59:27 UTC
what does the "public API / public classes/objects" means?
this means final elements's are not public? eg gst_identity_get_type?

the problem (in gstreamer-java):
there're wrapper class for some gstreamer elements which add easier usage of native gstreamer elements. there're 2 ways for elements to be created:
1. when we (from java) create the element. in this case we know what is it.
2. when gstreamer itself create element eg: auto... or rtspsrc which create an inner rtpbin. when we got this element in java (eg: trough element-added signal) we'd like to cast it into the java wrapper class.

until now in gstreamer-java there is a global prefilled map which map GType to java wrapper classs. during startap we initialize this map eg:
gst_bus_get_type(), Bus.class
gst_bin_get_type(), Bin.class
etc.
so when we get an element we can find it's wrapper class.

so my question what can i do in case of such elements (like gstrtpbin) where the *_get_type function is not exported (gst_rtp_bin_get_type)?
of course i wouldn't like to create all elements just to get it's type. or isn't there any other way?

thanks
Comment 4 Tim-Philipp Müller 2011-08-12 14:09:17 UTC
> what does the "public API / public classes/objects" means?

It means API for which we install header files in $prefix/include/.

> this means final elements are not public? eg gst_identity_get_type?

Correct.


> the problem (in gstreamer-java):
> there're wrapper class for some gstreamer elements which add easier usage of
> native gstreamer elements. there're 2 ways for elements to be created:
> 1. when we (from java) create the element. in this case we know what is it.
> 2. when gstreamer itself create element eg: auto... or rtspsrc which create an
> inner rtpbin. when we got this element in java (eg: trough element-added
> signal) we'd like to cast it into the java wrapper class.
> 
> until now in gstreamer-java there is a global prefilled map which map GType to
> java wrapper classs. during startap we initialize this map eg:
> gst_bus_get_type(), Bus.class
> gst_bin_get_type(), Bin.class
> etc.
> so when we get an element we can find it's wrapper class.
> 
> so my question what can i do in case of such elements (like gstrtpbin) where
> the *_get_type function is not exported (gst_rtp_bin_get_type)?
> of course i wouldn't like to create all elements just to get it's type. or
> isn't there any other way?

The gstreamer-mm C++ bindings do something like that, you could have a look at what they do (I suspect they just hard-code the API or introspect at build-time and generate wrappers from that).

Also, bugzilla is not a support forum, it's for bugs. Please use the mailing list for questions.
Comment 5 Sebastian Dröge (slomo) 2011-08-12 15:06:58 UTC
(In reply to comment #3)
> what does the "public API / public classes/objects" means?
> this means final elements's are not public? eg gst_identity_get_type?

The get_type() function is not public, the final elements are not "public" either. You only use the GObject and core/base GStreamer API on the elements (e.g. use GObject properties, signals, action signals, ...)

> the problem (in gstreamer-java):
> there're wrapper class for some gstreamer elements which add easier usage of
> native gstreamer elements. there're 2 ways for elements to be created:
> 1. when we (from java) create the element. in this case we know what is it.
> 2. when gstreamer itself create element eg: auto... or rtspsrc which create an
> inner rtpbin. when we got this element in java (eg: trough element-added
> signal) we'd like to cast it into the java wrapper class.
> 
> until now in gstreamer-java there is a global prefilled map which map GType to
> java wrapper classs. during startap we initialize this map eg:
> gst_bus_get_type(), Bus.class
> gst_bin_get_type(), Bin.class
> etc.
> so when we get an element we can find it's wrapper class.
> 
> so my question what can i do in case of such elements (like gstrtpbin) where
> the *_get_type function is not exported (gst_rtp_bin_get_type)?
> of course i wouldn't like to create all elements just to get it's type. or
> isn't there any other way?

In the C# bindings the GType and the mapping between managed and native types is implemented via the GType names