gstreamer/gst
Sebastian Dröge a1c0ca3ac0 bus: Make setting/replacing/clearing the sync handler thread-safe
Previously we would use the object lock only for storing the sync
handler and its user_data in a local variable, then unlock it and only
then call the sync handler. Between unlocking and calling the sync
handler it might be unset and the user_data be freed, causing it to be
called with a freed pointer.

To prevent this add a refcounting wrapper struct around the sync
handler, hold the object lock while retrieving it and increasing the
reference count and only actually free it once the reference count
reaches zero.

As a side-effect we can now also allow to actually replace the sync
handler. Previously it was only allowed to clear it after initially
setting it according to the docs, but the code still allowed to clear it
and then set a different one.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/506
2020-02-14 18:51:35 +00:00
..
parse Revert "gst/parse: define pure-parser depending on bison version" 2019-12-03 10:40:44 +00:00
printf autotools: stop controlling symbol visibility with -export-symbols-regex 2018-08-12 23:26:25 +01:00
.gitignore gstbase: Add gobject-introspection support 2009-09-05 10:28:46 +02:00
gettext.h Fix FSF address 2012-11-03 20:44:48 +00:00
glib-compat-private.h Fix FSF address 2012-11-03 20:44:48 +00:00
glib-compat.c Whenever we include windows.h, also define WIN32_LEAN_AND_MEAN 2016-02-20 10:07:42 +00:00
glib-compat.h Headers: add missing includes. 2015-08-15 13:17:07 +02:00
gst-i18n-app.h Fix FSF address 2012-11-03 20:44:48 +00:00
gst-i18n-lib.h Fix FSF address 2012-11-03 20:44:48 +00:00
gst.c gstinfo: clean up function pointer names hashtable 2019-04-17 23:03:56 +02:00
gst.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gst_private.h gstinfo: clean up function pointer names hashtable 2019-04-17 23:03:56 +02:00
gstallocator.c Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 12:49:14 +02:00
gstallocator.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstatomicqueue.c introspection: add missing (nullable) annotations to return values 2014-06-26 18:56:38 +02:00
gstatomicqueue.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstbin.c bin: Fix deep-element-removed log message 2020-01-09 20:20:47 +00:00
gstbin.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstbuffer.c gst: Don't pass miniobjects to GST_DEBUG_OBJECT() and similar macros 2019-10-01 13:45:31 +00:00
gstbuffer.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstbufferlist.c gst: Add poisoning to more types 2018-08-03 14:31:34 +03:00
gstbufferlist.h gst_clear_*: Cast to GstMiniObject** when needed 2018-11-05 14:03:54 +01:00
gstbufferpool.c bufferpool: Fix the buffer size reset code 2019-08-08 18:49:40 +01:00
gstbufferpool.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstbus.c bus: Make setting/replacing/clearing the sync handler thread-safe 2020-02-14 18:51:35 +00:00
gstbus.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstcaps.c gst: Don't pass miniobjects to GST_DEBUG_OBJECT() and similar macros 2019-10-01 13:45:31 +00:00
gstcaps.h gstcaps: add gst_caps_set_features_simple() 2018-12-11 16:39:30 +01:00
gstcapsfeatures.c Fix typos in comments and docs 2018-05-01 11:18:03 +01:00
gstcapsfeatures.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstchildproxy.c gst: Fix string leak when G_VALUE_COLLECT_INIT() was failed 2018-11-12 20:12:41 +09:00
gstchildproxy.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstclock.c clock: Move clock GWeakRef to a private GstClockEntry struct 2018-11-08 09:07:07 +00:00
gstclock.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstcompat.h Port gtk-doc comments to their equivalent markdown syntax 2017-01-27 16:36:38 -03:00
gstconfig.h.in tests: fix tests when compiling with glib_checks=disabled 2018-11-10 15:37:36 +00:00
gstcontext.c gst: Add poisoning to more types 2018-08-03 14:31:34 +03:00
gstcontext.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstcontrolbinding.c controlbinding: Check if the weak pointer was cleared before explicitly removing it 2019-04-10 10:18:54 +03:00
gstcontrolbinding.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstcontrolsource.c gst: Don't ref_sink() GstObject subclasses in instance_init/constructor 2017-05-17 10:40:37 +03:00
gstcontrolsource.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstdatetime.c datetime: new() and new_local_time() constructors are not nullable 2019-01-29 14:49:28 +00:00
gstdatetime.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstdebugutils.c Fix typos in comments and docs 2018-05-01 11:18:03 +01:00
gstdebugutils.h debugutils: Make sure that GST_DEBUG_GRAPH_SHOW_VERBOSE gets the correct value in introspection 2018-11-10 19:08:52 +00:00
gstdevice.c Revert "device: Enforce that elements created by gst_device_create_element() are floating" 2019-12-05 10:45:10 +01:00
gstdevice.h Fix typos in comments and docs 2018-05-01 11:18:03 +01:00
gstdevicemonitor.c device-monitor: list hidden providers before listing devices 2020-02-05 09:08:31 +00:00
gstdevicemonitor.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstdeviceprovider.c deviceprovider: It's (transfer none) not (transfer-none) 2019-02-09 11:35:59 +02:00
gstdeviceprovider.h device-provider: Allow notifying application of device changes 2019-02-08 13:44:02 -03:00
gstdeviceproviderfactory.c Don't use deprecated g_object_newv() 2017-04-08 09:49:59 +01:00
gstdeviceproviderfactory.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstdynamictypefactory.c Don't use deprecated g_object_newv() 2017-04-08 09:49:59 +01:00
gstdynamictypefactory.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstelement.c gst_element_get_factory: update documentation 2019-03-14 13:12:52 +01:00
gstelement.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstelementfactory.c Revert "element: Enforce that elements created by gst_element_factory_create/make() are floating" 2019-12-05 10:45:49 +01:00
gstelementfactory.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstelementmetadata.h Headers: add missing includes. 2015-08-15 13:17:07 +02:00
gsterror.c Port gtk-doc comments to their equivalent markdown syntax 2017-01-27 16:36:38 -03:00
gsterror.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstevent.c event: fix seek event creation 2019-04-12 18:30:12 +02:00
gstevent.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstformat.c Port gtk-doc comments to their equivalent markdown syntax 2017-01-27 16:36:38 -03:00
gstformat.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstghostpad.c Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 12:49:14 +02:00
gstghostpad.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstinfo.c info: Take lock around all prinf on Windows 2019-10-01 12:40:32 +01:00
gstinfo.h gst: skip format specifiers from gir generation 2018-10-23 16:21:58 +01:00
gstiterator.c Port gtk-doc comments to their equivalent markdown syntax 2017-01-27 16:36:38 -03:00
gstiterator.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstmacros.h gstmacros.h: Fix restrict definition on MSVC 2019-02-20 17:51:40 +05:30
gstmemory.c gst: Add poisoning to more types 2018-08-03 14:31:34 +03:00
gstmemory.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstmessage.c gstmessage: Fix annotations on details 2019-03-06 19:34:12 +01:00
gstmessage.h message: fix up enum value for GST_MESSAGE_DEVICE_CHANGED 2019-08-09 09:10:04 +01:00
gstmeta.c buffer: store sequence number for metas 2019-02-12 17:53:08 +00:00
gstmeta.h buffer: store sequence number for metas 2019-02-12 17:53:08 +00:00
gstminiobject.c miniobject: free qdata array when the last qdata is removed 2019-09-08 19:42:59 +00:00
gstminiobject.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstobject.c gst_clear_*: Remove volatile from arguments 2018-11-05 14:16:36 +01:00
gstobject.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstpad.c gstpad: Probes that return HANDLED can reset the data info field 2019-08-08 09:49:31 +01:00
gstpad.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstpadtemplate.c padtemplate: Constructors are all nullable as they check the template name 2019-01-29 14:49:28 +00:00
gstpadtemplate.h gst: Add an example to GST_STATIC_PAD_TEMPLATE macro 2018-05-21 11:17:30 +02:00
gstparamspecs.c gst: Fix up a bunch of GIR annotations 2018-01-27 10:41:24 +00:00
gstparamspecs.h gst: Documentation fixes 2018-04-02 12:42:30 +02:00
gstparse.c gst: Simplify some boolean expressions 2018-07-24 09:58:31 +03:00
gstparse.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstpipeline.c Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 12:49:14 +02:00
gstpipeline.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstplugin.c plugin: add 0BSD as valid license 2019-02-25 14:58:22 +01:00
gstplugin.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gstpluginfeature.c Port gtk-doc comments to their equivalent markdown syntax 2017-01-27 16:36:38 -03:00
gstpluginfeature.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstpluginloader.c plugin: API: GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_RELATIVE_TO_EXE 2017-09-26 13:12:00 +02:00
gstpluginloader.h Headers: add missing includes. 2015-08-15 13:17:07 +02:00
gstpoll.c poll: minor docs clarification 2018-06-08 17:58:43 +01:00
gstpoll.h poll: add API to watch for POLLPRI 2018-06-08 11:53:55 -04:00
gstpreset.c Fix typos in comments and docs 2018-05-01 11:18:03 +01:00
gstpreset.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstpromise.c gst: Add poisoning to more types 2018-08-03 14:31:34 +03:00
gstpromise.h gst: Add support for g_autoptr(GstPromise) 2019-08-07 13:53:41 +01:00
gstprotection.c protection: Release decryptors list, even if it's empty 2018-06-25 16:38:13 +01:00
gstprotection.h protection: Fix the string to define unspecified system id 2018-10-03 19:28:08 +02:00
gstquark.c event: add new seek parameter, "trickmode-interval" 2019-04-01 17:13:32 +00:00
gstquark.h event: add new seek parameter, "trickmode-interval" 2019-04-01 17:13:32 +00:00
gstquery.c query: add a new bitrate query 2018-11-07 15:04:14 +00:00
gstquery.h query: add a new bitrate query 2018-11-07 15:04:14 +00:00
gstregistry.c registry: Use plugin directory from the build system for relocateable Windows builds 2019-08-09 12:29:37 +01:00
gstregistry.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstregistrybinary.c gst: Use memcpy() instead of strncpy() where appropriate 2018-05-07 17:05:36 +02:00
gstregistrybinary.h tracer: initial prototype for the tracing subsystem 2015-10-05 20:59:39 +02:00
gstregistrychunks.c Fix typos in comments and docs 2018-05-01 11:18:03 +01:00
gstregistrychunks.h dynamic types: Implement dynamic types in the registry 2016-11-02 11:21:37 +11:00
gstsample.c gst: Add poisoning to more types 2018-08-03 14:31:34 +03:00
gstsample.h sample: Update documentation 2018-05-21 11:36:42 +02:00
gstsegment.c segment: Allow stop == -1 in gst_segment_to_running_time() and rate < 0 2018-10-29 04:03:56 +11:00
gstsegment.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gststreamcollection.c Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 12:49:14 +02:00
gststreamcollection.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gststreams.c Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 12:49:14 +02:00
gststreams.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gststructure.c gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gststructure.h gst_clear_*: Remove volatile from arguments 2018-11-05 14:16:36 +01:00
gstsystemclock.c Run gst-indent through the files 2018-11-28 05:58:53 +02:00
gstsystemclock.h gst: Fix various Since markers 2019-08-06 16:00:11 +01:00
gsttaglist.c taglist: Remove (scope call) annotation from gst_tag_register() 2019-01-24 07:52:34 +00:00
gsttaglist.h gst_clear_*: Cast to GstMiniObject** when needed 2018-11-05 14:03:54 +01:00
gsttagsetter.c Port gtk-doc comments to their equivalent markdown syntax 2017-01-27 16:36:38 -03:00
gsttagsetter.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gsttask.c Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 12:49:14 +02:00
gsttask.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gsttaskpool.c gsttaskpool: Do not block tasks while cleaning up the taskpool 2019-03-08 17:27:30 +01:00
gsttaskpool.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gsttoc.c gst: Add poisoning to more types 2018-08-03 14:31:34 +03:00
gsttoc.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gsttocsetter.c Port gtk-doc comments to their equivalent markdown syntax 2017-01-27 16:36:38 -03:00
gsttocsetter.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gsttracer.c Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 12:49:14 +02:00
gsttracer.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gsttracerfactory.c docs: include tracers in the documentation 2017-12-14 14:46:46 +11:00
gsttracerfactory.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gsttracerrecord.c gst: Fix string leak when G_VALUE_COLLECT_INIT() was failed 2018-11-12 20:12:41 +09:00
gsttracerrecord.h Fix typos in comments and docs 2018-05-01 11:18:03 +01:00
gsttracerutils.c Fix typos in comments and docs 2018-05-01 11:18:03 +01:00
gsttracerutils.h gst: Documentation fixes 2018-04-02 12:42:30 +02:00
gsttypefind.c Don't use deprecated g_object_newv() 2017-04-08 09:49:59 +01:00
gsttypefind.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gsttypefindfactory.c Fix typos in comments and docs 2018-05-01 11:18:03 +01:00
gsttypefindfactory.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gsturi.c gsturi: Fix annotation on get_path to return a nullable 2019-03-06 19:46:46 +01:00
gsturi.h gsturi: include gstconfig.h earlier for GST_API define 2018-04-09 14:19:19 +01:00
gstutils.c utils: Set default values for position and duration query results 2018-09-03 12:06:35 +01:00
gstutils.h gst: GST_EXPORT -> GST_API 2018-03-13 00:45:35 +00:00
gstvalue.c Fix typos in comments and docs 2018-05-01 11:18:03 +01:00
gstvalue.h gst: skip format specifiers from gir generation 2018-10-23 16:21:58 +01:00
gstversion.h.in gstversion: Add missing include in .in file. 2015-08-15 13:26:12 +02:00
Makefile.am libs: fix 'inconsistent DLL linkage' warnings on Windows 2018-09-23 23:23:01 +01:00
math-compat.h Fix FSF address 2012-11-03 20:44:48 +00:00
meson.build meson: Link to objects instea of static helper library 2019-08-08 00:01:09 +01:00