[gstreamer-bugs] [Bug 169405] [API] GST_TYPE_EVENT and gst_event_get_type unusable before gst_init()

bugzilla-daemon at bugzilla.gnome.org bugzilla-daemon at bugzilla.gnome.org
Wed Mar 9 09:03:18 PST 2005


Please DO NOT reply to this by email. All additional comments should be made in
the comments box of this bug report.

 http://bugzilla.gnome.org/show_bug.cgi?id=169405
 GStreamer | gstreamer (core) | Ver: 0.8.9





------- Additional Comments From Torsten Schoenfeld  2005-03-09 12:03 -------
Yes, you need to call g_type_init() before any of the type stuff works at all. 
Our glib bindings do this automatically, and there's no way around it.  But
other than that, for normal gobject-based libraries, nothing else needs to be
called before the type macros are usable (pango, gtk+, libgnome(ui), etc.). 
GStreamer already uses a hack to increase performance: some type macros point
directly to the global type variable, instead of to the _get_type() function --
which means the type macros are not usable till the _get_type() function has
been called at least once.  But that can be easily worked around.

Automatically calling gst_init() at startup is no real option, as it prevents
the user from deciding when to initialize GStreamer -- which may sometimes be
necessary.

Currently, I work around this issue by delaying the registration and the setup
of the GstEvent wrappers until after gst_init() has been called.  That doesn't
help other problems that mainly occur during installation, though: our
documentation generation system relies on the introspection capabilities of the
type system to create the hierarchy graphs, properties information, etc. for all
 the gobject-based libraries we wrap -- and it doesn't call any initialization
function at the moment.

Also, I don't see the reason for deviating from the usual behavior. 
Performance-wise it's just as fast as the hack used for other types.

------- You are receiving this mail because: -------
You are the assignee for the bug.
You are the QA contact for the bug.




More information about the Gstreamer-bugs mailing list