[gst-devel] Type macros

David I. Lehn dlehn at vt.edu
Tue Feb 22 16:20:03 CET 2005


* Torsten Schoenfeld <kaffeetisch at gmx.de> [2005-02-22T19:10:21-0500]:
> some type macros (notably GST_TYPE_OBJECT and GST_TYPE_ELEMENT) point
> directly to the static type variable instead of to the _get_type
> function.  This means that they will all be 0 until the corresponding
> _get_type function is called.  I realize that this does happen during
> gst_init(), but that might be too late.  Some things (like language
> bindings) rely on the type macros being valid at all times, even before
> gst_init() got called.
> 
> So, is there a reason those macros are defined the way they are?
> 

They are a performance optimization. At one point in the past, a
priority for GStreamer was to run on embedded systems and at very low
latency.  As I recall, those extra function calls were determined to be
a performance hit.  Perhaps GStreamer needs a good performance test
suite to check the benifit of such optimizations over time.

-dave




More information about the gstreamer-devel mailing list