See 8fe63000de for why having a TRUE/FALSE
return value is a bad idea.
I've scanned a few plugins and they generally get it wrong and aren't
unloadable when they return FALSE.
This is what can happen in a plugin_init function:
- An element based on GstBaseSink is registered
- Other elements fail to register
- The plugin_init function returns FALSE
Now if this the plugin is the first plugin to link against
libgstbase.so, it will have caused libgstbase.so to be loaded and static
strings from that library will have been added to gobject while
registering GstBaseSink.
So unloading the plugin will cause those strings to go stale and the
next plugin using GstBaseSink will crash. So we must not unload modules
after calling into them ever.
https://bugzilla.redhat.com/show_bug.cgi?id=572800
This brings total call speedups between 5% and 25%.
gst_caps_set_simple_valist: +5%
gst_structure_set_valist: + 10%
gst_structure_id_set_valist: +25%
gst_tag_list_add_valist: +5%
Measured using valgrind when run over the discovery of 200 media files.
Fixes#610256
The alignment guaranteed by malloc is not always sufficient. E.g. vector
instructions or hardware subsystems want specifically aligned buffers. The
attached patch will use posix_memalign if available to allocate buffers.
The desired alignment can be set when running configure using the new
--with-buffer-alignment option.
This changes some APIs in compatible ways:
- Some functions now take "const char *" arguments, not "char *"
- Some structs now have "conts char *" members, not "char *"
The changes may cause warnings when compiling with the right warning
flags. You've been warned.
Also adds -Wwrite-strings as a warning flag in configure.ac.
https://bugzilla.gnome.org/show_bug.cgi?id=611692
Adds that warning to configure.ac
Includes a tiny change of the GST_BOILERPLATE_FULL() macro:
The get_type() function is no longer declared before being defined.
https://bugzilla.gnome.org/show_bug.cgi?id=611692
Previous code treated "1/1yourmom" the same as "1/1" and "1wimsmom" the
same as "1". Now the code is stricter and will fail to convert a
fraction when followed by garbage text.
This may cause crashes when logging is enabled, especially on windows.
It's not safe to pass random pointers to g_type_check_instance_is_a().
Fixes#611719.
Add check to make sure gst-plugin-scanner really gets installed where
we will look for it later, ie. paths and prefixes are set at configure
time and not specified via make.
Fixes#609941.
Late g_thread_init() is fine with newer GLib versions and done automatically
from g_type_init() there, so don't warn if the application hasn't called
g_thread_init() yet when gst_init() is called with new GLib versions.
Fixes#608398.
Refactor the code to take the current start_time when going to PAUSED.
Make sure we also call the start_time update code after we chained up to the
parent bin.
Fixes#607842
If the GST_PLUGIN_SCANNER environment variable is set, we should try
the scanner specified there first, to make sure the right scanner binary
is used for uninstalled setups and builds from source when there's
already an installed version.
We require threads to be supported in any case and defining this
will simplify the mutex, condition variable, etc. macros from gthread
to not always check if threads are really supported.
Fixes bug #607481.
For the reason outlined at the beginning of gst_private.h (inline
functions in glib may need the g_log_domain variable). Also include
gst_private.h before using any G_OS_* defines, esp. in plugin loader.